bpp-popgen  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 > allele_index)
 Build a monolocus genotype containing many alleles. More...
 
 MultiAlleleMonolocusGenotype (const MultiAlleleMonolocusGenotype &mmg)
 Copy constructor. More...
 
 ~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
 Get the alleles' index. More...
 
The Clonable interface:
MultiAlleleMonolocusGenotypeclone () const
 

Private Attributes

std::vector< size_t > allele_index_
 

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 62 of file MultiAlleleMonolocusGenotype.h.

Constructor & Destructor Documentation

◆ MultiAlleleMonolocusGenotype() [1/2]

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

Build a monolocus genotype containing many alleles.

Definition at line 47 of file MultiAlleleMonolocusGenotype.cpp.

References allele_index_.

Referenced by clone().

◆ MultiAlleleMonolocusGenotype() [2/2]

MultiAlleleMonolocusGenotype::MultiAlleleMonolocusGenotype ( const MultiAlleleMonolocusGenotype mmg)

Copy constructor.

Definition at line 55 of file MultiAlleleMonolocusGenotype.cpp.

References allele_index_, and getAlleleIndex().

◆ ~MultiAlleleMonolocusGenotype()

MultiAlleleMonolocusGenotype::~MultiAlleleMonolocusGenotype ( )

Destroy the MultiAlleleMonolocusGenotype.

Definition at line 65 of file MultiAlleleMonolocusGenotype.cpp.

References allele_index_.

Member Function Documentation

◆ clone()

MultiAlleleMonolocusGenotype * MultiAlleleMonolocusGenotype::clone ( ) const
virtual

Implements bpp::Clonable.

Definition at line 102 of file MultiAlleleMonolocusGenotype.cpp.

References MultiAlleleMonolocusGenotype().

◆ getAlleleIndex()

std::vector< size_t > MultiAlleleMonolocusGenotype::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 97 of file MultiAlleleMonolocusGenotype.cpp.

References allele_index_.

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 87 of file MultiAlleleMonolocusGenotype.cpp.

References allele_index_.

◆ operator=()

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

The affectation operator.

Definition at line 72 of file MultiAlleleMonolocusGenotype.cpp.

References allele_index_, and getAlleleIndex().

◆ operator==()

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

The == operator.

Definition at line 81 of file MultiAlleleMonolocusGenotype.cpp.

References allele_index_, and getAlleleIndex().

Member Data Documentation

◆ allele_index_

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

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