Debian Codegraph @

src/metapop.h

raw
1
2 /***************************************************************************
3 MetaPop.h - Librairie d'objets permettant de manipuler des données
4 spécifiques aux populations
5 -------------------
6 begin : ven sep 01 10:25:55 CEST 2000
7 copyright : (C) 2000 by Olivier Langella CNRS UPR9034
8 email : [email protected]
9 ***************************************************************************/
10
11 /***************************************************************************
12 * *
13 * This program is free software; you can redistribute it and/or modify *
14 * it under the terms of the GNU General Public License as published by *
15 * the Free Software Foundation; either version 2 of the License, or *
16 * (at your option) any later version. *
17 * *
18 ***************************************************************************/
19
20 // population
21
22 #ifndef METAPOP_H
23 #define METAPOP_H
24
25 #include "locus.h"
26 #include "strucpop.h"
27 #include "population.h"
28 #include "vecteurs.h"
29
30 using namespace biolib::vecteurs;
31
32 class MetaPop: public StrucPop {
33 public:
34 MetaPop(Jeupop * pdonnees);
35 MetaPop(MetaPop * pmetapopsup);
36 MetaPop(const MetaPop & popori, MetaPop * Pmetapop, Jeupop * Pjeu);
37 ~MetaPop();
38
39 bool DuType(const string & nom) const;
40 friend class Jeupop;
41
42 void AjouterIndividu(Individu * Pind);
43 void AjouterPopulation(MetaPop * );
44 void AjouterPopulation(Population * );
45
46 MetaPop * NewMetaPop(const biolib::vecteurs::ChaineCar & nom);
47 Population * new_population(string & nom);
48
49 unsigned long get_nbpop() const {return(_tabPstrucpop.size());};
50 unsigned long get_nbmetapop() const {return(_tabPmetapop.size());};
51 const MetaPop * get_tabPmetapop(unsigned int i) const {return (_tabPmetapop[i]);};
52 const string & get_nompop(unsigned int i) const {return(_tabPstrucpop[i]->get_nom());};
53 void get_nomniveauxstruc(Titre & nom_niveaux) const;
54 unsigned int get_niveau() const {return (_niveau_struc);};
55
56 void set_nploidie();
57
58 void f_rempliTabStrucPop(Vecteur<StrucPop*> &, unsigned int);
59
60 long double f_Mheterozygotieobs(unsigned long locus) const;
61 long double f_Mheterozygotieatt(unsigned long locus) const;
62 long double f_Mheterozygotietotale(unsigned long locus) const;
63
64 long double f_M_Fis(unsigned long locus) const;
65 long double f_M_Fst(unsigned long locus) const;
66 long double f_M_Fit(unsigned long locus) const;
67
68 void oPopulationsXML(unsigned int id, ostream & sortie, ostream & infos) ;
69
70 /** Retourne vrai, si l'allele n'est pas présent dans MetaPop */
71 bool r_allelenonpresent(Allele * Pall) const;
72 protected:
73 /** Suppression de la Population Ppop */
74 void SupprPop(StrucPop * Ppop);
75 MetaPop * get_Ptabmetapop(const StrucPop *) const;
76
77 void ifAjouterIndividu(const Individu * Pind);
78
79 void reset();
80
81 /** réaffectation du nombre de locus
82 */
83 void set_nbloc();
84 unsigned int _niveau_struc;
85
86 vector<StrucPop *> _tabPstrucpop;
87
88 vector<MetaPop *> _tabPmetapop;
89
90 };
91
92 #endif
93