bpp-popgen3  3.0.0
bpp::MultiAlleleMonolocusGenotype Class Reference

The MultiAlleleMonolocusGenotype class. More...

#include <Bpp/PopGen/MultiAlleleMonolocusGenotype.h>

+ Inheritance diagram for bpp::MultiAlleleMonolocusGenotype:
+ Collaboration diagram for bpp::MultiAlleleMonolocusGenotype:

Public Member Functions

 MultiAlleleMonolocusGenotype (std::vector< size_t > alleleIndex)
 Build a monolocus genotype containing many alleles. More...
 
 MultiAlleleMonolocusGenotype (const MultiAlleleMonolocusGenotype &mmg)
 Copy constructor. More...
 
virtual ~MultiAlleleMonolocusGenotype ()
 Destroy the MultiAlleleMonolocusGenotype. More...
 
MultiAlleleMonolocusGenotypeoperator= (const MultiAlleleMonolocusGenotype &mmg)
 The affectation operator. More...
 
bool operator== (const MultiAlleleMonolocusGenotype &mmg) const
 The == operator. More...
 
bool isHomozygous () const
 Test the homozygozity of the locus (i.e. all allele are identical). More...
 
The MonolocusGenotype interface:
std::vector< size_t > getAlleleIndex () const override
 Get the alleles' index. More...
 
The Clonable interface:
MultiAlleleMonolocusGenotypeclone () const override
 

Private Attributes

std::vector< size_t > alleleIndex_
 

Detailed Description

The MultiAlleleMonolocusGenotype class.

This class is intended to handle monolocus genotype with many alleles like polyploid loci or loci obtained by trace file without cutoff on peaks or other filter.

Author
Sylvain Gaillard

Definition at line 28 of file MultiAlleleMonolocusGenotype.h.

Constructor & Destructor Documentation

◆ MultiAlleleMonolocusGenotype() [1/2]

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

Build a monolocus genotype containing many alleles.

Definition at line 12 of file MultiAlleleMonolocusGenotype.cpp.

References alleleIndex_.

Referenced by clone().

◆ MultiAlleleMonolocusGenotype() [2/2]

MultiAlleleMonolocusGenotype::MultiAlleleMonolocusGenotype ( const MultiAlleleMonolocusGenotype mmg)

Copy constructor.

Definition at line 20 of file MultiAlleleMonolocusGenotype.cpp.

References alleleIndex_, and getAlleleIndex().

◆ ~MultiAlleleMonolocusGenotype()

MultiAlleleMonolocusGenotype::~MultiAlleleMonolocusGenotype ( )
virtual

Destroy the MultiAlleleMonolocusGenotype.

Definition at line 30 of file MultiAlleleMonolocusGenotype.cpp.

References alleleIndex_.

Member Function Documentation

◆ clone()

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

◆ getAlleleIndex()

std::vector<size_t> bpp::MultiAlleleMonolocusGenotype::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 72 of file MultiAlleleMonolocusGenotype.h.

References alleleIndex_.

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

◆ isHomozygous()

bool MultiAlleleMonolocusGenotype::isHomozygous ( ) const

Test the homozygozity of the locus (i.e. all allele are identical).

Definition at line 52 of file MultiAlleleMonolocusGenotype.cpp.

References alleleIndex_.

◆ operator=()

MultiAlleleMonolocusGenotype & MultiAlleleMonolocusGenotype::operator= ( const MultiAlleleMonolocusGenotype mmg)

The affectation operator.

Definition at line 37 of file MultiAlleleMonolocusGenotype.cpp.

References alleleIndex_, and getAlleleIndex().

◆ operator==()

bool MultiAlleleMonolocusGenotype::operator== ( const MultiAlleleMonolocusGenotype mmg) const

The == operator.

Definition at line 46 of file MultiAlleleMonolocusGenotype.cpp.

References alleleIndex_, and getAlleleIndex().

Member Data Documentation

◆ alleleIndex_

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

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