|
bpp-popgen
2.2.0
|
The AnalyzedLoci class. More...
#include <Bpp/PopGen/AnalyzedLoci.h>
Collaboration diagram for bpp::AnalyzedLoci: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) throw (IndexOutOfBoundsException) |
| Set a LocusInfo. More... | |
| size_t | getLocusInfoPosition (const std::string &locus_name) const throw (BadIdentifierException) |
| Get the position of a LocusInfo. More... | |
| const LocusInfo & | getLocusInfoByName (const std::string &locus_name) const throw (BadIdentifierException) |
| Get a LocusInfo by name. More... | |
| const LocusInfo & | getLocusInfoAtPosition (size_t locus_position) const throw (Exception) |
| Get a LocusInfo by its position. More... | |
| void | addAlleleInfoByLocusName (const std::string &locus_name, const AlleleInfo &allele) throw (Exception) |
| Add an AlleleInfo to a LocusInfo by LocusInfo name. More... | |
| void | addAlleleInfoByLocusPosition (size_t locus_position, const AlleleInfo &allele) throw (Exception) |
| 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 throw (LocusNotFoundException) |
| Get the ploidy of a locus by name. More... | |
| unsigned int | getPloidyByLocusPosition (size_t locus_position) const throw (IndexOutOfBoundsException) |
| 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 | ||
| ) | |||
| throw | ( | Exception | |
| ) | |||
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 135 of file AnalyzedLoci.cpp.
References bpp::BadIdentifierException::getIdentifier().
| void AnalyzedLoci::addAlleleInfoByLocusPosition | ( | size_t | locus_position, |
| const AlleleInfo & | allele | ||
| ) | |||
| throw | ( | Exception | |
| ) | |||
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 162 of file AnalyzedLoci.cpp.
References bpp::BadIdentifierException::getIdentifier().
| const LocusInfo & AnalyzedLoci::getLocusInfoAtPosition | ( | size_t | locus_position | ) | const |
| throw | ( | Exception | |||
| ) | |||||
Get a LocusInfo by its position.
| NullPointerException | if the LocusInfo is not difined. |
| IndexOutOfBoundsException | if locus_position is out of bounds. |
Definition at line 120 of file AnalyzedLoci.cpp.
Referenced by AnalyzedLoci().
| const LocusInfo & AnalyzedLoci::getLocusInfoByName | ( | const std::string & | locus_name | ) | const |
| throw | ( | BadIdentifierException | |||
| ) | |||||
Get a LocusInfo by name.
| BadIdentifierException | if locus_name is not found. |
Definition at line 105 of file AnalyzedLoci.cpp.
| size_t AnalyzedLoci::getLocusInfoPosition | ( | const std::string & | locus_name | ) | const |
| throw | ( | BadIdentifierException | |||
| ) | |||||
Get the position of a LocusInfo.
| BadIdentifierException | if locus_name is not found. |
Definition at line 91 of file AnalyzedLoci.cpp.
| std::vector< size_t > AnalyzedLoci::getNumberOfAlleles | ( | ) | const |
Get the number of alleles at each locus.
Definition at line 184 of file AnalyzedLoci.cpp.
References loci_.
Referenced by bpp::DarwinVarSingle::write().
|
inline |
Get the number of loci.
Definition at line 144 of file AnalyzedLoci.h.
References loci_.
Referenced by AnalyzedLoci(), and bpp::DataSet::getNumberOfLoci().
| unsigned int AnalyzedLoci::getPloidyByLocusName | ( | const std::string & | locus_name | ) | const |
| throw | ( | LocusNotFoundException | |||
| ) | |||||
Get the ploidy of a locus by name.
| LocusNotFoundException | if locus_name is not found. |
Definition at line 196 of file AnalyzedLoci.cpp.
| unsigned int AnalyzedLoci::getPloidyByLocusPosition | ( | size_t | locus_position | ) | const |
| throw | ( | IndexOutOfBoundsException | |||
| ) | |||||
Get the ploidy of a locus by its position.
| IndexOutOfBoundsException | if locus_position is out of bounds. |
Definition at line 210 of file AnalyzedLoci.cpp.
| void AnalyzedLoci::setLocusInfo | ( | size_t | locus_position, |
| const LocusInfo & | locus | ||
| ) | |||
| throw | ( | IndexOutOfBoundsException | |
| ) | |||
Set a LocusInfo.
| IndexOutOfBoundsException | if locus_position is out of bounds. |
Definition at line 77 of file AnalyzedLoci.cpp.
Referenced by bpp::PopgenlibIO::read().
|
private |
Definition at line 67 of file AnalyzedLoci.h.
Referenced by AnalyzedLoci(), getNumberOfAlleles(), getNumberOfLoci(), and ~AnalyzedLoci().