bpp-popgen
3.0.0
|
The AnalyzedLoci class. More...
#include <Bpp/PopGen/DataSet/AnalyzedLoci.h>
Public Member Functions | |
AnalyzedLoci (size_t number_of_loci) | |
Build a void AnalyzedLoci with a specific number of loci. More... | |
AnalyzedLoci (const AnalyzedLoci &analyzed_loci) | |
Copy constructor. More... | |
~AnalyzedLoci () | |
Destroy the AnalyzedLoci. More... | |
void | setLocusInfo (size_t locus_position, const LocusInfo &locus) |
Set a LocusInfo. More... | |
size_t | getLocusInfoPosition (const std::string &locus_name) const |
Get the position of a LocusInfo. More... | |
const LocusInfo & | getLocusInfoByName (const std::string &locus_name) const |
Get a LocusInfo by name. More... | |
const LocusInfo & | getLocusInfoAtPosition (size_t locus_position) const |
Get a LocusInfo by its position. More... | |
void | addAlleleInfoByLocusName (const std::string &locus_name, const AlleleInfo &allele) |
Add an AlleleInfo to a LocusInfo by LocusInfo name. More... | |
void | addAlleleInfoByLocusPosition (size_t locus_position, const AlleleInfo &allele) |
Add an AlleleInfo to a LocusInfo by its position. More... | |
size_t | getNumberOfLoci () const |
Get the number of loci. More... | |
std::vector< size_t > | getNumberOfAlleles () const |
Get the number of alleles at each locus. More... | |
unsigned int | getPloidyByLocusName (const std::string &locus_name) const |
Get the ploidy of a locus by name. More... | |
unsigned int | getPloidyByLocusPosition (size_t locus_position) const |
Get the ploidy of a locus by its position. More... | |
Private Attributes | |
std::vector< LocusInfo * > | loci_ |
The AnalyzedLoci class.
This is a LocusInfo container. Its instanciation requires a number of locus wich is fixed and can't be modified.
Definition at line 64 of file AnalyzedLoci.h.
AnalyzedLoci::AnalyzedLoci | ( | size_t | number_of_loci | ) |
Build a void AnalyzedLoci with a specific number of loci.
Definition at line 47 of file AnalyzedLoci.cpp.
References loci_.
AnalyzedLoci::AnalyzedLoci | ( | const AnalyzedLoci & | analyzed_loci | ) |
Copy constructor.
Definition at line 57 of file AnalyzedLoci.cpp.
References getLocusInfoAtPosition(), getNumberOfLoci(), and loci_.
AnalyzedLoci::~AnalyzedLoci | ( | ) |
void AnalyzedLoci::addAlleleInfoByLocusName | ( | const std::string & | locus_name, |
const AlleleInfo & | allele | ||
) |
Add an AlleleInfo to a LocusInfo by LocusInfo name.
BadIdentifierException | if the allele's id is already in use. |
LocusNotFoundException | if locus_name is not found. |
Definition at line 131 of file AnalyzedLoci.cpp.
References bpp::BadIdentifierException::getIdentifier(), and loci_.
Referenced by bpp::DataSet::addAlleleInfoByLocusName(), and bpp::GeneMapperCsvExport::read().
void AnalyzedLoci::addAlleleInfoByLocusPosition | ( | size_t | locus_position, |
const AlleleInfo & | allele | ||
) |
Add an AlleleInfo to a LocusInfo by its position.
BadIdentifierException | if the allele's id is already in use. |
IndexOutOfBoundsException | if locus_position is out of bounds. |
Definition at line 157 of file AnalyzedLoci.cpp.
References bpp::BadIdentifierException::getIdentifier(), and loci_.
Referenced by bpp::DataSet::addAlleleInfoByLocusPosition().
const LocusInfo & AnalyzedLoci::getLocusInfoAtPosition | ( | size_t | locus_position | ) | const |
Get a LocusInfo by its position.
NullPointerException | if the LocusInfo is not difined. |
IndexOutOfBoundsException | if locus_position is out of bounds. |
Definition at line 117 of file AnalyzedLoci.cpp.
References loci_.
Referenced by AnalyzedLoci(), and bpp::DataSet::getLocusInfoAtPosition().
const LocusInfo & AnalyzedLoci::getLocusInfoByName | ( | const std::string & | locus_name | ) | const |
Get a LocusInfo by name.
BadIdentifierException | if locus_name is not found. |
Definition at line 103 of file AnalyzedLoci.cpp.
References loci_.
Referenced by bpp::DataSet::getLocusInfoByName().
size_t AnalyzedLoci::getLocusInfoPosition | ( | const std::string & | locus_name | ) | const |
Get the position of a LocusInfo.
BadIdentifierException | if locus_name is not found. |
Definition at line 90 of file AnalyzedLoci.cpp.
References loci_.
Referenced by bpp::GeneMapperCsvExport::read().
std::vector< size_t > AnalyzedLoci::getNumberOfAlleles | ( | ) | const |
Get the number of alleles at each locus.
Definition at line 178 of file AnalyzedLoci.cpp.
References loci_.
Referenced by bpp::DarwinVarSingle::write().
|
inline |
Get the number of loci.
Definition at line 138 of file AnalyzedLoci.h.
References loci_.
Referenced by AnalyzedLoci(), bpp::DataSet::getNumberOfLoci(), and bpp::DataSet::setLocusInfo().
unsigned int AnalyzedLoci::getPloidyByLocusName | ( | const std::string & | locus_name | ) | const |
Get the ploidy of a locus by name.
LocusNotFoundException | if locus_name is not found. |
Definition at line 190 of file AnalyzedLoci.cpp.
References loci_.
Referenced by bpp::DataSet::getPloidyByLocusName().
unsigned int AnalyzedLoci::getPloidyByLocusPosition | ( | size_t | locus_position | ) | const |
Get the ploidy of a locus by its position.
IndexOutOfBoundsException | if locus_position is out of bounds. |
Definition at line 203 of file AnalyzedLoci.cpp.
References loci_.
Referenced by bpp::DataSet::getPloidyByLocusPosition().
void AnalyzedLoci::setLocusInfo | ( | size_t | locus_position, |
const LocusInfo & | locus | ||
) |
Set a LocusInfo.
IndexOutOfBoundsException | if locus_position is out of bounds. |
Definition at line 77 of file AnalyzedLoci.cpp.
References loci_.
Referenced by bpp::GeneMapperCsvExport::read(), bpp::PopgenlibIO::read(), and bpp::DataSet::setLocusInfo().
|
private |
Definition at line 67 of file AnalyzedLoci.h.
Referenced by addAlleleInfoByLocusName(), addAlleleInfoByLocusPosition(), AnalyzedLoci(), getLocusInfoAtPosition(), getLocusInfoByName(), getLocusInfoPosition(), getNumberOfAlleles(), getNumberOfLoci(), getPloidyByLocusName(), getPloidyByLocusPosition(), setLocusInfo(), and ~AnalyzedLoci().