bpp-popgen3
3.0.0
|
The AnalyzedLoci class. More...
#include <Bpp/PopGen/DataSet/AnalyzedLoci.h>
Public Member Functions | |
AnalyzedLoci (size_t numberOfLoci) | |
Build a void AnalyzedLoci with a specific number of loci. More... | |
AnalyzedLoci (const AnalyzedLoci &analyzedLoci) | |
Copy constructor. More... | |
AnalyzedLoci & | operator= (const AnalyzedLoci &analyzedLoci) |
virtual | ~AnalyzedLoci ()=default |
Destroy the AnalyzedLoci. More... | |
AnalyzedLoci * | clone () const |
void | setLocusInfo (size_t locusPosition, const LocusInfo &locus) |
Set a LocusInfo. More... | |
size_t | getLocusInfoPosition (const std::string &locusName) const |
Get the position of a LocusInfo. More... | |
const LocusInfo & | getLocusInfoByName (const std::string &locusName) const |
Get a LocusInfo by name. More... | |
const LocusInfo & | getLocusInfoAtPosition (size_t locusPosition) const |
Get a LocusInfo by its position. More... | |
void | addAlleleInfoByLocusName (const std::string &locusName, const AlleleInfo &allele) |
Add an AlleleInfo to a LocusInfo by LocusInfo name. More... | |
void | addAlleleInfoByLocusPosition (size_t locusosition, 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 &locusName) const |
Get the ploidy of a locus by name. More... | |
unsigned int | getPloidyByLocusPosition (size_t locusPosition) const |
Get the ploidy of a locus by its position. More... | |
Private Attributes | |
std::vector< std::unique_ptr< LocusInfo > > | loci_ |
The AnalyzedLoci class.
This is a LocusInfo container. Its instantiation requires a number of locus which is fixed and can't be modified.
Definition at line 29 of file AnalyzedLoci.h.
|
inline |
Build a void AnalyzedLoci with a specific number of loci.
Definition at line 40 of file AnalyzedLoci.h.
Referenced by clone().
|
inline |
|
virtualdefault |
Destroy the AnalyzedLoci.
void AnalyzedLoci::addAlleleInfoByLocusName | ( | const std::string & | locusName, |
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 66 of file AnalyzedLoci.cpp.
References bpp::BadIdentifierException::getIdentifier().
Referenced by bpp::GeneMapperCsvExport::read().
void AnalyzedLoci::addAlleleInfoByLocusPosition | ( | size_t | locusosition, |
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 92 of file AnalyzedLoci.cpp.
References bpp::BadIdentifierException::getIdentifier().
|
inlinevirtual |
Implements bpp::Clonable.
Definition at line 71 of file AnalyzedLoci.h.
References AnalyzedLoci().
Referenced by bpp::DataSet::setAnalyzedLoci().
const LocusInfo & AnalyzedLoci::getLocusInfoAtPosition | ( | size_t | locusPosition | ) | const |
Get a LocusInfo by its position.
NullPointerException | if the LocusInfo is not defined. |
IndexOutOfBoundsException | if locus_position is out of bounds. |
Definition at line 52 of file AnalyzedLoci.cpp.
const LocusInfo & AnalyzedLoci::getLocusInfoByName | ( | const std::string & | locusName | ) | const |
Get a LocusInfo by name.
BadIdentifierException | if locus_name is not found. |
Definition at line 38 of file AnalyzedLoci.cpp.
size_t AnalyzedLoci::getLocusInfoPosition | ( | const std::string & | locusName | ) | const |
Get the position of a LocusInfo.
BadIdentifierException | if locus_name is not found. |
Definition at line 25 of file AnalyzedLoci.cpp.
Referenced by bpp::GeneMapperCsvExport::read().
std::vector< size_t > AnalyzedLoci::getNumberOfAlleles | ( | ) | const |
Get the number of alleles at each locus.
Definition at line 113 of file AnalyzedLoci.cpp.
|
inline |
unsigned int AnalyzedLoci::getPloidyByLocusName | ( | const std::string & | locusName | ) | const |
Get the ploidy of a locus by name.
LocusNotFoundException | if locus_name is not found. |
Definition at line 125 of file AnalyzedLoci.cpp.
unsigned int AnalyzedLoci::getPloidyByLocusPosition | ( | size_t | locusPosition | ) | const |
Get the ploidy of a locus by its position.
IndexOutOfBoundsException | if locus_position is out of bounds. |
Definition at line 138 of file AnalyzedLoci.cpp.
|
inline |
Definition at line 55 of file AnalyzedLoci.h.
References loci_.
void AnalyzedLoci::setLocusInfo | ( | size_t | locusPosition, |
const LocusInfo & | locus | ||
) |
Set a LocusInfo.
IndexOutOfBoundsException | if locus_position is out of bounds. |
Definition at line 12 of file AnalyzedLoci.cpp.
References bpp::LocusInfo::clone().
Referenced by bpp::GeneMapperCsvExport::read(), and bpp::PopgenlibIO::read().
|
private |
Definition at line 33 of file AnalyzedLoci.h.
Referenced by AnalyzedLoci(), getNumberOfLoci(), and operator=().