bpp-popgen  3.0.0
bpp::BiAlleleMonolocusGenotype Class Reference

The BiAlleleMonolocusGenotype class. More...

#include <Bpp/PopGen/BiAlleleMonolocusGenotype.h>

+ Inheritance diagram for bpp::BiAlleleMonolocusGenotype:
+ Collaboration diagram for bpp::BiAlleleMonolocusGenotype:

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...
 
BiAlleleMonolocusGenotypeoperator= (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:
BiAlleleMonolocusGenotypeclone () const
 

Private Attributes

std::vector< size_t > allele_index_
 

Detailed Description

The BiAlleleMonolocusGenotype class.

Author
Sylvain Gaillard

Definition at line 58 of file BiAlleleMonolocusGenotype.h.

Constructor & Destructor Documentation

◆ BiAlleleMonolocusGenotype() [1/3]

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() [2/3]

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() [3/3]

BiAlleleMonolocusGenotype::BiAlleleMonolocusGenotype ( const BiAlleleMonolocusGenotype bmg)

Copy constructor.

Definition at line 63 of file BiAlleleMonolocusGenotype.cpp.

References allele_index_, and getAlleleIndex().

◆ ~BiAlleleMonolocusGenotype()

BiAlleleMonolocusGenotype::~BiAlleleMonolocusGenotype ( )

Destroy the BiAlleleMonolocusGenotype.

Definition at line 73 of file BiAlleleMonolocusGenotype.cpp.

References allele_index_.

Member Function Documentation

◆ clone()

BiAlleleMonolocusGenotype * BiAlleleMonolocusGenotype::clone ( ) const
virtual

Implements bpp::Clonable.

Definition at line 115 of file BiAlleleMonolocusGenotype.cpp.

References BiAlleleMonolocusGenotype().

◆ getAlleleIndex()

std::vector< size_t > BiAlleleMonolocusGenotype::getAlleleIndex ( ) const
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.

Returns
A vector of size_t.

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==().

◆ getFirstAlleleIndex()

size_t BiAlleleMonolocusGenotype::getFirstAlleleIndex ( ) const

Get the first allele index.

Definition at line 95 of file BiAlleleMonolocusGenotype.cpp.

References allele_index_.

◆ getSecondAlleleIndex()

size_t BiAlleleMonolocusGenotype::getSecondAlleleIndex ( ) const

Get the second allele index.

Definition at line 100 of file BiAlleleMonolocusGenotype.cpp.

References allele_index_.

◆ isHomozygous()

bool BiAlleleMonolocusGenotype::isHomozygous ( ) const

Test the homozygozity of the locus.

Definition at line 105 of file BiAlleleMonolocusGenotype.cpp.

References allele_index_.

◆ operator=()

BiAlleleMonolocusGenotype & BiAlleleMonolocusGenotype::operator= ( const BiAlleleMonolocusGenotype bmg)

The affectation operator.

Definition at line 80 of file BiAlleleMonolocusGenotype.cpp.

References allele_index_, and getAlleleIndex().

◆ operator==()

bool BiAlleleMonolocusGenotype::operator== ( const BiAlleleMonolocusGenotype bmg) const

The == operator.

Definition at line 89 of file BiAlleleMonolocusGenotype.cpp.

References allele_index_, and getAlleleIndex().

Member Data Documentation

◆ allele_index_

std::vector<size_t> bpp::BiAlleleMonolocusGenotype::allele_index_
private

The documentation for this class was generated from the following files: