bpp-popgen3  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 firstAlleleIndex, size_t secondAlleleIndex)
 Build a monolocus genotype containing two alleles. More...
 
 BiAlleleMonolocusGenotype (std::vector< size_t > alleleIndex)
 Build a monolocus genotype containing two alleles. More...
 
 BiAlleleMonolocusGenotype (const BiAlleleMonolocusGenotype &bmg)
 Copy constructor. More...
 
virtual ~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 override
 Get the alleles' index. More...
 
The Clonable interface:
BiAlleleMonolocusGenotypeclone () const override
 

Private Attributes

std::vector< size_t > alleleIndex_
 

Detailed Description

The BiAlleleMonolocusGenotype class.

Author
Sylvain Gaillard

Definition at line 24 of file BiAlleleMonolocusGenotype.h.

Constructor & Destructor Documentation

◆ BiAlleleMonolocusGenotype() [1/3]

BiAlleleMonolocusGenotype::BiAlleleMonolocusGenotype ( size_t  firstAlleleIndex,
size_t  secondAlleleIndex 
)

Build a monolocus genotype containing two alleles.

Definition at line 12 of file BiAlleleMonolocusGenotype.cpp.

References alleleIndex_.

Referenced by clone().

◆ BiAlleleMonolocusGenotype() [2/3]

BiAlleleMonolocusGenotype::BiAlleleMonolocusGenotype ( std::vector< size_t >  alleleIndex)

Build a monolocus genotype containing two alleles.

Definition at line 20 of file BiAlleleMonolocusGenotype.cpp.

References alleleIndex_.

◆ BiAlleleMonolocusGenotype() [3/3]

BiAlleleMonolocusGenotype::BiAlleleMonolocusGenotype ( const BiAlleleMonolocusGenotype bmg)

Copy constructor.

Definition at line 29 of file BiAlleleMonolocusGenotype.cpp.

References alleleIndex_, and getAlleleIndex().

◆ ~BiAlleleMonolocusGenotype()

BiAlleleMonolocusGenotype::~BiAlleleMonolocusGenotype ( )
virtual

Destroy the BiAlleleMonolocusGenotype.

Definition at line 40 of file BiAlleleMonolocusGenotype.cpp.

References alleleIndex_.

Member Function Documentation

◆ clone()

BiAlleleMonolocusGenotype* bpp::BiAlleleMonolocusGenotype::clone ( ) const
inlineoverridevirtual

◆ getAlleleIndex()

std::vector<size_t> bpp::BiAlleleMonolocusGenotype::getAlleleIndex ( ) const
inlineoverridevirtual

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::MonolocusGenotypeInterface.

Definition at line 93 of file BiAlleleMonolocusGenotype.h.

References alleleIndex_.

Referenced by BiAlleleMonolocusGenotype(), operator=(), and operator==().

◆ getFirstAlleleIndex()

size_t bpp::BiAlleleMonolocusGenotype::getFirstAlleleIndex ( ) const
inline

Get the first allele index.

Definition at line 67 of file BiAlleleMonolocusGenotype.h.

References alleleIndex_.

◆ getSecondAlleleIndex()

size_t bpp::BiAlleleMonolocusGenotype::getSecondAlleleIndex ( ) const
inline

Get the second allele index.

Definition at line 75 of file BiAlleleMonolocusGenotype.h.

References alleleIndex_.

◆ isHomozygous()

bool bpp::BiAlleleMonolocusGenotype::isHomozygous ( ) const
inline

Test the homozygozity of the locus.

Definition at line 83 of file BiAlleleMonolocusGenotype.h.

References alleleIndex_.

◆ operator=()

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

The affectation operator.

Definition at line 47 of file BiAlleleMonolocusGenotype.cpp.

References alleleIndex_, and getAlleleIndex().

◆ operator==()

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

The == operator.

Definition at line 56 of file BiAlleleMonolocusGenotype.cpp.

References alleleIndex_, and getAlleleIndex().

Member Data Documentation

◆ alleleIndex_

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

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