bpp-popgen
3.0.0
|
The MultilocusGenotype class. More...
#include <Bpp/PopGen/MultilocusGenotype.h>
Public Member Functions | |
MultilocusGenotype (size_t loci_number) | |
Build a MultilocusGenotype linked to an AnalyzedLoci object. More... | |
MultilocusGenotype (const MultilocusGenotype &genotype) | |
Copy constructor. More... | |
~MultilocusGenotype () | |
Destroy a MultilocusGenotype. More... | |
void | setMonolocusGenotype (size_t locus_position, const MonolocusGenotype &monogen) |
Set a MonolocusGenotype. More... | |
void | setMonolocusGenotypeByAlleleKey (size_t locus_position, const std::vector< size_t > &allele_keys) |
Set a MonolocusGenotype by allele keys. More... | |
void | setMonolocusGenotypeByAlleleId (size_t locus_position, const std::vector< std::string > &allele_id, const LocusInfo &locus_info) |
Set a MonolocusGenotype by allele id. More... | |
void | setMonolocusGenotypeAsMissing (size_t locus_position) |
Set a MonolocusGenotype as missing data. More... | |
bool | isMonolocusGenotypeMissing (size_t locus_position) const |
Tell if a MonolocusGenotype is a missing data. More... | |
const MonolocusGenotype & | getMonolocusGenotype (size_t locus_position) const |
Get a MonolocusGenotype. More... | |
size_t | size () const |
Count the number of loci. More... | |
size_t | countNonMissingLoci () const |
Count the number of non missing MonolocusGenotype. More... | |
size_t | countHomozygousLoci () const |
Count the number of homozygous MonolocusGenotype. More... | |
size_t | countHeterozygousLoci () const |
Count the number of heterozygous MonolocusGenotype. More... | |
Private Attributes | |
std::vector< MonolocusGenotype * > | loci_ |
The MultilocusGenotype class.
This is a MonolocusGenotype container.
Definition at line 65 of file MultilocusGenotype.h.
MultilocusGenotype::MultilocusGenotype | ( | size_t | loci_number | ) |
Build a MultilocusGenotype linked to an AnalyzedLoci object.
BadIntegerException | if loci_number < 1. |
Definition at line 47 of file MultilocusGenotype.cpp.
References loci_.
MultilocusGenotype::MultilocusGenotype | ( | const MultilocusGenotype & | genotype | ) |
Copy constructor.
Definition at line 59 of file MultilocusGenotype.cpp.
References bpp::Clonable::clone(), getMonolocusGenotype(), isMonolocusGenotypeMissing(), loci_, and size().
MultilocusGenotype::~MultilocusGenotype | ( | ) |
Destroy a MultilocusGenotype.
Definition at line 72 of file MultilocusGenotype.cpp.
References loci_.
size_t MultilocusGenotype::countHeterozygousLoci | ( | ) | const |
Count the number of heterozygous MonolocusGenotype.
Definition at line 188 of file MultilocusGenotype.cpp.
size_t MultilocusGenotype::countHomozygousLoci | ( | ) | const |
Count the number of homozygous MonolocusGenotype.
Definition at line 172 of file MultilocusGenotype.cpp.
size_t MultilocusGenotype::countNonMissingLoci | ( | ) | const |
Count the number of non missing MonolocusGenotype.
Definition at line 161 of file MultilocusGenotype.cpp.
const MonolocusGenotype & MultilocusGenotype::getMonolocusGenotype | ( | size_t | locus_position | ) | const |
Get a MonolocusGenotype.
Definition at line 149 of file MultilocusGenotype.cpp.
References loci_.
Referenced by bpp::MultilocusGenotypeStatistics::countBiAllelicForGroups(), bpp::MultilocusGenotypeStatistics::countHeterozygousForGroups(), bpp::MultilocusGenotypeStatistics::getAllelesMapForGroups(), bpp::MultilocusGenotypeStatistics::getHeterozygousFrqForGroups(), MultilocusGenotype(), bpp::PolymorphismMultiGContainerTools::permutAlleles(), bpp::PolymorphismMultiGContainerTools::permutIntraGroupAlleles(), bpp::PolymorphismMultiGContainerTools::permutIntraGroupMonoG(), bpp::PolymorphismMultiGContainerTools::permutMonoG(), bpp::DarwinVarSingle::write(), and bpp::PopgenlibIO::write().
bool MultilocusGenotype::isMonolocusGenotypeMissing | ( | size_t | locus_position | ) | const |
Tell if a MonolocusGenotype is a missing data.
IndexOutOfBoundsException | if locus_position excedes the number of loci. |
Definition at line 142 of file MultilocusGenotype.cpp.
References loci_.
Referenced by bpp::MultilocusGenotypeStatistics::countBiAllelicForGroups(), bpp::MultilocusGenotypeStatistics::countHeterozygousForGroups(), bpp::MultilocusGenotypeStatistics::countNonMissingForGroups(), bpp::MultilocusGenotypeStatistics::getAllelesMapForGroups(), bpp::MultilocusGenotypeStatistics::getHeterozygousFrqForGroups(), MultilocusGenotype(), bpp::PolymorphismMultiGContainerTools::permutAlleles(), bpp::PolymorphismMultiGContainerTools::permutIntraGroupAlleles(), bpp::DarwinVarSingle::write(), and bpp::PopgenlibIO::write().
void MultilocusGenotype::setMonolocusGenotype | ( | size_t | locus_position, |
const MonolocusGenotype & | monogen | ||
) |
Set a MonolocusGenotype.
Definition at line 83 of file MultilocusGenotype.cpp.
References bpp::Clonable::clone(), and loci_.
Referenced by bpp::PolymorphismMultiGContainerTools::permutAlleles(), bpp::PolymorphismMultiGContainerTools::permutIntraGroupAlleles(), bpp::PolymorphismMultiGContainerTools::permutIntraGroupMonoG(), bpp::PolymorphismMultiGContainerTools::permutMonoG(), and setMonolocusGenotypeByAlleleKey().
void MultilocusGenotype::setMonolocusGenotypeAsMissing | ( | size_t | locus_position | ) |
Set a MonolocusGenotype as missing data.
IndexOutOfBoundsException | if locus_position excedes the number of loci. |
Definition at line 133 of file MultilocusGenotype.cpp.
References loci_.
void MultilocusGenotype::setMonolocusGenotypeByAlleleId | ( | size_t | locus_position, |
const std::vector< std::string > & | allele_id, | ||
const LocusInfo & | locus_info | ||
) |
Set a MonolocusGenotype by allele id.
IndexOutOfBoundsException | if locus_position excedes the number of loci. |
AlleleNotFoundException | if at least one of the id is not found in the LocusInfo. |
Definition at line 108 of file MultilocusGenotype.cpp.
References bpp::LocusInfo::getAlleleInfoKey(), bpp::IndexOutOfBoundsException::getBadIndex(), bpp::IndexOutOfBoundsException::getBounds(), bpp::AlleleNotFoundException::getIdentifier(), and setMonolocusGenotypeByAlleleKey().
void MultilocusGenotype::setMonolocusGenotypeByAlleleKey | ( | size_t | locus_position, |
const std::vector< size_t > & | allele_keys | ||
) |
Set a MonolocusGenotype by allele keys.
IndexOutOfBoundsException | if locus_position excedes the number of loci. |
Exception | if there is no key in allele_keys. |
Definition at line 93 of file MultilocusGenotype.cpp.
References bpp::MonolocusGenotypeTools::buildMonolocusGenotypeByAlleleKey(), loci_, and setMonolocusGenotype().
Referenced by setMonolocusGenotypeByAlleleId().
size_t MultilocusGenotype::size | ( | ) | const |
Count the number of loci.
Return the size of _loci.
Definition at line 156 of file MultilocusGenotype.cpp.
References loci_.
Referenced by MultilocusGenotype(), bpp::DarwinVarSingle::write(), and bpp::PopgenlibIO::write().
|
private |
Definition at line 68 of file MultilocusGenotype.h.
Referenced by countHeterozygousLoci(), countHomozygousLoci(), countNonMissingLoci(), getMonolocusGenotype(), isMonolocusGenotypeMissing(), MultilocusGenotype(), setMonolocusGenotype(), setMonolocusGenotypeAsMissing(), setMonolocusGenotypeByAlleleKey(), size(), and ~MultilocusGenotype().