bpp-popgen  2.1.0
bpp::BiAlleleMonolocusGenotype Class Reference

The BiAlleleMonolocusGenotype class. More...

#include <Bpp/PopGen/BiAlleleMonolocusGenotype.h>

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

List of all members.

Public Member Functions

 BiAlleleMonolocusGenotype (size_t first_allele_index, size_t second_allele_index)
 Build a monolocus genotype containing two alleles.
 BiAlleleMonolocusGenotype (std::vector< size_t > allele_index) throw (BadSizeException)
 Build a monolocus genotype containing two alleles.
 BiAlleleMonolocusGenotype (const BiAlleleMonolocusGenotype &bmg)
 Copy constructor.
 ~BiAlleleMonolocusGenotype ()
 Destroy the BiAlleleMonolocusGenotype.
BiAlleleMonolocusGenotypeoperator= (const BiAlleleMonolocusGenotype &bmg)
 The affectation operator.
bool operator== (const BiAlleleMonolocusGenotype &bmg) const
 The == operator.
size_t getFirstAlleleIndex () const
 Get the first allele index.
size_t getSecondAlleleIndex () const
 Get the second allele index.
bool isHomozygous () const
 Test the homozygozity of the locus.
The MonolocusGenotype interface:
std::vector< size_t > getAlleleIndex () const
 Get the alleles' index.
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::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::BiAlleleMonolocusGenotype ( std::vector< size_t >  allele_index) throw (BadSizeException)

Build a monolocus genotype containing two alleles.

Definition at line 55 of file BiAlleleMonolocusGenotype.cpp.


Member Function Documentation

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

Get the first allele index.

Definition at line 95 of file BiAlleleMonolocusGenotype.cpp.

References allele_index_.

Get the second allele index.

Definition at line 100 of file BiAlleleMonolocusGenotype.cpp.

References allele_index_.

Test the homozygozity of the locus.

Definition at line 105 of file BiAlleleMonolocusGenotype.cpp.

References allele_index_.

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

The affectation operator.

Definition at line 80 of file BiAlleleMonolocusGenotype.cpp.

References allele_index_, and getAlleleIndex().

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


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Friends