bpp-popgen
3.0.0
|
The PolymorphismSequenceContainer class. More...
#include <Bpp/PopGen/PolymorphismSequenceContainer.h>
Public Member Functions | |
PolymorphismSequenceContainer (const Alphabet *alpha) | |
Build a new empty PolymorphismSequenceContainer. More... | |
PolymorphismSequenceContainer (size_t size, const Alphabet *alpha) | |
Build a new empty PolymorphismSequenceContainer of given size. More... | |
PolymorphismSequenceContainer (const std::vector< std::string > &names, const Alphabet *alpha) | |
Build a new empty PolymorphismSequenceContainer with given sequence names. More... | |
PolymorphismSequenceContainer (const OrderedSequenceContainer &sc) | |
Build a PolymorphismSequenceContainer by copying data from an OrderedSequenceContainer. More... | |
PolymorphismSequenceContainer (const OrderedSequenceContainer &sc, bool count) | |
Build a PolymorphismSequenceContainer by copying data from an OrderedSequenceContainer. More... | |
PolymorphismSequenceContainer (const SiteContainer &sc) | |
Build a PolymorphismSequenceContainer by copying data from a SiteContainer. More... | |
PolymorphismSequenceContainer (const SiteContainer &sc, bool count) | |
Build a PolymorphismSequenceContainer by copying data from a SiteContainer. More... | |
PolymorphismSequenceContainer (const PolymorphismSequenceContainer &psc) | |
Copy constructor. More... | |
PolymorphismSequenceContainer & | operator= (const PolymorphismSequenceContainer &psc) |
Operator= : copy operator. More... | |
virtual | ~PolymorphismSequenceContainer () |
Destroy a PolymorphismSequenceContainer. More... | |
PolymorphismSequenceContainer * | clone () const |
Clone a PolymorphismSequenceContainer. More... | |
Sequence * | removeSequence (size_t index) |
Remove a sequence by index and return a pointer to this removed sequence. More... | |
Sequence * | removeSequence (const std::string &name) |
Remove a sequence by name and return a pointer to this removed sequence. More... | |
void | deleteSequence (size_t index) |
Delete a sequence by index. More... | |
void | deleteSequence (const std::string &name) |
Delete a sequence by name. More... | |
void | addSequenceWithFrequency (const Sequence &sequence, unsigned int frequency, bool checkName=true) |
Add a sequence to the container. More... | |
void | addSequenceWithFrequency (const Sequence &sequence, size_t sequenceIndex, unsigned int frequency, bool checkName=true) |
void | addSequence (const Sequence &sequence, bool checkName=true) |
void | addSequence (const Sequence &sequence, size_t sequenceIndex, bool checkName=true) |
void | clear () |
Clear the container of all its sequences. More... | |
size_t | getGroupId (size_t index) const |
Get the group identifier of the sequence. More... | |
size_t | getGroupId (const std::string &name) const |
Get the group identifier of a sequence. More... | |
std::set< size_t > | getAllGroupsIds () const |
Get all the groups identifiers. More... | |
void | setGroupId (size_t index, size_t group_id) |
Set the group identifier of a sequence. More... | |
void | setGroupId (const std::string &name, size_t group_id) |
Set the group identifier of a sequence. More... | |
size_t | getNumberOfGroups () const |
Get the number of groups. More... | |
bool | hasOutgroup () const |
bool | isIngroupMember (size_t index) const |
Tell if the sequence is ingroup by index. More... | |
bool | isIngroupMember (const std::string &name) const |
Tell if a sequence is ingroup by name. More... | |
void | setAsIngroupMember (size_t index) |
Set a sequence as ingroup member by index. More... | |
void | setAsIngroupMember (const std::string &name) |
Set a sequence as ingroup member by name. More... | |
void | setAsOutgroupMember (size_t index) |
Set a sequence as outgroup member by index. More... | |
void | setAsOutgroupMember (const std::string &name) |
Set a sequence as outgroup member by name. More... | |
void | setSequenceCount (size_t index, unsigned int count) |
Set the count of a sequence by index. More... | |
void | setSequenceCount (const std::string &name, unsigned int count) |
Set the count of a sequence by name. More... | |
void | incrementSequenceCount (size_t index) |
Add 1 to the sequence count. More... | |
void | incrementSequenceCount (const std::string &name) |
Add 1 to the sequence count. More... | |
void | decrementSequenceCount (size_t index) |
Removz 1 to the sequence count. More... | |
void | decrementSequenceCount (const std::string &name) |
Remove 1 to the sequence count. More... | |
unsigned int | getSequenceCount (size_t index) const |
Get the count of a sequence by index. More... | |
unsigned int | getSequenceCount (const std::string &name) const |
Get the count of a sequence by name. More... | |
SiteContainer * | toSiteContainer () const |
convert the container to a site container, with sequences dulicated according to their respective frequencies. More... | |
void | setSequence (const std::string &name, const Sequence &sequence, bool checkName) |
void | setSequence (size_t sequenceIndex, const Sequence &sequence, bool checkName) |
std::string | toString (const std::string &name) const |
virtual std::string | toString (size_t sequenceIndex) const |
virtual std::string | toString (size_t sequenceIndex) const =0 |
virtual std::string | toString (size_t sequenceIndex) const |
virtual std::string | toString (size_t sequenceIndex) const =0 |
const Comments & | getComments (const std::string &name) const |
const Comments & | getComments () const |
virtual const Comments & | getComments (size_t sequenceIndex) const |
virtual const Comments & | getComments (size_t sequenceIndex) const =0 |
virtual const Comments & | getComments (size_t sequenceIndex) const |
virtual const Comments & | getComments (size_t sequenceIndex) const =0 |
void | setComments (const std::string &name, const Comments &comments) |
void | setComments (const Comments &comments) |
void | setComments (size_t sequenceIndex, const Comments &comments) |
virtual void | setComments (const std::string &name, const Comments &comments)=0 |
virtual void | setComments (size_t sequenceIndex, const Comments &comments)=0 |
void | setComments (size_t sequenceIndex, const Comments &comments) |
virtual void | setComments (const std::string &name, const Comments &comments)=0 |
virtual void | setComments (size_t sequenceIndex, const Comments &comments)=0 |
virtual const Alphabet * | getAlphabet () const=0 |
const Alphabet * | getAlphabet () const |
const Alphabet * | getAlphabet () const |
virtual double | getStateValueAt (size_t siteIndex, const std::string &sequenceName, int state) const =0 |
double | getStateValueAt (size_t siteIndex, const std::string &sequenceName, int state) const |
double | getStateValueAt (size_t siteIndex, size_t sequenceIndex, int state) const |
double | getStateValueAt (size_t siteIndex, const std::string &sequenceName, int state) const |
double | getStateValueAt (size_t siteIndex, size_t sequenceIndex, int state) const |
virtual const Comments & | getGeneralComments () const=0 |
const Comments & | getGeneralComments () const |
const Comments & | getGeneralComments () const |
virtual void | setGeneralComments (const Comments &comments)=0 |
void | setGeneralComments (const Comments &comments) |
void | setGeneralComments (const Comments &comments) |
virtual void | deleteGeneralComments ()=0 |
void | deleteGeneralComments () |
void | deleteGeneralComments () |
void | clearComments () |
const CruxSymbolListSite & | getSymbolListSite (size_t siteIndex) const |
CruxSymbolListSite & | getSymbolListSite (size_t siteIndex) |
size_t | getSize () const |
size_t | getSize () const |
const std::shared_ptr< Site > | getObject (size_t objectIndex) const |
std::shared_ptr< Site > | getObject (size_t objectIndex) |
const std::shared_ptr< Sequence > | getObject (size_t objectIndex) const |
std::shared_ptr< Sequence > | getObject (size_t objectIndex) |
const std::shared_ptr< Sequence > | getObject (const std::string &name) const |
std::shared_ptr< Sequence > | getObject (const std::string &name) |
void | addObject (std::shared_ptr< Site > object, size_t objectIndex, bool checkPosition=false) |
virtual void | addObject (std::shared_ptr< T > object, size_t objectIndex, bool checkPosition=false) |
void | addObject (std::shared_ptr< Sequence > object, size_t objectIndex, const std::string &name, bool check=false) |
virtual void | addObject (std::shared_ptr< T > object, size_t objectIndex, const std::string &name, bool check=false)=0 |
virtual void | addObject (std::shared_ptr< T > object, const std::string &name, bool checkName=false) |
void | addObject (std::shared_ptr< T > object, const std::string &name, bool checkName=false) |
void | addObject (std::shared_ptr< T > object, size_t objectIndex, bool checkPosition=false) |
void | addObject (std::shared_ptr< Site > object, size_t objectIndex, bool checkPosition=false) |
void | addObject (std::shared_ptr< Sequence > object, size_t objectIndex, const std::string &name, bool check=false) |
void | insertObject (std::shared_ptr< Site > object, size_t objectIndex) |
virtual void | insertObject (std::shared_ptr< T > object, size_t objectIndex) |
void | insertObject (std::shared_ptr< Sequence > object, size_t objectIndex, const std::string &name) |
virtual void | insertObject (std::shared_ptr< T > object, size_t objectIndex, const std::string &name)=0 |
void | insertObject (std::shared_ptr< T > object, size_t objectIndex) |
void | insertObject (std::shared_ptr< Site > object, size_t objectIndex) |
void | insertObject (std::shared_ptr< Sequence > object, size_t objectIndex, const std::string &name) |
bool | isAvailablePosition (size_t objectIndex) const |
bool | isAvailablePosition (size_t objectIndex) const |
std::shared_ptr< Site > | removeObject (size_t objectIndex) |
std::shared_ptr< Sequence > | removeObject (size_t objectIndex) |
std::shared_ptr< Sequence > | removeObject (const std::string &name) |
std::shared_ptr< Site > | deleteObject (size_t objectIndex) |
virtual std::shared_ptr< T > | deleteObject (const std::string &name) |
std::shared_ptr< Sequence > | deleteObject (size_t objectIndex) |
void | deleteObjects (size_t objectIndex, size_t length) |
void | deleteObjects (size_t objectIndex, size_t length) |
void | appendObject (std::shared_ptr< Site > object) |
virtual void | appendObject (std::shared_ptr< T > object) |
void | appendObject (std::shared_ptr< Sequence > object, const std::string &name, bool check=true) |
void | appendObject (std::shared_ptr< T > object) |
void | appendObject (std::shared_ptr< Site > object) |
void | appendObject (std::shared_ptr< Sequence > object, const std::string &name, bool check=true) |
void | setSize (size_t size) |
void | setSize (size_t size) |
size_t | getNumberOfObjects () const |
size_t | getObjectPosition (const std::string &name) const |
std::string | getObjectName (size_t objectIndex) const |
bool | hasObject (const std::string &name) const |
std::vector< std::string > | getObjectsNames () const |
void | setObjectsNames (const std::vector< std::string > &names) |
void | setObjectName (size_t pos, const std::string &name) |
void | changeName (const std::string &okey, const std::string &nkey) |
const Site & | getSite (size_t siteIndex) const |
Site & | getSite (size_t siteIndex) |
const Site & | getSite (size_t siteIndex) const |
Site & | getSite (size_t siteIndex) |
void | setSite (size_t siteIndex, const Site &site, bool checkPosition=true) |
void | setSite (size_t siteIndex, const Site &site, bool checkPosition=true) |
std::shared_ptr< Site > | deleteSite (size_t siteIndex) |
std::shared_ptr< Site > | deleteSite (size_t siteIndex) |
void | addSite (const Site &site, bool checkPosition=true) |
void | addSite (const Site &site, int position, bool checkPosition=true) |
void | addSite (const Site &site, size_t siteIndex, bool checkPosition=true) |
void | addSite (const Site &site, size_t siteIndex, int position, bool checkPosition=true) |
void | addSite (const Site &site, bool checkPosition=true) |
void | addSite (const Site &site, int position, bool checkPosition=true) |
void | addSite (const Site &site, size_t siteIndex, bool checkPosition=true) |
void | addSite (const Site &site, size_t siteIndex, int position, bool checkPosition=true) |
void | deleteSites (size_t siteIndex, size_t length) |
void | deleteSites (size_t siteIndex, size_t length) |
size_t | getNumberOfSites () const |
size_t | getNumberOfSites () const |
void | reindexSites () |
void | reindexSites () |
Vint | getSitePositions () const |
Vint | getSitePositions () const |
void | setSitePositions (Vint vPositions) |
void | setSitePositions (Vint vPositions) |
const Sequence & | getSequence (size_t sequenceIndex) const |
const Sequence & | getSequence (const std::string &name) const |
const Sequence & | getSequence (size_t sequenceIndex) const |
const Sequence & | getSequence (const std::string &name) const |
bool | hasSequence (const std::string &name) const |
bool | hasSequence (const std::string &name) const |
size_t | getSequencePosition (const std::string &name) const |
size_t | getSequencePosition (const std::string &name) const |
size_t | getNumberOfSequences () const |
size_t | getNumberOfSequences () const |
std::vector< std::string > | getSequencesNames () const |
std::vector< std::string > | getSequencesNames () const |
void | setSequencesNames (const std::vector< std::string > &names, bool checkNames=true) |
void | setSequencesNames (const std::vector< std::string > &names, bool checkNames=true) |
VectorSiteContainer * | createEmptyContainer () const |
VectorSiteContainer * | createEmptyContainer () const |
int & | valueAt (const std::string &sequenceName, size_t elementIndex) |
const int & | valueAt (const std::string &sequenceName, size_t elementIndex) const |
int & | valueAt (size_t sequenceIndex, size_t elementIndex) |
const int & | valueAt (size_t sequenceIndex, size_t elementIndex) const |
int & | valueAt (const std::string &sequenceName, size_t elementIndex) |
const int & | valueAt (const std::string &sequenceName, size_t elementIndex) const |
int & | valueAt (size_t sequenceIndex, size_t elementIndex) |
const int & | valueAt (size_t sequenceIndex, size_t elementIndex) const |
int & | operator() (const std::string &sequenceName, size_t elementIndex) |
const int & | operator() (const std::string &sequenceName, size_t elementIndex) const |
int & | operator() (size_t sequenceIndex, size_t elementIndex) |
const int & | operator() (size_t sequenceIndex, size_t elementIndex) const |
double | operator() (size_t siteIndex, const std::string &sequenceName, int state) const |
double | operator() (size_t siteIndex, size_t sequenceIndex, int state) const |
int & | operator() (const std::string &sequenceName, size_t elementIndex) |
const int & | operator() (const std::string &sequenceName, size_t elementIndex) const |
int & | operator() (size_t sequenceIndex, size_t elementIndex) |
const int & | operator() (size_t sequenceIndex, size_t elementIndex) const |
double | operator() (size_t siteIndex, const std::string &sequenceName, int state) const |
double | operator() (size_t siteIndex, size_t sequenceIndex, int state) const |
virtual const std::string & | getName (size_t sequenceIndex) const |
virtual const std::string & | getName (size_t sequenceIndex) const |
Protected Member Functions | |
void | realloc (size_t n) |
std::shared_ptr< Site > | getObject_ (size_t objectIndex) const |
std::shared_ptr< T > | getObject_ (size_t objectIndex) const |
void | addObject_ (std::shared_ptr< Site > object, size_t objectIndex, bool checkPosition=false) const |
void | addObject_ (std::shared_ptr< Sequence > object, size_t objectIndex, const std::string &name, bool check=false) const |
void | addObject_ (std::shared_ptr< T > object, const std::string &name, bool checkName=false) const |
void | addObject_ (std::shared_ptr< T > object, size_t objectIndex, bool checkPosition=false) const |
void | addObject_ (std::shared_ptr< Site > object, size_t objectIndex, bool checkPosition=false) const |
void | addObject_ (std::shared_ptr< Sequence > object, size_t objectIndex, const std::string &name, bool check=false) const |
Protected Attributes | |
const Alphabet * | alphabet_ |
Comments | comments_ |
std::vector< std::shared_ptr< Site > > | positions_ |
std::vector< std::shared_ptr< T > > | positions_ |
Private Attributes | |
std::vector< bool > | ingroup_ |
std::vector< unsigned int > | count_ |
std::vector< size_t > | group_ |
std::vector< std::string > | vNames_ |
std::map< std::string, size_t > | mNames_ |
std::map< std::string, std::shared_ptr< T > > | mObjects_ |
The PolymorphismSequenceContainer class.
This is a VectorSiteContainer with effectif for each sequence. It also has flag for ingroup and outgroup.
Definition at line 102 of file PolymorphismSequenceContainer.h.
PolymorphismSequenceContainer::PolymorphismSequenceContainer | ( | const Alphabet * | alpha | ) |
Build a new empty PolymorphismSequenceContainer.
Definition at line 51 of file PolymorphismSequenceContainer.cpp.
Referenced by clone().
PolymorphismSequenceContainer::PolymorphismSequenceContainer | ( | size_t | size, |
const Alphabet * | alpha | ||
) |
Build a new empty PolymorphismSequenceContainer of given size.
Definition at line 59 of file PolymorphismSequenceContainer.cpp.
PolymorphismSequenceContainer::PolymorphismSequenceContainer | ( | const std::vector< std::string > & | names, |
const Alphabet * | alpha | ||
) |
Build a new empty PolymorphismSequenceContainer with given sequence names.
Definition at line 67 of file PolymorphismSequenceContainer.cpp.
PolymorphismSequenceContainer::PolymorphismSequenceContainer | ( | const OrderedSequenceContainer & | sc | ) |
Build a PolymorphismSequenceContainer by copying data from an OrderedSequenceContainer.
sc | Sequence container to convert. |
Definition at line 75 of file PolymorphismSequenceContainer.cpp.
PolymorphismSequenceContainer::PolymorphismSequenceContainer | ( | const OrderedSequenceContainer & | sc, |
bool | count | ||
) |
Build a PolymorphismSequenceContainer by copying data from an OrderedSequenceContainer.
sc | Sequence container to convert. |
count | Tell if identical sequences should be collapsed and counted. If not (the historical behavior), sequences are duplicated and stored with a frequency of 1. |
Definition at line 83 of file PolymorphismSequenceContainer.cpp.
References addSequenceWithFrequency(), bpp::SequenceTools::areSequencesIdentical(), bpp::VectorSiteContainer::getNumberOfSequences(), bpp::OrderedSequenceContainer::getNumberOfSequences(), bpp::VectorSiteContainer::getSequence(), bpp::OrderedSequenceContainer::getSequence(), group_, incrementSequenceCount(), and ingroup_.
PolymorphismSequenceContainer::PolymorphismSequenceContainer | ( | const SiteContainer & | sc | ) |
Build a PolymorphismSequenceContainer by copying data from a SiteContainer.
sc | Sequence container to convert. |
Definition at line 113 of file PolymorphismSequenceContainer.cpp.
PolymorphismSequenceContainer::PolymorphismSequenceContainer | ( | const SiteContainer & | sc, |
bool | count | ||
) |
Build a PolymorphismSequenceContainer by copying data from a SiteContainer.
sc | Sequence container to convert. |
count | Tell if identical sequences should be collapsed and counted. If not (the historical behavior), sequences are duplicated and stored with a frequency of 1. |
Definition at line 121 of file PolymorphismSequenceContainer.cpp.
References addSequenceWithFrequency(), bpp::SequenceTools::areSequencesIdentical(), bpp::VectorSiteContainer::getNumberOfSequences(), bpp::SiteContainer::getNumberOfSequences(), bpp::VectorSiteContainer::getSequence(), bpp::SiteContainer::getSequence(), group_, incrementSequenceCount(), and ingroup_.
PolymorphismSequenceContainer::PolymorphismSequenceContainer | ( | const PolymorphismSequenceContainer & | psc | ) |
Copy constructor.
Definition at line 151 of file PolymorphismSequenceContainer.cpp.
References count_, getGroupId(), bpp::VectorSiteContainer::getNumberOfSequences(), getSequenceCount(), group_, ingroup_, and isIngroupMember().
|
virtual |
Destroy a PolymorphismSequenceContainer.
Definition at line 188 of file PolymorphismSequenceContainer.cpp.
References clear().
|
inlinevirtual |
Reimplemented from bpp::VectorSiteContainer.
Definition at line 225 of file PolymorphismSequenceContainer.h.
References addSequenceWithFrequency().
Referenced by bpp::SequenceStatistics::mkTable().
|
inline |
Definition at line 228 of file PolymorphismSequenceContainer.h.
References addSequenceWithFrequency().
void PolymorphismSequenceContainer::addSequenceWithFrequency | ( | const Sequence & | sequence, |
size_t | sequenceIndex, | ||
unsigned int | frequency, | ||
bool | checkName = true |
||
) |
Definition at line 268 of file PolymorphismSequenceContainer.cpp.
References bpp::VectorSiteContainer::addSequence(), count_, group_, and ingroup_.
void PolymorphismSequenceContainer::addSequenceWithFrequency | ( | const Sequence & | sequence, |
unsigned int | frequency, | ||
bool | checkName = true |
||
) |
Add a sequence to the container.
AlphabetMismatchException | if the sequence's alphabet doesn't match the container's alphabet. |
SequenceException | if the sequence's size doesn't match the sequence's size of the container. |
SequenceException | if the sequence's name already exists in the container. |
Definition at line 251 of file PolymorphismSequenceContainer.cpp.
References bpp::VectorSiteContainer::addSequence(), count_, group_, and ingroup_.
Referenced by addSequence(), bpp::DataSet::getPolymorphismSequenceContainer(), bpp::PolymorphismSequenceContainerTools::getSelectedSequences(), and PolymorphismSequenceContainer().
|
virtual |
Clear the container of all its sequences.
Reimplemented from bpp::VectorSiteContainer.
Definition at line 285 of file PolymorphismSequenceContainer.cpp.
References bpp::VectorSiteContainer::clear(), count_, group_, and ingroup_.
Referenced by ~PolymorphismSequenceContainer().
|
inlinevirtual |
Clone a PolymorphismSequenceContainer.
Reimplemented from bpp::VectorSiteContainer.
Definition at line 181 of file PolymorphismSequenceContainer.h.
References PolymorphismSequenceContainer().
Referenced by bpp::PolymorphismSequenceContainerTools::excludeFlankingGap(), bpp::PolymorphismSequenceContainerTools::extractGroup(), bpp::PolymorphismSequenceContainerTools::extractIngroup(), and bpp::PolymorphismSequenceContainerTools::extractOutgroup().
void PolymorphismSequenceContainer::decrementSequenceCount | ( | const std::string & | name | ) |
Remove 1 to the sequence count.
SequenceNotFoundException | if name is not found among the sequences' names. |
BadIntegerException | if count < 1 ... use deleteSequence instead of setting the count to 0. |
Definition at line 504 of file PolymorphismSequenceContainer.cpp.
References decrementSequenceCount(), and bpp::VectorSiteContainer::getSequencePosition().
void PolymorphismSequenceContainer::decrementSequenceCount | ( | size_t | index | ) |
Removz 1 to the sequence count.
IndexOutOfBoundsException | if index excedes the number of sequences in the container. |
BadIntegerException | if count < 1 ... use deleteSequence instead of setting the count to 0. |
Definition at line 493 of file PolymorphismSequenceContainer.cpp.
References count_, and bpp::VectorSiteContainer::getNumberOfSequences().
Referenced by decrementSequenceCount().
void PolymorphismSequenceContainer::deleteSequence | ( | const std::string & | name | ) |
Delete a sequence by name.
SequenceNotFoundException | if name is not found among the sequences' names. |
Definition at line 237 of file PolymorphismSequenceContainer.cpp.
References removeSequence().
void PolymorphismSequenceContainer::deleteSequence | ( | size_t | index | ) |
Delete a sequence by index.
IndexOutOfBoundsException | if index excedes the number of sequences. |
Definition at line 223 of file PolymorphismSequenceContainer.cpp.
References bpp::VectorSiteContainer::getNumberOfSequences(), and removeSequence().
Referenced by bpp::PolymorphismSequenceContainerTools::extractGroup(), bpp::PolymorphismSequenceContainerTools::extractIngroup(), and bpp::PolymorphismSequenceContainerTools::extractOutgroup().
std::set< size_t > PolymorphismSequenceContainer::getAllGroupsIds | ( | ) | const |
Get all the groups identifiers.
Definition at line 318 of file PolymorphismSequenceContainer.cpp.
References group_.
Referenced by bpp::DataSetTools::buildDataSet(), and getNumberOfGroups().
size_t PolymorphismSequenceContainer::getGroupId | ( | const std::string & | name | ) | const |
Get the group identifier of a sequence.
SequenceNotFoundException | if name is not found among the sequences' names. |
Definition at line 304 of file PolymorphismSequenceContainer.cpp.
References bpp::VectorSiteContainer::getSequencePosition(), and group_.
size_t PolymorphismSequenceContainer::getGroupId | ( | size_t | index | ) | const |
Get the group identifier of the sequence.
IndexOutOfBoundsException | if index excedes the number of sequences in the container. |
Definition at line 295 of file PolymorphismSequenceContainer.cpp.
References bpp::VectorSiteContainer::getNumberOfSequences(), and group_.
Referenced by bpp::DataSetTools::buildDataSet(), bpp::PolymorphismSequenceContainerTools::extractGroup(), bpp::PolymorphismSequenceContainerTools::get3Prime(), bpp::PolymorphismSequenceContainerTools::get5Prime(), bpp::PolymorphismSequenceContainerTools::getCompleteSites(), bpp::PolymorphismSequenceContainerTools::getIntrons(), bpp::PolymorphismSequenceContainerTools::getNonCodingSites(), bpp::PolymorphismSequenceContainerTools::getNonSynonymousSites(), bpp::PolymorphismSequenceContainerTools::getOnePosition(), bpp::PolymorphismSequenceContainerTools::getSelectedSequences(), bpp::PolymorphismSequenceContainerTools::getSelectedSites(), bpp::PolymorphismSequenceContainerTools::getSitesWithoutGaps(), bpp::PolymorphismSequenceContainerTools::getSynonymousSites(), operator=(), and PolymorphismSequenceContainer().
size_t PolymorphismSequenceContainer::getNumberOfGroups | ( | ) | const |
Get the number of groups.
Definition at line 353 of file PolymorphismSequenceContainer.cpp.
References getAllGroupsIds().
unsigned int PolymorphismSequenceContainer::getSequenceCount | ( | const std::string & | name | ) | const |
Get the count of a sequence by name.
SequenceNotFoundException | if name is not found among the sequences' names. |
Definition at line 531 of file PolymorphismSequenceContainer.cpp.
References getSequenceCount(), and bpp::VectorSiteContainer::getSequencePosition().
unsigned int PolymorphismSequenceContainer::getSequenceCount | ( | size_t | index | ) | const |
Get the count of a sequence by index.
IndexOutOfBoundsException | if index excedes the number of sequences in the container. |
Definition at line 522 of file PolymorphismSequenceContainer.cpp.
References count_, and bpp::VectorSiteContainer::getNumberOfSequences().
Referenced by bpp::DataSetTools::buildDataSet(), bpp::PolymorphismSequenceContainerTools::getCompleteSites(), bpp::PolymorphismSequenceContainerTools::getNonSynonymousSites(), bpp::PolymorphismSequenceContainerTools::getSelectedSequences(), getSequenceCount(), bpp::PolymorphismSequenceContainerTools::getSitesWithoutGaps(), bpp::PolymorphismSequenceContainerTools::getSynonymousSites(), operator=(), PolymorphismSequenceContainer(), and toSiteContainer().
bool PolymorphismSequenceContainer::hasOutgroup | ( | ) | const |
Definition at line 360 of file PolymorphismSequenceContainer.cpp.
References ingroup_.
void PolymorphismSequenceContainer::incrementSequenceCount | ( | const std::string & | name | ) |
Add 1 to the sequence count.
SequenceNotFoundException | if name is not found among the sequences' names. |
Definition at line 479 of file PolymorphismSequenceContainer.cpp.
References bpp::VectorSiteContainer::getSequencePosition(), and incrementSequenceCount().
void PolymorphismSequenceContainer::incrementSequenceCount | ( | size_t | index | ) |
Add 1 to the sequence count.
IndexOutOfBoundsException | if index excedes the number of sequences in the container. |
Definition at line 470 of file PolymorphismSequenceContainer.cpp.
References count_, and bpp::VectorSiteContainer::getNumberOfSequences().
Referenced by incrementSequenceCount(), and PolymorphismSequenceContainer().
bool PolymorphismSequenceContainer::isIngroupMember | ( | const std::string & | name | ) | const |
Tell if a sequence is ingroup by name.
SequenceNotFoundException | if name is not found among the sequences' names. |
Definition at line 379 of file PolymorphismSequenceContainer.cpp.
References bpp::VectorSiteContainer::getSequencePosition(), and ingroup_.
bool PolymorphismSequenceContainer::isIngroupMember | ( | size_t | index | ) | const |
Tell if the sequence is ingroup by index.
IndexOutOfBoundsException | if index excedes the number of sequences in the container. |
Definition at line 370 of file PolymorphismSequenceContainer.cpp.
References bpp::VectorSiteContainer::getNumberOfSequences(), and ingroup_.
Referenced by bpp::PolymorphismSequenceContainerTools::extractIngroup(), bpp::PolymorphismSequenceContainerTools::extractOutgroup(), bpp::PolymorphismSequenceContainerTools::get3Prime(), bpp::PolymorphismSequenceContainerTools::get5Prime(), bpp::PolymorphismSequenceContainerTools::getCompleteSites(), bpp::PolymorphismSequenceContainerTools::getIntrons(), bpp::PolymorphismSequenceContainerTools::getNonCodingSites(), bpp::PolymorphismSequenceContainerTools::getNonSynonymousSites(), bpp::PolymorphismSequenceContainerTools::getOnePosition(), bpp::PolymorphismSequenceContainerTools::getSelectedSequences(), bpp::PolymorphismSequenceContainerTools::getSelectedSites(), bpp::PolymorphismSequenceContainerTools::getSitesWithoutGaps(), bpp::PolymorphismSequenceContainerTools::getSynonymousSites(), operator=(), and PolymorphismSequenceContainer().
PolymorphismSequenceContainer & PolymorphismSequenceContainer::operator= | ( | const PolymorphismSequenceContainer & | psc | ) |
Operator= : copy operator.
Definition at line 167 of file PolymorphismSequenceContainer.cpp.
References count_, getGroupId(), bpp::VectorSiteContainer::getNumberOfSequences(), getSequenceCount(), group_, ingroup_, isIngroupMember(), and bpp::VectorSiteContainer::operator=().
|
virtual |
Remove a sequence by name and return a pointer to this removed sequence.
SequenceNotFoundException | if name is not found among the sequences' names. |
Reimplemented from bpp::VectorSiteContainer.
Definition at line 209 of file PolymorphismSequenceContainer.cpp.
References bpp::VectorSiteContainer::getSequencePosition(), and removeSequence().
|
virtual |
Remove a sequence by index and return a pointer to this removed sequence.
IndexOutOfBoundsException | if index excedes the number of sequences. |
Reimplemented from bpp::VectorSiteContainer.
Definition at line 197 of file PolymorphismSequenceContainer.cpp.
References count_, bpp::VectorSiteContainer::getNumberOfSequences(), group_, ingroup_, and bpp::VectorSiteContainer::removeSequence().
Referenced by deleteSequence(), and removeSequence().
void PolymorphismSequenceContainer::setAsIngroupMember | ( | const std::string & | name | ) |
Set a sequence as ingroup member by name.
SequenceNotFoundException | if name is not found among the sequences' names. |
Definition at line 402 of file PolymorphismSequenceContainer.cpp.
References bpp::VectorSiteContainer::getSequencePosition(), and ingroup_.
void PolymorphismSequenceContainer::setAsIngroupMember | ( | size_t | index | ) |
Set a sequence as ingroup member by index.
IndexOutOfBoundsException | if index excedes the number of sequences in the container. |
Definition at line 393 of file PolymorphismSequenceContainer.cpp.
References bpp::VectorSiteContainer::getNumberOfSequences(), and ingroup_.
Referenced by bpp::PolymorphismSequenceContainerTools::get3Prime(), bpp::PolymorphismSequenceContainerTools::get5Prime(), bpp::PolymorphismSequenceContainerTools::getCompleteSites(), bpp::PolymorphismSequenceContainerTools::getIntrons(), bpp::PolymorphismSequenceContainerTools::getNonCodingSites(), bpp::PolymorphismSequenceContainerTools::getOnePosition(), bpp::PolymorphismSequenceContainerTools::getSelectedSequences(), bpp::PolymorphismSequenceContainerTools::getSelectedSites(), and bpp::PolymorphismSequenceContainerTools::getSitesWithoutGaps().
void PolymorphismSequenceContainer::setAsOutgroupMember | ( | const std::string & | name | ) |
Set a sequence as outgroup member by name.
SequenceNotFoundException | if name is not found among the sequences' names. |
Definition at line 426 of file PolymorphismSequenceContainer.cpp.
References bpp::VectorSiteContainer::getSequencePosition(), and ingroup_.
void PolymorphismSequenceContainer::setAsOutgroupMember | ( | size_t | index | ) |
Set a sequence as outgroup member by index.
IndexOutOfBoundsException | if index excedes the number of sequences in the container. |
Definition at line 417 of file PolymorphismSequenceContainer.cpp.
References bpp::VectorSiteContainer::getNumberOfSequences(), and ingroup_.
Referenced by bpp::PolymorphismSequenceContainerTools::get3Prime(), bpp::PolymorphismSequenceContainerTools::get5Prime(), bpp::PolymorphismSequenceContainerTools::getCompleteSites(), bpp::PolymorphismSequenceContainerTools::getIntrons(), bpp::PolymorphismSequenceContainerTools::getNonCodingSites(), bpp::PolymorphismSequenceContainerTools::getOnePosition(), bpp::PolymorphismSequenceContainerTools::getSelectedSequences(), bpp::PolymorphismSequenceContainerTools::getSelectedSites(), bpp::PolymorphismSequenceContainerTools::getSitesWithoutGaps(), bpp::SequenceStatistics::mkTable(), and bpp::PolymorphismSequenceContainerTools::read().
void PolymorphismSequenceContainer::setGroupId | ( | const std::string & | name, |
size_t | group_id | ||
) |
Set the group identifier of a sequence.
SequenceNotFoundException | if name is not found among the sequences' names. |
Definition at line 339 of file PolymorphismSequenceContainer.cpp.
References bpp::VectorSiteContainer::getSequencePosition(), and group_.
void PolymorphismSequenceContainer::setGroupId | ( | size_t | index, |
size_t | group_id | ||
) |
Set the group identifier of a sequence.
IndexOutOfBoundsException | if index excedes the number of sequences in the container. |
Definition at line 330 of file PolymorphismSequenceContainer.cpp.
References bpp::VectorSiteContainer::getNumberOfSequences(), and group_.
Referenced by bpp::PolymorphismSequenceContainerTools::get3Prime(), bpp::PolymorphismSequenceContainerTools::get5Prime(), bpp::PolymorphismSequenceContainerTools::getCompleteSites(), bpp::PolymorphismSequenceContainerTools::getIntrons(), bpp::PolymorphismSequenceContainerTools::getNonCodingSites(), bpp::PolymorphismSequenceContainerTools::getOnePosition(), bpp::DataSet::getPolymorphismSequenceContainer(), bpp::PolymorphismSequenceContainerTools::getSelectedSequences(), bpp::PolymorphismSequenceContainerTools::getSelectedSites(), and bpp::PolymorphismSequenceContainerTools::getSitesWithoutGaps().
void PolymorphismSequenceContainer::setSequenceCount | ( | const std::string & | name, |
unsigned int | count | ||
) |
Set the count of a sequence by name.
throw | SequenceNotFoundException if name is not found among the sequences' names. |
BadIntegerException | if count < 1 ... use deleteSequence instead of setting the count to 0. |
Definition at line 452 of file PolymorphismSequenceContainer.cpp.
References count(), bpp::VectorSiteContainer::getSequencePosition(), and setSequenceCount().
void PolymorphismSequenceContainer::setSequenceCount | ( | size_t | index, |
unsigned int | count | ||
) |
Set the count of a sequence by index.
IndexOutOfBoundsException | if index excedes the number of sequences in the container. |
BadIntegerException | if count < 1 ... use deleteSequence instead of setting the count to 0. |
Definition at line 441 of file PolymorphismSequenceContainer.cpp.
References count(), count_, and bpp::VectorSiteContainer::getNumberOfSequences().
Referenced by bpp::PolymorphismSequenceContainerTools::getCompleteSites(), bpp::PolymorphismSequenceContainerTools::getSitesWithoutGaps(), and setSequenceCount().
SiteContainer * PolymorphismSequenceContainer::toSiteContainer | ( | ) | const |
convert the container to a site container, with sequences dulicated according to their respective frequencies.
Definition at line 545 of file PolymorphismSequenceContainer.cpp.
References bpp::Sequence::clone(), bpp::VectorSiteContainer::getAlphabet(), bpp::Sequence::getName(), bpp::VectorSiteContainer::getNumberOfSequences(), bpp::VectorSiteContainer::getSequence(), getSequenceCount(), bpp::TextTools::toString(), and bpp::VectorSiteContainer::VectorSiteContainer().
|
private |
Definition at line 107 of file PolymorphismSequenceContainer.h.
Referenced by addSequenceWithFrequency(), clear(), decrementSequenceCount(), getSequenceCount(), incrementSequenceCount(), operator=(), PolymorphismSequenceContainer(), removeSequence(), and setSequenceCount().
|
private |
Definition at line 108 of file PolymorphismSequenceContainer.h.
Referenced by addSequenceWithFrequency(), clear(), getAllGroupsIds(), getGroupId(), operator=(), PolymorphismSequenceContainer(), removeSequence(), and setGroupId().
|
private |
Definition at line 106 of file PolymorphismSequenceContainer.h.
Referenced by addSequenceWithFrequency(), clear(), hasOutgroup(), isIngroupMember(), operator=(), PolymorphismSequenceContainer(), removeSequence(), setAsIngroupMember(), and setAsOutgroupMember().