bpp-popgen  3.0.0
bpp::MultilocusGenotype Class Reference

The MultilocusGenotype class. More...

#include <Bpp/PopGen/MultilocusGenotype.h>

+ Collaboration diagram for bpp::MultilocusGenotype:

Public Member Functions

 MultilocusGenotype (size_t loci_number)
 Build a MultilocusGenotype linked to an AnalyzedLoci object. More...
 
 MultilocusGenotype (const MultilocusGenotype &genotype)
 Copy constructor. More...
 
 ~MultilocusGenotype ()
 Destroy a MultilocusGenotype. More...
 
void setMonolocusGenotype (size_t locus_position, const MonolocusGenotype &monogen)
 Set a MonolocusGenotype. More...
 
void setMonolocusGenotypeByAlleleKey (size_t locus_position, const std::vector< size_t > &allele_keys)
 Set a MonolocusGenotype by allele keys. More...
 
void setMonolocusGenotypeByAlleleId (size_t locus_position, const std::vector< std::string > &allele_id, const LocusInfo &locus_info)
 Set a MonolocusGenotype by allele id. More...
 
void setMonolocusGenotypeAsMissing (size_t locus_position)
 Set a MonolocusGenotype as missing data. More...
 
bool isMonolocusGenotypeMissing (size_t locus_position) const
 Tell if a MonolocusGenotype is a missing data. More...
 
const MonolocusGenotypegetMonolocusGenotype (size_t locus_position) const
 Get a MonolocusGenotype. More...
 
size_t size () const
 Count the number of loci. More...
 
size_t countNonMissingLoci () const
 Count the number of non missing MonolocusGenotype. More...
 
size_t countHomozygousLoci () const
 Count the number of homozygous MonolocusGenotype. More...
 
size_t countHeterozygousLoci () const
 Count the number of heterozygous MonolocusGenotype. More...
 

Private Attributes

std::vector< MonolocusGenotype * > loci_
 

Detailed Description

The MultilocusGenotype class.

This is a MonolocusGenotype container.

Author
Sylvain Gaillard

Definition at line 65 of file MultilocusGenotype.h.

Constructor & Destructor Documentation

◆ MultilocusGenotype() [1/2]

MultilocusGenotype::MultilocusGenotype ( size_t  loci_number)

Build a MultilocusGenotype linked to an AnalyzedLoci object.

Exceptions
BadIntegerExceptionif loci_number < 1.

Definition at line 47 of file MultilocusGenotype.cpp.

References loci_.

◆ MultilocusGenotype() [2/2]

MultilocusGenotype::MultilocusGenotype ( const MultilocusGenotype genotype)

Copy constructor.

Definition at line 59 of file MultilocusGenotype.cpp.

References bpp::Clonable::clone(), getMonolocusGenotype(), isMonolocusGenotypeMissing(), loci_, and size().

◆ ~MultilocusGenotype()

MultilocusGenotype::~MultilocusGenotype ( )

Destroy a MultilocusGenotype.

Definition at line 72 of file MultilocusGenotype.cpp.

References loci_.

Member Function Documentation

◆ countHeterozygousLoci()

size_t MultilocusGenotype::countHeterozygousLoci ( ) const

Count the number of heterozygous MonolocusGenotype.

Definition at line 188 of file MultilocusGenotype.cpp.

References count(), and loci_.

◆ countHomozygousLoci()

size_t MultilocusGenotype::countHomozygousLoci ( ) const

Count the number of homozygous MonolocusGenotype.

Definition at line 172 of file MultilocusGenotype.cpp.

References count(), and loci_.

◆ countNonMissingLoci()

size_t MultilocusGenotype::countNonMissingLoci ( ) const

Count the number of non missing MonolocusGenotype.

Definition at line 161 of file MultilocusGenotype.cpp.

References count(), and loci_.

◆ getMonolocusGenotype()

◆ isMonolocusGenotypeMissing()

◆ setMonolocusGenotype()

◆ setMonolocusGenotypeAsMissing()

void MultilocusGenotype::setMonolocusGenotypeAsMissing ( size_t  locus_position)

Set a MonolocusGenotype as missing data.

Exceptions
IndexOutOfBoundsExceptionif locus_position excedes the number of loci.

Definition at line 133 of file MultilocusGenotype.cpp.

References loci_.

◆ setMonolocusGenotypeByAlleleId()

void MultilocusGenotype::setMonolocusGenotypeByAlleleId ( size_t  locus_position,
const std::vector< std::string > &  allele_id,
const LocusInfo locus_info 
)

◆ setMonolocusGenotypeByAlleleKey()

void MultilocusGenotype::setMonolocusGenotypeByAlleleKey ( size_t  locus_position,
const std::vector< size_t > &  allele_keys 
)

Set a MonolocusGenotype by allele keys.

Exceptions
IndexOutOfBoundsExceptionif locus_position excedes the number of loci.
Exceptionif there is no key in allele_keys.

Definition at line 93 of file MultilocusGenotype.cpp.

References bpp::MonolocusGenotypeTools::buildMonolocusGenotypeByAlleleKey(), loci_, and setMonolocusGenotype().

Referenced by setMonolocusGenotypeByAlleleId().

◆ size()

size_t MultilocusGenotype::size ( ) const

Count the number of loci.

Return the size of _loci.

Definition at line 156 of file MultilocusGenotype.cpp.

References loci_.

Referenced by MultilocusGenotype(), bpp::DarwinVarSingle::write(), and bpp::PopgenlibIO::write().

Member Data Documentation

◆ loci_


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