Egglib 2.1.11
C++ library reference manual
HaplotypeDiversity.hpp
1 /*
2  Copyright 2008-2009 Stéphane De Mita, Mathieu Siol
3 
4  This file is part of the EggLib library.
5 
6  EggLib is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  EggLib is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with EggLib. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 
21 #ifndef EGGLIB_HAPLOTYPEDIVERSITY_HPP
22 #define EGGLIB_HAPLOTYPEDIVERSITY_HPP
23 
24 #include "BaseDiversity.hpp"
25 
26 namespace egglib {
27 
28 
57 
58  public:
59 
64 
68  virtual ~HaplotypeDiversity();
69 
109  void load(CharMatrix& data,
110  bool allowMultipleMutations=false,
111  unsigned int ignoreFrequency=0,
112  std::string characterMapping=dnaMapping
113  );
114 
116  unsigned int K() const;
117 
119  double He() const;
120 
127  unsigned int haplotypeIndex(unsigned int) const;
128 
130  double Kst() const;
131 
133  double Fst() const;
134 
136  double Gst() const;
137 
139  double Hst() const;
140 
142  double Snn() const;
143 
144 
145  protected:
146 
147  void init();
148  void clear();
149 
150  inline unsigned int diff(CharMatrix& data, unsigned int ind1, unsigned int ind2) const;
151 
152  bool m_loaded;
153  unsigned int m_K;
154  double m_He;
155  double m_Kst;
156  double m_Fst;
157  double m_Gst;
158  double m_Hst;
159  double m_Snn;
160  unsigned int *m_haplotypeIndex;
161 
162 
163  private:
164 
165  HaplotypeDiversity(const HaplotypeDiversity& source) {
166 
167  }
168 
169  HaplotypeDiversity& operator=(const HaplotypeDiversity& source) {
170  return *this;
171  }
172 
173  };
174 }
175 
176 #endif
Base class of diversity classes.
Definition: BaseDiversity.hpp:60
double Kst() const
Population differenciation, based on nucleotides (Hudson 1992a)
Definition: HaplotypeDiversity.cpp:345
void load(CharMatrix &data, bool allowMultipleMutations=false, unsigned int ignoreFrequency=0, std::string characterMapping=dnaMapping)
Identifies polymorphic sites and computes basis statistics.
Definition: HaplotypeDiversity.cpp:67
double Fst() const
Population differenciation, based on nucleotides (Hudson 1992b)
Definition: HaplotypeDiversity.cpp:350
unsigned int K() const
Number of distinct haplotypes.
Definition: HaplotypeDiversity.cpp:329
double Snn() const
Hudson's Snn (nearest neighbor statistics)
Definition: HaplotypeDiversity.cpp:365
Computes diversity based on haplotype analysis.
Definition: HaplotypeDiversity.hpp:56
double He() const
Haplotype diversity (unbiased)
Definition: HaplotypeDiversity.cpp:334
virtual ~HaplotypeDiversity()
Destructor.
Definition: HaplotypeDiversity.cpp:60
double Hst() const
Population differenciation, based on haplotypes (Hudson et al. version)
Definition: HaplotypeDiversity.cpp:360
Definition: ABC.cpp:37
unsigned int haplotypeIndex(unsigned int) const
Returns the allele number of a given sequence.
Definition: HaplotypeDiversity.cpp:339
static const std::string dnaMapping
Predefined mapping string for DNA data.
Definition: BaseDiversity.hpp:98
double Gst() const
Population differenciation, based on haplotypes (Nei version)
Definition: HaplotypeDiversity.cpp:355
HaplotypeDiversity()
Constructor.
Definition: HaplotypeDiversity.cpp:55
Interface for classes usable as a square matrix of characters.
Definition: CharMatrix.hpp:31

Hosted by 
Get EggLib at SourceForge.net. Fast, secure and Free Open Source software downloads