8
Copyright or © or Copr. CNRS, (November 17, 2004)
8
Copyright or © or Copr. Bio++ Development Team, (November 17, 2004)
10
10
This software is a computer program whose purpose is to provide classes
11
11
for population genetics analysis.
13
13
This software is governed by the CeCILL license under French law and
14
abiding by the rules of distribution of free software. You can use,
14
abiding by the rules of distribution of free software. You can use,
15
15
modify and/ or redistribute the software under the terms of the CeCILL
16
16
license as circulated by CEA, CNRS and INRIA at the following URL
17
"http://www.cecill.info".
17
"http://www.cecill.info".
19
19
As a counterpart to the access to the source code and rights to copy,
20
20
modify and redistribute granted by the license, users are provided only
21
21
with a limited warranty and the software's author, the holder of the
22
22
economic rights, and the successive licensors have only limited
25
25
In this respect, the user's attention is drawn to the risks associated
26
26
with loading, using, modifying and/or developing or reproducing the
29
29
therefore means that it is reserved for developers and experienced
30
30
professionals having in-depth computer knowledge. Users are therefore
31
31
encouraged to load and test the software's suitability as regards their
32
requirements in conditions enabling the security of their systems and/or
33
data to be ensured and, more generally, to use and operate it in the
34
same conditions as regards security.
32
requirements in conditions enabling the security of their systems and/or
33
data to be ensured and, more generally, to use and operate it in the
34
same conditions as regards security.
36
36
The fact that you are presently reading this means that you have had
37
37
knowledge of the CeCILL license and that you accept its terms.
40
40
#ifndef _MULTILOCUSGENOTYPE_H_
41
41
#define _MULTILOCUSGENOTYPE_H_
60
* @brief The MultilocusGenotype class.
62
* This is a MonolocusGenotype containor.
64
* @author Sylvain Gaillard
66
class MultilocusGenotype
69
std::vector<MonolocusGenotype*> loci_;
71
public: // Constructors and Destructor
73
* @brief Build a MultilocusGenotype linked to an AnalyzedLoci object.
75
* @throw BadIntegerException if loci_number < 1.
77
MultilocusGenotype(unsigned int loci_number) throw (BadIntegerException);
80
* @brief Copy constructor.
82
MultilocusGenotype(const MultilocusGenotype& genotype);
85
* @brief Destroy a MultilocusGenotype.
87
~MultilocusGenotype();
91
* @brief Set a MonolocusGenotype.
93
void setMonolocusGenotype(unsigned int locus_position,
94
const MonolocusGenotype& monogen) throw (IndexOutOfBoundsException);
97
* @brief Set a MonolocusGenotype by allele keys.
99
* @throw IndexOutOfBoundsException if locus_position excedes the number of loci.
100
* @throw Exception if there is no key in allele_keys.
102
void setMonolocusGenotypeByAlleleKey(unsigned int locus_position,
103
const std::vector<unsigned int>& allele_keys) throw (Exception);
106
* @brief Set a MonolocusGenotype by allele id.
108
* @throw IndexOutOfBoundsException if locus_position excedes the number of loci.
109
* @throw AlleleNotFoundException if at least one of the id is not found in the LocusInfo.
111
void setMonolocusGenotypeByAlleleId(unsigned int locus_position,
112
const std::vector<std::string>& allele_id, const LocusInfo& locus_info) throw (Exception);
115
* @brief Set a MonolocusGenotype as missing data.
117
* @throw IndexOutOfBoundsException if locus_position excedes the number of loci.
119
void setMonolocusGenotypeAsMissing(unsigned int locus_position) throw (IndexOutOfBoundsException);
122
* @brief Tell if a MonolocusGenotype is a missing data.
124
* @throw IndexOutOfBoundsException if locus_position excedes the number of loci.
126
bool isMonolocusGenotypeMissing(unsigned int locus_position) const throw (IndexOutOfBoundsException);
129
* @brief Get a MonolocusGenotype.
131
const MonolocusGenotype& getMonolocusGenotype(unsigned int locus_position) const
132
throw (IndexOutOfBoundsException);
135
* @brief Count the number of loci.
137
* Return the size of _loci.
139
unsigned int size() const;
142
* @brief Count the number of non missing MonolocusGenotype.
144
unsigned int countNonMissingLoci() const;
147
* @brief Count the number of homozygous MonolocusGenotype.
149
unsigned int countHomozygousLoci() const;
152
* @brief Count the number of heterozygous MonolocusGenotype.
154
unsigned int countHeterozygousLoci() const;
157
} //end of namespace bpp;
59
* @brief The MultilocusGenotype class.
61
* This is a MonolocusGenotype containor.
63
* @author Sylvain Gaillard
65
class MultilocusGenotype
68
std::vector<MonolocusGenotype*> loci_;
71
// Constructors and Destructor
73
* @brief Build a MultilocusGenotype linked to an AnalyzedLoci object.
75
* @throw BadIntegerException if loci_number < 1.
77
MultilocusGenotype(size_t loci_number) throw (BadIntegerException);
80
* @brief Copy constructor.
82
MultilocusGenotype(const MultilocusGenotype& genotype);
85
* @brief Destroy a MultilocusGenotype.
87
~MultilocusGenotype();
91
* @brief Set a MonolocusGenotype.
93
void setMonolocusGenotype(size_t locus_position,
94
const MonolocusGenotype& monogen) throw (IndexOutOfBoundsException);
97
* @brief Set a MonolocusGenotype by allele keys.
99
* @throw IndexOutOfBoundsException if locus_position excedes the number of loci.
100
* @throw Exception if there is no key in allele_keys.
102
void setMonolocusGenotypeByAlleleKey(size_t locus_position,
103
const std::vector<size_t>& allele_keys) throw (Exception);
106
* @brief Set a MonolocusGenotype by allele id.
108
* @throw IndexOutOfBoundsException if locus_position excedes the number of loci.
109
* @throw AlleleNotFoundException if at least one of the id is not found in the LocusInfo.
111
void setMonolocusGenotypeByAlleleId(size_t locus_position,
112
const std::vector<std::string>& allele_id, const LocusInfo& locus_info) throw (Exception);
115
* @brief Set a MonolocusGenotype as missing data.
117
* @throw IndexOutOfBoundsException if locus_position excedes the number of loci.
119
void setMonolocusGenotypeAsMissing(size_t locus_position) throw (IndexOutOfBoundsException);
122
* @brief Tell if a MonolocusGenotype is a missing data.
124
* @throw IndexOutOfBoundsException if locus_position excedes the number of loci.
126
bool isMonolocusGenotypeMissing(size_t locus_position) const throw (IndexOutOfBoundsException);
129
* @brief Get a MonolocusGenotype.
131
const MonolocusGenotype& getMonolocusGenotype(size_t locus_position) const
132
throw (IndexOutOfBoundsException);
135
* @brief Count the number of loci.
137
* Return the size of _loci.
142
* @brief Count the number of non missing MonolocusGenotype.
144
size_t countNonMissingLoci() const;
147
* @brief Count the number of homozygous MonolocusGenotype.
149
size_t countHomozygousLoci() const;
152
* @brief Count the number of heterozygous MonolocusGenotype.
154
size_t countHeterozygousLoci() const;
156
} // end of namespace bpp;
159
158
#endif // _MULTILOCUSGENOTYPE_H_