Debian Codegraph @

src/locus.h

raw
1 /***************************************************************************
2 locus.h - Librairie d'objets permettant de manipuler des données
3 spécifiques aux locus
4 -------------------
5 begin : ven sep 01 10:25:55 CEST 2000
6 copyright : (C) 2000 by Olivier Langella CNRS UPR9034
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 // bibliothèque d'objets permettant de manipuler des
20 // donnees sur des populations
21 // ecrit par Olivier Langella le 21/4/98
22 // modifie le 01/09/2000 par Olivier Langella pour apporter les capacités de structurations
23 // de populations
24
25
26 #ifndef LOCUS_H
27 #define LOCUS_H
28
29 class Jeupop;
30 #include"allele.h"
31 #include "vecteurs.h"
32 //typedef biolib::vecteurs::ChaineCar ChaineCar;
33
34
35 long double fact (int n);
36 long double fact (int n, int m);
37 long double comb (int n, int m);
38
39 // locus
40 class Locus {
41 public :
42 // Locus(const Locus&); //constructeur de copies
43 Locus(const Locus& original, Jeupop * Pjeu);//constructeur de copies
44 Locus(long nball);
45 Locus(Jeupop *, long nball);
46 ~Locus();
47 void reset(Jeupop *,long);//pointeur sur Jeupop,nball
48 Allele * new_allele(const string & name, unsigned int nbrepeat);
49
50
51 // int getnballdif() const;
52 unsigned long get_nball() const {return(_tabPall.size());};
53 unsigned long get_numloc() ;
54 Allele * getPall(const string & nom) const ;
55 Allele * getPallNul();
56 Allele * getPall(long i) const {return(_tabPall[i]);};
57 const char * get_nomall(int i) const {return(_tabPall[i]->_nom.c_str());};
58 // const char * get_nom() {return(_nom.c_str());};
59 const string& get_nom() const {return(_nom);};
60 bool f_verifnum(int) const;
61
62 inline void set_PJeupop(Jeupop * Pjeu);
63 void set_nom(const string& mot) {_nom.assign(mot);};
64 void set_microsat_correction(long double valmin, long double valmax, unsigned int value);
65
66 void ifAjouterAllele(const Allele * Pall);
67
68
69 friend class Jeupop;
70
71 const Locus & operator= (const Locus &);
72 /** Enlève les allèles non représentés dans Jeupop
73 */
74 void f_nettoieAlleles();
75 /** Retourne le nombre d'allèles non nuls pour ce locus */
76 unsigned long get_nballnonnuls() const;
77
78 private :
79 void f_trad2Gpop(ostream&);
80
81 string _nom;
82 Jeupop * _Pjeu;
83 vector<Allele*> _tabPall;
84 };
85
86 #endif
87