| 1 |
/*************************************************************************** |
| 2 |
jeupopexp.h - Classe dérivée de Jeupop, spécialisée |
| 3 |
dans l'exportation des données |
| 4 |
------------------- |
| 5 |
begin : Tue Oct 24 2000 |
| 6 |
copyright : (C) 2000 by Olivier Langella |
| 7 |
email : [email protected] |
| 8 |
***************************************************************************/ |
| 9 |
|
| 10 |
/*************************************************************************** |
| 11 |
* * |
| 12 |
* This program is free software; you can redistribute it and/or modify * |
| 13 |
* it under the terms of the GNU General Public License as published by * |
| 14 |
* the Free Software Foundation; either version 2 of the License, or * |
| 15 |
* (at your option) any later version. * |
| 16 |
* * |
| 17 |
***************************************************************************/ |
| 18 |
|
| 19 |
#ifndef JEUPOPEXP_H |
| 20 |
#define JEUPOPEXP_H |
| 21 |
|
| 22 |
//#include <String.h> |
| 23 |
#include <iomanip> |
| 24 |
#include "jeupop.h" |
| 25 |
#include "vecteurs.h" |
| 26 |
|
| 27 |
/** |
| 28 |
*@author Olivier Langella |
| 29 |
*/ |
| 30 |
|
| 31 |
class JeuPopExp { |
| 32 |
public: |
| 33 |
JeuPopExp(Jeupop *); |
| 34 |
~JeuPopExp(); |
| 35 |
|
| 36 |
void oLea(unsigned long P1,unsigned long P2,unsigned long H, ostream & sortie, ostream & infos); |
| 37 |
/** Exportation au format "admix" de G. Bertorelle |
| 38 |
voir le site: |
| 39 |
http://www.unife.it/genetica/Giorgio/giorgio.html |
| 40 |
*/ |
| 41 |
void oAdmix_dat(unsigned long P1,unsigned long P2,unsigned long H, ostream & sortie, ostream & infos); |
| 42 |
void oAdmix_mtx(ostream & sortie, ostream & infos); |
| 43 |
void oGenetix(ostream & sortie, ostream & infos); |
| 44 |
void oFstat(ostream & sortie, ostream & infos); |
| 45 |
void oPopulationsXML(ostream & sortie, ostream & infos) const; |
| 46 |
|
| 47 |
private: |
| 48 |
const Jeupop * _Pjeu; |
| 49 |
Jeupop * _Pcopie; |
| 50 |
/** Prépare une copie de jeupop avec 3 |
| 51 |
populations P1, P2, H (special admixture) */ |
| 52 |
void f_prepP1P2H(unsigned long P1,unsigned long P2,unsigned long H, ostream & infos); |
| 53 |
|
| 54 |
public: |
| 55 |
struct Anomalie{ |
| 56 |
|
| 57 |
int le_pb; |
| 58 |
Anomalie (int i, string format):le_pb(i), _format(format){}; |
| 59 |
string _message; |
| 60 |
string _format; |
| 61 |
|
| 62 |
string& fmessage(int num){ |
| 63 |
switch (num) { |
| 64 |
case 1: |
| 65 |
_message = _("Error n°1 in JeuPopExp while exporting to "); |
| 66 |
_message += _format; |
| 67 |
break; |
| 68 |
case 2: |
| 69 |
_message = _("Error n°2 in JeuPopExp: incompatible alleles names to export in "); |
| 70 |
_message += _format; |
| 71 |
break; |
| 72 |
case 100: |
| 73 |
_message = _("Error n°100 in JeuPopExp: "); |
| 74 |
_message += _format; |
| 75 |
_message += _(" require diploid populations"); |
| 76 |
break; |
| 77 |
|
| 78 |
case 1000: |
| 79 |
_message = _("Error n°1000 in JeuPopExp: locus names do not exceed 5 caracters in "); |
| 80 |
_message += _format; |
| 81 |
break; |
| 82 |
case 1001: |
| 83 |
_message = _("Error n°1001 in JeuPopExp: individual names do not exceed 10 caracters in "); |
| 84 |
_message += _format; |
| 85 |
break; |
| 86 |
default: |
| 87 |
_message = _("Error in JeuPopExp"); |
| 88 |
break; |
| 89 |
} |
| 90 |
return(_message); |
| 91 |
} |
| 92 |
}; |
| 93 |
|
| 94 |
}; |
| 95 |
|
| 96 |
#endif |
| 97 |
|