bpp-popgen
3.0.0
|
The BiAlleleMonolocusGenotype class. More...
#include <Bpp/PopGen/BiAlleleMonolocusGenotype.h>
Public Member Functions | |
BiAlleleMonolocusGenotype (size_t first_allele_index, size_t second_allele_index) | |
Build a monolocus genotype containing two alleles. More... | |
BiAlleleMonolocusGenotype (std::vector< size_t > allele_index) | |
Build a monolocus genotype containing two alleles. More... | |
BiAlleleMonolocusGenotype (const BiAlleleMonolocusGenotype &bmg) | |
Copy constructor. More... | |
~BiAlleleMonolocusGenotype () | |
Destroy the BiAlleleMonolocusGenotype. More... | |
BiAlleleMonolocusGenotype & | operator= (const BiAlleleMonolocusGenotype &bmg) |
The affectation operator. More... | |
bool | operator== (const BiAlleleMonolocusGenotype &bmg) const |
The == operator. More... | |
size_t | getFirstAlleleIndex () const |
Get the first allele index. More... | |
size_t | getSecondAlleleIndex () const |
Get the second allele index. More... | |
bool | isHomozygous () const |
Test the homozygozity of the locus. More... | |
The MonolocusGenotype interface: | |
std::vector< size_t > | getAlleleIndex () const |
Get the alleles' index. More... | |
The Clonable interface: | |
BiAlleleMonolocusGenotype * | clone () const |
Private Attributes | |
std::vector< size_t > | allele_index_ |
The BiAlleleMonolocusGenotype class.
Definition at line 58 of file BiAlleleMonolocusGenotype.h.
BiAlleleMonolocusGenotype::BiAlleleMonolocusGenotype | ( | size_t | first_allele_index, |
size_t | second_allele_index | ||
) |
Build a monolocus genotype containing two alleles.
Definition at line 47 of file BiAlleleMonolocusGenotype.cpp.
References allele_index_.
Referenced by clone().
BiAlleleMonolocusGenotype::BiAlleleMonolocusGenotype | ( | std::vector< size_t > | allele_index | ) |
Build a monolocus genotype containing two alleles.
Definition at line 55 of file BiAlleleMonolocusGenotype.cpp.
References allele_index_.
BiAlleleMonolocusGenotype::BiAlleleMonolocusGenotype | ( | const BiAlleleMonolocusGenotype & | bmg | ) |
Copy constructor.
Definition at line 63 of file BiAlleleMonolocusGenotype.cpp.
References allele_index_, and getAlleleIndex().
BiAlleleMonolocusGenotype::~BiAlleleMonolocusGenotype | ( | ) |
Destroy the BiAlleleMonolocusGenotype.
Definition at line 73 of file BiAlleleMonolocusGenotype.cpp.
References allele_index_.
|
virtual |
Implements bpp::Clonable.
Definition at line 115 of file BiAlleleMonolocusGenotype.cpp.
References BiAlleleMonolocusGenotype().
|
virtual |
Get the alleles' index.
The alleles' index are the position of the AlleleInfo in a LocusInfo object. If no LocusInfo is used, the index are just numbers to identify the alleles.
The size of the vector corresponds to the number of alleles at this locus.
Implements bpp::MonolocusGenotype.
Definition at line 110 of file BiAlleleMonolocusGenotype.cpp.
References allele_index_.
Referenced by BiAlleleMonolocusGenotype(), operator=(), and operator==().
size_t BiAlleleMonolocusGenotype::getFirstAlleleIndex | ( | ) | const |
Get the first allele index.
Definition at line 95 of file BiAlleleMonolocusGenotype.cpp.
References allele_index_.
size_t BiAlleleMonolocusGenotype::getSecondAlleleIndex | ( | ) | const |
Get the second allele index.
Definition at line 100 of file BiAlleleMonolocusGenotype.cpp.
References allele_index_.
bool BiAlleleMonolocusGenotype::isHomozygous | ( | ) | const |
Test the homozygozity of the locus.
Definition at line 105 of file BiAlleleMonolocusGenotype.cpp.
References allele_index_.
BiAlleleMonolocusGenotype & BiAlleleMonolocusGenotype::operator= | ( | const BiAlleleMonolocusGenotype & | bmg | ) |
The affectation operator.
Definition at line 80 of file BiAlleleMonolocusGenotype.cpp.
References allele_index_, and getAlleleIndex().
bool BiAlleleMonolocusGenotype::operator== | ( | const BiAlleleMonolocusGenotype & | bmg | ) | const |
The == operator.
Definition at line 89 of file BiAlleleMonolocusGenotype.cpp.
References allele_index_, and getAlleleIndex().
|
private |
Definition at line 62 of file BiAlleleMonolocusGenotype.h.
Referenced by BiAlleleMonolocusGenotype(), getAlleleIndex(), getFirstAlleleIndex(), getSecondAlleleIndex(), isHomozygous(), operator=(), operator==(), and ~BiAlleleMonolocusGenotype().