bpp-popgen
3.0.0
|
#include <Bpp/PopGen/LocusInfo.h>
Public Member Functions | |
LocusInfo (const std::string &name, const unsigned int ploidy=DIPLOID) | |
Build a new LocusInfo object. More... | |
LocusInfo (const LocusInfo &locus_info) | |
Copy constructor. More... | |
virtual | ~LocusInfo () |
Destroy the LocusInfo. More... | |
const std::string & | getName () const |
Get the name of the locus. More... | |
unsigned int | getPloidy () const |
Get the ploidy of the locus. More... | |
void | addAlleleInfo (const AlleleInfo &allele) |
Add an AlleleInfo to the LocusInfo. More... | |
const AlleleInfo & | getAlleleInfoById (const std::string &id) const |
Retrieve an AlleleInfo object of the LocusInfo. More... | |
const AlleleInfo & | getAlleleInfoByKey (size_t key) const |
Retrieve an AlleleInfo object of the LocusInfo. More... | |
unsigned int | getAlleleInfoKey (const std::string &id) const |
Get the position of an AlleleInfo. More... | |
size_t | getNumberOfAlleles () const |
Get the number of alleles at this locus. More... | |
void | clear () |
Delete all alleles from the locus. More... | |
Static Public Attributes | |
static unsigned int | HAPLODIPLOID = 0 |
static unsigned int | HAPLOID = 1 |
static unsigned int | DIPLOID = 2 |
static unsigned int | UNKNOWN = 9999 |
Private Attributes | |
std::string | name_ |
unsigned int | ploidy_ |
std::vector< AlleleInfo * > | alleles_ |
The LocusInfo class.
This is an AlleleInfo container with additionnal data like a name, the ploidy and some comments.
Definition at line 63 of file LocusInfo.h.
LocusInfo::LocusInfo | ( | const std::string & | name, |
const unsigned int | ploidy = DIPLOID |
||
) |
Build a new LocusInfo object.
name | The name of the locus. |
ploidy | The ploidy of the locus. |
Definition at line 55 of file LocusInfo.cpp.
LocusInfo::LocusInfo | ( | const LocusInfo & | locus_info | ) |
Copy constructor.
Definition at line 59 of file LocusInfo.cpp.
References alleles_, bpp::AlleleInfo::clone(), getAlleleInfoByKey(), and getNumberOfAlleles().
|
virtual |
void LocusInfo::addAlleleInfo | ( | const AlleleInfo & | allele | ) |
Add an AlleleInfo to the LocusInfo.
BadIdentifierException | if the AlleleInfo's id already exists. |
Definition at line 83 of file LocusInfo.cpp.
References alleles_, bpp::AlleleInfo::clone(), and bpp::AlleleInfo::getId().
Referenced by bpp::Genetix::read().
void LocusInfo::clear | ( | ) |
Delete all alleles from the locus.
Definition at line 126 of file LocusInfo.cpp.
References alleles_.
const AlleleInfo & LocusInfo::getAlleleInfoById | ( | const std::string & | id | ) | const |
Retrieve an AlleleInfo object of the LocusInfo.
AlleleNotFoundException | if the id is not found. |
Definition at line 94 of file LocusInfo.cpp.
References alleles_.
const AlleleInfo & LocusInfo::getAlleleInfoByKey | ( | size_t | key | ) | const |
Retrieve an AlleleInfo object of the LocusInfo.
IndexOutOfBoundsException | if key excedes the number of alleles. |
Definition at line 104 of file LocusInfo.cpp.
References alleles_.
Referenced by LocusInfo(), bpp::DarwinVarSingle::write(), and bpp::PopgenlibIO::write().
unsigned int LocusInfo::getAlleleInfoKey | ( | const std::string & | id | ) | const |
Get the position of an AlleleInfo.
AlleleNotFoundException | if the AlleleInfo's id is not found. |
Definition at line 111 of file LocusInfo.cpp.
References alleles_.
Referenced by bpp::MultilocusGenotype::setMonolocusGenotypeByAlleleId().
|
inline |
Get the name of the locus.
Definition at line 101 of file LocusInfo.h.
References name_.
Referenced by bpp::DarwinVarSingle::write(), and bpp::PopgenlibIO::write().
size_t LocusInfo::getNumberOfAlleles | ( | ) | const |
Get the number of alleles at this locus.
Definition at line 121 of file LocusInfo.cpp.
References alleles_.
Referenced by LocusInfo(), bpp::DarwinVarSingle::write(), and bpp::PopgenlibIO::write().
|
inline |
Get the ploidy of the locus.
Definition at line 108 of file LocusInfo.h.
References ploidy_.
Referenced by bpp::PopgenlibIO::write().
|
private |
Definition at line 68 of file LocusInfo.h.
Referenced by addAlleleInfo(), clear(), getAlleleInfoById(), getAlleleInfoByKey(), getAlleleInfoKey(), getNumberOfAlleles(), LocusInfo(), and ~LocusInfo().
|
static |
Definition at line 73 of file LocusInfo.h.
Referenced by bpp::PopgenlibIO::parseLoci_(), and bpp::PopgenlibIO::write().
|
static |
Definition at line 71 of file LocusInfo.h.
Referenced by bpp::PopgenlibIO::parseLoci_(), and bpp::PopgenlibIO::write().
|
static |
Definition at line 72 of file LocusInfo.h.
Referenced by bpp::PopgenlibIO::parseLoci_(), and bpp::PopgenlibIO::write().
|
private |
Definition at line 66 of file LocusInfo.h.
Referenced by getName().
|
private |
Definition at line 67 of file LocusInfo.h.
Referenced by getPloidy().
|
static |
Definition at line 74 of file LocusInfo.h.
Referenced by bpp::PopgenlibIO::parseLoci_(), bpp::GeneMapperCsvExport::read(), and bpp::PopgenlibIO::write().