Egglib 2.1.11
C++ library reference manual
MicrosatelliteDiversity.hpp
1 /*
2  Copyright 2008-2010 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 #ifndef EGGLIB_MICROSATELLITEDIVERSITY_HPP
21 #define EGGLIB_MICROSATELLITEDIVERSITY_HPP
22 
23 #include "DataMatrix.hpp"
24 #include <cstdlib>
25 
26 namespace egglib {
27 
39 
40  public:
41 
46 
47 
51  virtual ~MicrosatelliteDiversity();
52 
53 
65  void load(const DataMatrix& dataMatrix,
66  int missingData=999, bool noMissingData=false);
67 
68 
70  unsigned int numberOfSites() const;
71 
73  double He(unsigned int siteIndex) const;
74 
76  unsigned int numberOfAlleles(unsigned int siteIndex) const;
77 
79  double sizeVariance(unsigned int siteIndex) const;
80 
82  double thetaAssumingIAM(unsigned int siteIndex) const;
83 
85  double thetaAssumingSMMfromHe(unsigned int siteIndex) const;
86 
88  double thetaAssumingSMMfromSizeVariance(unsigned int siteIndex) const;
89 
90 
91  protected:
92 
93  unsigned int v_numberOfSites;
94  double *v_He;
95  unsigned int *v_numberOfAlleles;
96  double *v_sizeVariance;
97  double *v_thetaAssumingIAM;
98  double *v_thetaAssumingSMMfromHe;
99  double *v_thetaAssumingSMMfromSizeVariance;
100 
101  void init();
102  void clear();
103 
104 
105  private:
106 
107 
110  }
111 
113  MicrosatelliteDiversity& operator=(const MicrosatelliteDiversity& source) {
114  return *this;
115  }
116 
117  };
118 }
119 
120 #endif
Data table.
Definition: DataMatrix.hpp:41
unsigned int numberOfSites() const
Number of sites (or markers)
Definition: MicrosatelliteDiversity.cpp:177
Analyzes microsatellite data.
Definition: MicrosatelliteDiversity.hpp:38
unsigned int numberOfAlleles(unsigned int siteIndex) const
Number of alleles.
Definition: MicrosatelliteDiversity.cpp:185
double thetaAssumingIAM(unsigned int siteIndex) const
IAM-based estimator of theta.
Definition: MicrosatelliteDiversity.cpp:193
double thetaAssumingSMMfromSizeVariance(unsigned int siteIndex) const
SMM-based estimator of theta, calculated from VarSize.
Definition: MicrosatelliteDiversity.cpp:201
double sizeVariance(unsigned int siteIndex) const
Variance of allele size.
Definition: MicrosatelliteDiversity.cpp:189
double He(unsigned int siteIndex) const
Heterozygosity.
Definition: MicrosatelliteDiversity.cpp:181
MicrosatelliteDiversity()
Creates an object.
Definition: MicrosatelliteDiversity.cpp:27
Definition: ABC.cpp:37
double thetaAssumingSMMfromHe(unsigned int siteIndex) const
SMM-based estimator of theta, calculated from He.
Definition: MicrosatelliteDiversity.cpp:197
void load(const DataMatrix &dataMatrix, int missingData=999, bool noMissingData=false)
Performs the analysis.
Definition: MicrosatelliteDiversity.cpp:63
virtual ~MicrosatelliteDiversity()
Destroys an object.
Definition: MicrosatelliteDiversity.cpp:32

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