bpp-seq3
3.0.0
|
A low memory, yet restricted, version of the VectorSiteContainer class. More...
#include <Bpp/Seq/Container/CompressedVectorSiteContainer.h>
Public Member Functions | |
CompressedVectorSiteContainer (std::vector< std::unique_ptr< Site >> &vs, std::shared_ptr< const Alphabet > &alphabet) | |
Build a new container from a set of sites. More... | |
CompressedVectorSiteContainer (size_t size, std::shared_ptr< const Alphabet > &alphabet) | |
Build a new empty container with specified size. More... | |
CompressedVectorSiteContainer (const std::vector< std::string > &names, std::shared_ptr< const Alphabet > &alphabet) | |
Build a new empty container with specified sequence names. More... | |
CompressedVectorSiteContainer (std::shared_ptr< const Alphabet > &alphabet) | |
Build a new empty container. More... | |
CompressedVectorSiteContainer (const CompressedVectorSiteContainer &vsc) | |
CompressedVectorSiteContainer (const SiteContainerInterface &sc) | |
CompressedVectorSiteContainer & | operator= (const CompressedVectorSiteContainer &vsc) |
CompressedVectorSiteContainer & | operator= (const SiteContainerInterface &sc) |
virtual | ~CompressedVectorSiteContainer () |
size_t | getNumberOfUniqueSites () const |
void | setSequence (size_t sequencePosition, std::unique_ptr< Sequence > &sequence, const std::string &sequenceKey) override |
void | setSequence (size_t sequencePosition, std::unique_ptr< Sequence > &sequence) override |
void | setSequence (const std::string &sequenceKey, std::unique_ptr< Sequence > &sequence) override |
void | addSequence (const std::string &sequenceKey, std::unique_ptr< Sequence > &sequence) override |
void | insertSequence (size_t sequencePosition, std::unique_ptr< Sequence > &sequence, const std::string &sequenceKey) override |
const int & | valueAt (const std::string &sequenceKey, size_t sitePosition) const override |
int & | valueAt (const std::string &sequenceKey, size_t sitePosition) override |
const int & | valueAt (size_t sequencePosition, size_t sitePosition) const override |
Get the content of the dataset at a specific position (sequence position, site position). More... | |
int & | valueAt (size_t sequencePosition, size_t sitePosition) override |
Get the content of the dataset at a specific position (sequence position, site position). More... | |
const Alphabet & | alphabet () const override |
Get the container's alphabet. More... | |
std::shared_ptr< const Alphabet > | getAlphabet () const override |
Get a pointer toward the container's alphabet. More... | |
virtual const Comments & | getComments () const =0 |
Get the comments. More... | |
const Comments & | getComments () const override |
Get the comments. More... | |
virtual void | setComments (const Comments &comments)=0 |
Set the comments. More... | |
void | setComments (const Comments &comments) override |
Set the comments. More... | |
virtual void | clearComments ()=0 |
void | clearComments () override |
The Clonable interface. | |
CompressedVectorSiteContainer * | clone () const override |
The SiteContainer interface implementation: | |
const Site & | site (size_t sitePosition) const override |
Get a site from the container. More... | |
void | setSite (size_t sitePosition, std::unique_ptr< Site > &site, bool checkCoordinate=true) override |
Set a site in the container. More... | |
std::unique_ptr< Site > | removeSite (size_t sitePosition) override |
Remove a site from the container. More... | |
void | deleteSite (size_t sitePosition) override |
Delete a site from the container. More... | |
void | addSite (std::unique_ptr< Site > &site, bool checkCoordinate=false) override |
Add a site in the container. More... | |
void | addSite (std::unique_ptr< Site > &site, size_t sitePosition, bool checkCoordinate=false) override |
Add a site in the container. More... | |
void | deleteSites (size_t sitePosition, size_t length) override |
Remove a continuous range of sites in the container. More... | |
size_t | getNumberOfSites () const override |
Get the number of aligned positions in the container. More... | |
void | reindexSites () override |
Set all coordinate attributes. More... | |
Vint | getSiteCoordinates () const override |
Get all coordinates of sites. More... | |
void | setSiteCoordinates (const Vint &coordinates) override |
Set all coordinates of sites. More... | |
The SequenceContainer interface. | |
const Sequence & | sequence (size_t sequenceIndex) const override |
Retrieve a sequence object from the container. More... | |
const Sequence & | sequence (const std::string &sequenceKey) const override |
Retrieve a sequence object from the container. More... | |
bool | hasSequence (const std::string &name) const override |
Check if a certain key is associated to a sequence in the container. More... | |
size_t | getSequencePosition (const std::string &sequenceKey) const override |
Get the position of a sequence with a given key in the container. More... | |
std::unique_ptr< Sequence > | removeSequence (size_t sequencePosition) override |
Remove a sequence from the container. More... | |
std::unique_ptr< Sequence > | removeSequence (const std::string &sequenceKey) override |
void | deleteSequence (size_t sequencePosition) override |
Remove and delete a sequence from the container. More... | |
void | deleteSequence (const std::string &sequenceKey) override |
Remove and delete a sequence from the container. More... | |
size_t | getNumberOfSequences () const override |
Get the number of sequences in the container. More... | |
std::vector< std::string > | getSequenceKeys () const override |
void | setSequenceKeys (const std::vector< std::string > &sequenceKeys) override |
Reset all sequence keys. More... | |
const std::string & | sequenceKey (size_t sequencePosition) const override |
Get the key associated to a given sequence. More... | |
std::vector< std::string > | getSequenceNames () const override |
void | setSequenceNames (const std::vector< std::string > &names, bool updateKeys) override |
Batch-set all sequence names. More... | |
std::vector< Comments > | getSequenceComments () const override |
void | clear () override |
Delete all data in the container. More... | |
CompressedVectorSiteContainer * | createEmptyContainer () const override |
Return a copy of this container, but with no data inside. More... | |
SequenceData methods. | |
double | getStateValueAt (size_t sitePosition, const std::string &sequenceKey, int state) const override |
Get the value of a state at a given position. More... | |
double | operator() (size_t sitePosition, const std::string &sequenceKey, int state) const override |
Get the value of a state at a given position. More... | |
double | getStateValueAt (size_t sitePosition, size_t sequencePosition, int state) const override |
Get value of a state at a given position. More... | |
double | operator() (size_t sitePosition, size_t sequencePosition, int state) const override |
Get the value of a state at a given position. More... | |
Access by key | |
virtual const SequenceType & | sequence (const HashType &sequenceKey) const override=0 |
Retrieve a sequence object from the container. More... | |
virtual void | setSequence (const HashType &sequenceKey, std::unique_ptr< SequenceType > &sequencePtr)=0 |
Replace a sequence in the container. More... | |
virtual void | addSequence (const HashType &sequenceKey, std::unique_ptr< SequenceType > &sequencePtr)=0 |
Add a sequence to the container. More... | |
virtual std::unique_ptr< SequenceType > | removeSequence (const HashType &sequenceKey)=0 |
Remove a sequence from the container. More... | |
virtual const SequenceType::ElementType & | valueAt (const HashType &sequenceKey, size_t sitePosition) const =0 |
Get the content of the dataset at a specific position (sequence key, site position). More... | |
virtual SequenceType::ElementType & | valueAt (const HashType &sequenceKey, size_t sitePosition)=0 |
Get the content of the dataset at a specific position (sequence key, site position). More... | |
Access by position | |
virtual void | setSequence (size_t sequencePosition, std::unique_ptr< SequenceType > &sequencePtr)=0 |
Replace a sequence in the container. More... | |
virtual void | setSequence (size_t sequencePosition, std::unique_ptr< SequenceType > &sequencePtr, const HashType &sequenceKey)=0 |
Replace a sequence in the container. More... | |
virtual void | insertSequence (size_t sequencePosition, std::unique_ptr< SequenceType > &sequencePtr, const HashType &sequenceKey)=0 |
Insert a sequence in the container. More... | |
Protected Member Functions | |
Site & | getSite_ (size_t sitePosition) |
size_t | getSiteIndex_ (const Site &site) |
Protected Attributes | |
VectorPositionedContainer< Site > | siteContainer_ |
VectorMappedContainer< Sequence > | sequenceContainer_ |
std::vector< std::string > | sequenceNames_ |
std::vector< Comments > | sequenceComments_ |
std::vector< size_t > | index_ |
std::shared_ptr< const Alphabet > | alphabet_ |
The container's alphabet. More... | |
Comments | comments_ |
A low memory, yet restricted, version of the VectorSiteContainer class.
This implementation is very similar to VectorSiteContainer, but identical sites are stored only once, which significantly reduces memory usage in the case of containers where the number of sites is large compared to the number of sequences. site access is as fast as in the standard VectorSiteContainer class, but site addition takes more time, as the new site must be first compared to the existing set. A major restriction of this container is that you can't add or remove sequences. The number of sequences is fixed after the first site has been added.
Definition at line 41 of file CompressedVectorSiteContainer.h.
CompressedVectorSiteContainer::CompressedVectorSiteContainer | ( | std::vector< std::unique_ptr< Site >> & | vs, |
std::shared_ptr< const Alphabet > & | alphabet | ||
) |
Build a new container from a set of sites.
vs | A std::vector of sites. |
alphabet | The common alphabet for all sites. |
Exception | If sites differ in size or in alphabet. |
Class constructors:
Definition at line 16 of file CompressedVectorSiteContainer.cpp.
References addSite(), sequenceContainer_, sequenceNames_, site(), and bpp::TextTools::toString().
Referenced by clone(), and createEmptyContainer().
CompressedVectorSiteContainer::CompressedVectorSiteContainer | ( | size_t | size, |
std::shared_ptr< const Alphabet > & | alphabet | ||
) |
Build a new empty container with specified size.
size | Number of sequences in the container. |
alphabet | The alphabet for this container. |
Definition at line 45 of file CompressedVectorSiteContainer.cpp.
References sequenceContainer_, sequenceNames_, and bpp::TextTools::toString().
CompressedVectorSiteContainer::CompressedVectorSiteContainer | ( | const std::vector< std::string > & | names, |
std::shared_ptr< const Alphabet > & | alphabet | ||
) |
Build a new empty container with specified sequence names.
names | Sequence names. This will set the number of sequences in the container. |
alphabet | The alphabet for this container. |
Definition at line 65 of file CompressedVectorSiteContainer.cpp.
References sequenceContainer_, sequenceNames_, and bpp::TextTools::toString().
CompressedVectorSiteContainer::CompressedVectorSiteContainer | ( | std::shared_ptr< const Alphabet > & | alphabet | ) |
Build a new empty container.
alphabet | The alphabet for this container. |
Definition at line 86 of file CompressedVectorSiteContainer.cpp.
CompressedVectorSiteContainer::CompressedVectorSiteContainer | ( | const CompressedVectorSiteContainer & | vsc | ) |
Definition at line 97 of file CompressedVectorSiteContainer.cpp.
References sequenceContainer_, sequenceNames_, and siteContainer_.
CompressedVectorSiteContainer::CompressedVectorSiteContainer | ( | const SiteContainerInterface & | sc | ) |
Definition at line 120 of file CompressedVectorSiteContainer.cpp.
References addSite(), bpp::Site::clone(), bpp::TemplateSiteContainerInterface< SiteType, SequenceType, HashType >::getNumberOfSites(), bpp::TemplateSequenceDataInterface< HashType >::getSequenceNames(), sequenceContainer_, and bpp::TemplateSiteContainerInterface< SiteType, SequenceType, HashType >::site().
|
inlinevirtual |
Definition at line 97 of file CompressedVectorSiteContainer.h.
References clear().
|
pure virtualinherited |
Add a sequence to the container.
Similar to setSequence, with the exception that an Exception will be raised in case of an existing key. Existing sequences will not be updated, only new ones will be appended.
sequenceKey | The key to which the sequence is associated. |
sequencePtr | The sequence to add. |
Implemented in bpp::TemplateVectorSequenceContainer< SequenceType >, bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >, and bpp::TemplateVectorSiteContainer< SiteType, SequenceType >.
Referenced by bpp::SequenceContainerTools::append(), bpp::Pasta::appendAlignmentFromStream(), bpp::Clustal::appendAlignmentFromStream(), bpp::DCSE::appendAlignmentFromStream(), bpp::NexusIOSequence::appendAlignmentFromStream(), bpp::GenBank::appendSequencesFromStream(), bpp::Fasta::appendSequencesFromStream(), bpp::Mase::appendSequencesFromStream(), bpp::SequenceContainerTools::convertAlphabet(), bpp::SequenceContainerTools::getSelectedSequences(), bpp::SequenceContainerTools::mergeByKey(), bpp::Phylip::readInterleaved(), and bpp::Phylip::readSequential().
|
inlineoverride |
Definition at line 285 of file CompressedVectorSiteContainer.h.
|
overridevirtual |
Add a site in the container.
site | The site to add. |
checkCoordinate | Look if the coordinate of the new site match a coordinate attribute in the container. |
Exception | If the specified site does not exists or is not correct. |
Implements bpp::TemplateSiteContainerInterface< Site, Sequence, std::string >.
Definition at line 331 of file CompressedVectorSiteContainer.cpp.
References bpp::AbstractTemplateSequenceContainer< Sequence, std::string >::getAlphabet(), bpp::AbstractTemplateSymbolList< T >::getAlphabet(), getNumberOfSequences(), getNumberOfUniqueSites(), getSiteIndex_(), index_, sequenceComments_, sequenceContainer_, sequenceNames_, site(), siteContainer_, bpp::AbstractTemplateSymbolList< T >::size(), and bpp::TextTools::toString().
Referenced by CompressedVectorSiteContainer(), and operator=().
|
overridevirtual |
Add a site in the container.
site | The site to add. |
sitePosition | The coordinate where to insert the site. |
checkCoordinate | Look if the coordinate of the new site match a coordinate attribute in the container. |
Exception | If the specified site does not exists or is not correct. |
Implements bpp::TemplateSiteContainerInterface< Site, Sequence, std::string >.
Definition at line 374 of file CompressedVectorSiteContainer.cpp.
References bpp::AbstractTemplateSequenceContainer< Sequence, std::string >::getAlphabet(), bpp::AbstractTemplateSymbolList< T >::getAlphabet(), getNumberOfSequences(), getNumberOfSites(), getNumberOfUniqueSites(), getSiteIndex_(), index_, sequenceComments_, sequenceContainer_, sequenceNames_, site(), siteContainer_, bpp::AbstractTemplateSymbolList< T >::size(), and bpp::TextTools::toString().
|
inlineoverridevirtualinherited |
Get the container's alphabet.
Implements bpp::TemplateSequenceDataInterface< std::string >.
Definition at line 95 of file AbstractSequenceContainer.h.
|
inlineoverridevirtual |
Delete all data in the container.
Implements bpp::TemplateSequenceDataInterface< std::string >.
Definition at line 248 of file CompressedVectorSiteContainer.h.
References index_, sequenceComments_, sequenceContainer_, sequenceNames_, and siteContainer_.
Referenced by operator=(), and ~CompressedVectorSiteContainer().
|
inlineoverridevirtualinherited |
Implements bpp::Commentable.
Definition at line 88 of file Commentable.h.
References bpp::SimpleCommentable::comments_.
|
pure virtualinherited |
Implemented in bpp::SimpleCommentable.
|
inlineoverridevirtual |
Implements bpp::TemplateSiteContainerInterface< Site, Sequence, std::string >.
Definition at line 105 of file CompressedVectorSiteContainer.h.
References CompressedVectorSiteContainer().
|
inlineoverridevirtual |
Return a copy of this container, but with no data inside.
This method creates a new SequencedContainer object. The class of this container depends on the class implementing this interface.
Implements bpp::TemplateSiteContainerInterface< Site, Sequence, std::string >.
Definition at line 257 of file CompressedVectorSiteContainer.h.
References CompressedVectorSiteContainer(), bpp::AbstractTemplateSequenceContainer< Sequence, std::string >::getAlphabet(), bpp::SimpleCommentable::getComments(), and bpp::SimpleCommentable::setComments().
|
inlineoverridevirtual |
Remove and delete a sequence from the container.
sequenceKey | The key to which the sequence is associated. |
Implements bpp::TemplateSequenceDataInterface< std::string >.
Definition at line 200 of file CompressedVectorSiteContainer.h.
|
inlineoverridevirtual |
Remove and delete a sequence from the container.
sequencePosition | The position of the sequence. |
Implements bpp::TemplateSequenceDataInterface< std::string >.
Definition at line 194 of file CompressedVectorSiteContainer.h.
|
overridevirtual |
Delete a site from the container.
The site is deleted (ie the container is shortened).
sitePosition | The position of the site in the container. |
IndexOutOfBoundsException | If the specified site does not exists. |
Implements bpp::TemplateSiteContainerInterface< Site, Sequence, std::string >.
Definition at line 309 of file CompressedVectorSiteContainer.cpp.
References getNumberOfSites(), and removeSite().
Referenced by deleteSites().
|
overridevirtual |
Remove a continuous range of sites in the container.
sitePosition | The position of the first site in the container. |
length | The length of the region to delete, starting at pposition sitePosition. |
IndexOutOfBoundsException | If the specified range is not valid. |
Implements bpp::TemplateSiteContainerInterface< Site, Sequence, std::string >.
Definition at line 320 of file CompressedVectorSiteContainer.cpp.
References deleteSite().
|
inlineoverridevirtualinherited |
Get a pointer toward the container's alphabet.
Implements bpp::TemplateSequenceDataInterface< std::string >.
Definition at line 101 of file AbstractSequenceContainer.h.
|
pure virtualinherited |
Get the comments.
Implemented in bpp::SimpleCommentable.
Referenced by bpp::Mase::appendSequencesFromStream(), bpp::AllelicAlphabet::convertFromStateAlphabet(), bpp::SiteContainerTools::getSelectedPositions(), bpp::MaseTools::getSelectedSites(), bpp::SiteContainerTools::getSelectedSites(), bpp::AbstractCoreSequence::operator=(), bpp::AbstractTemplateSequenceContainer< SequenceType, HashType >::operator=(), bpp::TemplateVectorSequenceContainer< SequenceType >::operator=(), bpp::SiteContainerTools::resolveDottedAlignment(), bpp::NucleicAcidsReplication::reverse(), bpp::AbstractReverseTransliterator::reverse(), bpp::SequenceTools::RNYslice(), bpp::SequenceTools::subseq(), bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::TemplateAlignedSequenceContainer(), bpp::TemplateVectorSequenceContainer< SequenceType >::TemplateVectorSequenceContainer(), bpp::NucleicAcidsReplication::translate(), bpp::AbstractTransliterator::translate(), bpp::Stockholm::writeAlignment(), bpp::Fasta::writeSequences(), and bpp::Mase::writeSequences().
|
inlineoverridevirtualinherited |
Get the comments.
Implements bpp::Commentable.
Definition at line 79 of file Commentable.h.
References bpp::SimpleCommentable::comments_.
Referenced by bpp::SequenceWithQualityTools::concatenate(), bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::createEmptyContainer(), createEmptyContainer(), bpp::TemplateVectorSequenceContainer< SequenceType >::createEmptyContainer(), bpp::TemplateVectorSiteContainer< SiteType, SequenceType >::createEmptyContainer(), bpp::SequenceWithAnnotationTools::createMaskAnnotation(), bpp::SequenceWithAnnotation::operator=(), bpp::SequenceWithQualityTools::subseq(), bpp::Pasta::writeSequence(), and bpp::Fasta::writeSequence().
|
inlineoverridevirtual |
Get the number of sequences in the container.
Implements bpp::TemplateSequenceDataInterface< std::string >.
Definition at line 206 of file CompressedVectorSiteContainer.h.
References sequenceContainer_.
Referenced by addSite(), sequence(), setSequenceNames(), and setSite().
|
inlineoverridevirtual |
Get the number of aligned positions in the container.
Implements bpp::TemplateSiteContainerInterface< Site, Sequence, std::string >.
Definition at line 133 of file CompressedVectorSiteContainer.h.
References index_.
Referenced by addSite(), deleteSite(), getSiteCoordinates(), removeSite(), sequence(), setSite(), and setSiteCoordinates().
|
inline |
Definition at line 148 of file CompressedVectorSiteContainer.h.
References siteContainer_.
Referenced by addSite(), getSiteIndex_(), and setSite().
|
inlineoverridevirtual |
Implements bpp::TemplateSequenceDataInterface< std::string >.
Definition at line 243 of file CompressedVectorSiteContainer.h.
References sequenceComments_.
|
inlineoverridevirtual |
Implements bpp::TemplateSequenceDataInterface< std::string >.
Definition at line 211 of file CompressedVectorSiteContainer.h.
References sequenceContainer_.
|
inlineoverridevirtual |
Implements bpp::TemplateSequenceDataInterface< std::string >.
Definition at line 226 of file CompressedVectorSiteContainer.h.
References sequenceNames_.
Referenced by operator=().
|
inlineoverridevirtual |
Get the position of a sequence with a given key in the container.
sequenceKey | The key to which the sequence is associated. |
Implements bpp::TemplateSequenceDataInterface< std::string >.
Definition at line 176 of file CompressedVectorSiteContainer.h.
References sequenceContainer_, and sequenceKey().
Referenced by getStateValueAt(), operator()(), sequence(), and valueAt().
|
inlineprotected |
Get a non-const reference to a site in the container. It is a convenient short-cut for use within the class only, as this can potentially mess up the data.
sitePosition | the index of the site to retrieve. |
Definition at line 354 of file CompressedVectorSiteContainer.h.
References index_, and siteContainer_.
Referenced by reindexSites(), and setSiteCoordinates().
|
overridevirtual |
Get all coordinates of sites.
Implements bpp::TemplateAlignmentDataInterface< HashType >.
Definition at line 443 of file CompressedVectorSiteContainer.cpp.
References getNumberOfSites(), index_, and siteContainer_.
|
protected |
Definition at line 488 of file CompressedVectorSiteContainer.cpp.
References getNumberOfUniqueSites(), site(), siteContainer_, and bpp::AbstractTemplateSymbolList< T >::size().
|
inlineoverridevirtual |
Get the value of a state at a given position.
sitePosition | index of the site |
sequenceKey | key of the sequence in the container |
state | state in the alphabet |
Implements bpp::TemplateSequenceDataInterface< std::string >.
Definition at line 324 of file CompressedVectorSiteContainer.h.
References getSequencePosition(), bpp::Site::getStateValueAt(), sequenceKey(), and site().
|
inlineoverridevirtual |
Get value of a state at a given position.
sitePosition | index of the site |
sequencePosition | index of the sequence in the container |
state | state in the alphabet |
Implements bpp::TemplateSequenceDataInterface< std::string >.
Definition at line 334 of file CompressedVectorSiteContainer.h.
References bpp::Site::getStateValueAt(), and site().
|
inlineoverridevirtual |
Check if a certain key is associated to a sequence in the container.
sequenceKey | The key to which the sequence is associated. |
Implements bpp::TemplateSequenceDataInterface< std::string >.
Definition at line 170 of file CompressedVectorSiteContainer.h.
References sequenceContainer_.
|
inlineoverride |
Definition at line 291 of file CompressedVectorSiteContainer.h.
|
pure virtualinherited |
Insert a sequence in the container.
sequencePosition | The position of the sequence. |
sequencePtr | The sequence to add. |
sequenceKey | The new key of the sequence. |
Implemented in bpp::TemplateVectorSequenceContainer< SequenceType >, bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >, and bpp::TemplateVectorSiteContainer< SiteType, SequenceType >.
|
inlineoverridevirtual |
Get the value of a state at a given position.
Same as getValueAt.
sitePosition | index of the site |
sequenceKey | key of the sequence in the container |
state | state in the alphabet |
Implements bpp::TemplateSequenceDataInterface< std::string >.
Definition at line 329 of file CompressedVectorSiteContainer.h.
References getSequencePosition(), bpp::Site::getStateValueAt(), sequenceKey(), and site().
|
inlineoverridevirtual |
Get the value of a state at a given position.
Same as getValueAt.
sitePosition | index of the site |
sequencePosition | index of the sequence in the container |
state | state in the alphabet |
Implements bpp::TemplateSequenceDataInterface< std::string >.
Definition at line 339 of file CompressedVectorSiteContainer.h.
References bpp::Site::getStateValueAt(), and site().
CompressedVectorSiteContainer & CompressedVectorSiteContainer::operator= | ( | const CompressedVectorSiteContainer & | vsc | ) |
Definition at line 143 of file CompressedVectorSiteContainer.cpp.
References clear(), getSequenceNames(), index_, bpp::AbstractTemplateSequenceContainer< SequenceType, HashType >::operator=(), sequenceComments_, sequenceContainer_, sequenceNames_, and siteContainer_.
CompressedVectorSiteContainer & CompressedVectorSiteContainer::operator= | ( | const SiteContainerInterface & | sc | ) |
Definition at line 169 of file CompressedVectorSiteContainer.cpp.
References addSite(), clear(), bpp::Site::clone(), bpp::TemplateSiteContainerInterface< SiteType, SequenceType, HashType >::getNumberOfSites(), bpp::TemplateSequenceDataInterface< HashType >::getSequenceComments(), bpp::TemplateSequenceDataInterface< HashType >::getSequenceNames(), bpp::AbstractTemplateSequenceContainer< SequenceType, HashType >::operator=(), sequenceComments_, sequenceNames_, and bpp::TemplateSiteContainerInterface< SiteType, SequenceType, HashType >::site().
|
overridevirtual |
Set all coordinate attributes.
Implements bpp::TemplateSiteContainerInterface< Site, Sequence, std::string >.
Definition at line 420 of file CompressedVectorSiteContainer.cpp.
References getSite_(), bpp::AbstractCoreSite::setCoordinate(), and siteContainer_.
|
pure virtualinherited |
Remove a sequence from the container.
sequenceKey | The key to which the sequence is associated. |
Implemented in bpp::TemplateVectorSiteContainer< SiteType, SequenceType >, and bpp::TemplateVectorSequenceContainer< SequenceType >.
Referenced by bpp::SequenceContainerTools::keepOnlySelectedSequences(), and bpp::SequenceApplicationTools::restrictSelectedSequencesByName().
|
inlineoverride |
Definition at line 188 of file CompressedVectorSiteContainer.h.
|
inlineoverridevirtual |
Remove a sequence from the container.
sequencePosition | The position of the sequence. |
Implements bpp::TemplateSequenceContainerInterface< SequenceType, HashType >.
Definition at line 182 of file CompressedVectorSiteContainer.h.
|
overridevirtual |
Remove a site from the container.
The site is deleted (ie the container is shortened) and a pointer toward it is returned.
sitePosition | The position of the site in the container. |
IndexOutOfBoundsException | If the specified site does not exists. |
Implements bpp::TemplateSiteContainerInterface< Site, Sequence, std::string >.
Definition at line 268 of file CompressedVectorSiteContainer.cpp.
References getNumberOfSites(), index_, sequenceContainer_, and siteContainer_.
Referenced by deleteSite().
|
overridepure virtualinherited |
Retrieve a sequence object from the container.
sequenceKey | The key to which the sequence is associated. |
Implemented in bpp::TemplateVectorSiteContainer< SiteType, SequenceType >, and bpp::TemplateVectorSequenceContainer< SequenceType >.
Referenced by bpp::SequenceContainerTools::append(), bpp::SequenceContainerTools::convertAlphabet(), bpp::SequenceContainerTools::getCodonPosition(), bpp::SequenceContainerTools::getCounts(), bpp::SequenceContainerTools::getFrequencies(), bpp::SequenceContainerTools::getSelectedSequences(), bpp::SiteContainerTools::getSequencePositions(), bpp::SequenceContainerTools::hasSequenceWithName(), bpp::SequenceContainerTools::mergeByKey(), bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::operator=(), bpp::TemplateVectorSequenceContainer< SequenceType >::operator=(), bpp::SiteContainerTools::resolveDottedAlignment(), bpp::TemplateVectorSequenceContainer< SequenceType >::TemplateVectorSequenceContainer(), bpp::TemplateVectorSiteContainer< SiteType, SequenceType >::TemplateVectorSiteContainer(), bpp::SiteContainerTools::translateSequence(), bpp::Pasta::writeAlignment(), bpp::Clustal::writeAlignment(), bpp::Stockholm::writeAlignment(), bpp::Phylip::writeInterleaved(), bpp::Fasta::writeSequences(), bpp::Mase::writeSequences(), bpp::Pasta::writeSequences(), and bpp::Phylip::writeSequential().
|
inlineoverridevirtual |
Retrieve a sequence object from the container.
sequenceKey | The key to which the sequence is associated. |
Implements bpp::TemplateSequenceDataInterface< std::string >.
Definition at line 163 of file CompressedVectorSiteContainer.h.
References getSequencePosition(), sequence(), and sequenceKey().
|
overridevirtual |
Retrieve a sequence object from the container.
sequencePosition | The position of the sequence. |
Implements bpp::TemplateSequenceContainerInterface< SequenceType, HashType >.
Definition at line 456 of file CompressedVectorSiteContainer.cpp.
References bpp::AbstractTemplateSequenceContainer< Sequence, std::string >::getAlphabet(), getNumberOfSequences(), getNumberOfSites(), index_, sequenceComments_, sequenceContainer_, sequenceKey(), sequenceNames_, and siteContainer_.
Referenced by sequence().
|
inlineoverridevirtual |
Get the key associated to a given sequence.
sequencePosition | The position of the sequence in the container. |
Implements bpp::TemplateSequenceDataInterface< std::string >.
Definition at line 221 of file CompressedVectorSiteContainer.h.
References sequenceContainer_.
Referenced by getSequencePosition(), getStateValueAt(), operator()(), sequence(), and valueAt().
|
inlineoverridevirtualinherited |
Set the comments.
comments | The new comments. |
Implements bpp::Commentable.
Definition at line 86 of file Commentable.h.
References bpp::SimpleCommentable::comments_.
Referenced by createEmptyContainer(), bpp::TemplateVectorSequenceContainer< SequenceType >::createEmptyContainer(), bpp::Pasta::nextSequence(), bpp::Fasta::nextSequence(), bpp::AbstractCoreSequence::operator=(), bpp::SequenceWithAnnotation::operator=(), bpp::AbstractTemplateSequenceContainer< SequenceType, HashType >::operator=(), bpp::TemplateVectorSequenceContainer< SequenceType >::operator=(), bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::TemplateAlignedSequenceContainer(), and bpp::TemplateVectorSequenceContainer< SequenceType >::TemplateVectorSequenceContainer().
|
pure virtualinherited |
Set the comments.
comments | The new comments. |
Implemented in bpp::SimpleCommentable.
Referenced by bpp::Pasta::appendAlignmentFromStream(), bpp::Clustal::appendAlignmentFromStream(), bpp::Fasta::appendSequencesFromStream(), and bpp::Mase::appendSequencesFromStream().
|
pure virtualinherited |
Replace a sequence in the container.
If a sequence is found with the given key, it will be updated with the new one. If no sequence with the given key is found, the new sequence will be added to the container.
sequenceKey | The key to which the sequence is associated. |
sequencePtr | The sequence to set. |
Implemented in bpp::TemplateVectorSequenceContainer< SequenceType >, bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >, and bpp::TemplateVectorSiteContainer< SiteType, SequenceType >.
|
inlineoverride |
Definition at line 279 of file CompressedVectorSiteContainer.h.
|
inlineoverride |
Definition at line 273 of file CompressedVectorSiteContainer.h.
|
inlineoverride |
Definition at line 267 of file CompressedVectorSiteContainer.h.
|
pure virtualinherited |
Replace a sequence in the container.
The original key associated to the sequence will be kept.
sequencePosition | The position of the sequence. |
sequencePtr | The sequence to add. |
Implemented in bpp::TemplateVectorSequenceContainer< SequenceType >, bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >, and bpp::TemplateVectorSiteContainer< SiteType, SequenceType >.
|
pure virtualinherited |
Replace a sequence in the container.
The original key associated to the sequence will be kept.
sequencePosition | The position of the sequence. |
sequencePtr | The sequence to add. |
sequenceKey | The new key of the sequence. |
Implemented in bpp::TemplateVectorSequenceContainer< SequenceType >, bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >, and bpp::TemplateVectorSiteContainer< SiteType, SequenceType >.
|
inlineoverridevirtual |
Reset all sequence keys.
Implements bpp::TemplateSequenceDataInterface< std::string >.
Definition at line 216 of file CompressedVectorSiteContainer.h.
References sequenceContainer_.
Referenced by setSequenceNames().
|
inlineoverridevirtual |
Batch-set all sequence names.
names | A vector of sequence names. Must be the same size as the number of sequences in the container, otherwise a DimensionException is thrown. |
updateKeys | Tell whether the keys of the sequences should be updated with the new sequence names. |
Implements bpp::TemplateSequenceDataInterface< std::string >.
Definition at line 231 of file CompressedVectorSiteContainer.h.
References getNumberOfSequences(), sequenceContainer_, sequenceNames_, and setSequenceKeys().
|
overridevirtual |
Set a site in the container.
sitePosition | The position of the site in the container. |
site | The site to set. |
checkCoordinate | Look if the coordinate of the new site match a coordinate attribute in the container. |
Exception | If the specified site does not exists or is not correct. |
Implements bpp::TemplateSiteContainerInterface< Site, Sequence, std::string >.
Definition at line 189 of file CompressedVectorSiteContainer.cpp.
References bpp::AbstractTemplateSequenceContainer< Sequence, std::string >::getAlphabet(), bpp::AbstractTemplateSymbolList< T >::getAlphabet(), getNumberOfSequences(), getNumberOfSites(), getNumberOfUniqueSites(), getSiteIndex_(), index_, sequenceContainer_, site(), siteContainer_, and bpp::AbstractTemplateSymbolList< T >::size().
|
overridevirtual |
Set all coordinates of sites.
vCoordinates | A vector with all site coordinates. |
Implements bpp::TemplateAlignmentDataInterface< HashType >.
Definition at line 430 of file CompressedVectorSiteContainer.cpp.
References getNumberOfSites(), getSite_(), and bpp::AbstractCoreSite::setCoordinate().
|
inlineoverridevirtual |
Get a site from the container.
sitePosition | The position of the site in the container. |
IndexOutOfBoundsException | If the specified site does not exists. |
Implements bpp::TemplateSiteContainerInterface< Site, Sequence, std::string >.
Definition at line 116 of file CompressedVectorSiteContainer.h.
References index_, and siteContainer_.
Referenced by addSite(), CompressedVectorSiteContainer(), getSiteIndex_(), getStateValueAt(), operator()(), setSite(), and valueAt().
|
pure virtualinherited |
Get the content of the dataset at a specific position (sequence key, site position).
sequenceKey | key of the sequence in the container |
sitePosition | index of the site |
Implemented in bpp::TemplateVectorSiteContainer< SiteType, SequenceType >, and bpp::TemplateVectorSequenceContainer< SequenceType >.
|
pure virtualinherited |
Get the content of the dataset at a specific position (sequence key, site position).
sequenceKey | key of the sequence in the container |
sitePosition | index of the site |
Implemented in bpp::TemplateVectorSiteContainer< SiteType, SequenceType >, bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >, and bpp::TemplateVectorSequenceContainer< SequenceType >.
|
inlineoverride |
Definition at line 297 of file CompressedVectorSiteContainer.h.
References getSequencePosition(), sequenceKey(), and site().
|
inlineoverride |
Definition at line 302 of file CompressedVectorSiteContainer.h.
|
inlineoverridevirtual |
Get the content of the dataset at a specific position (sequence position, site position).
sequencePosition | index of the sequence in the container |
sitePosition | index of the site |
Implements bpp::TemplateSequenceContainerInterface< SequenceType, HashType >.
Definition at line 308 of file CompressedVectorSiteContainer.h.
References site().
|
inlineoverridevirtual |
Get the content of the dataset at a specific position (sequence position, site position).
sequencePosition | index of the sequence in the container |
sitePosition | index of the site |
Implements bpp::TemplateSequenceContainerInterface< SequenceType, HashType >.
Definition at line 313 of file CompressedVectorSiteContainer.h.
|
protectedinherited |
The container's alphabet.
Definition at line 31 of file AbstractSequenceContainer.h.
|
protectedinherited |
Definition at line 50 of file Commentable.h.
Referenced by bpp::SimpleCommentable::clearComments(), bpp::SimpleCommentable::getComments(), bpp::SimpleCommentable::operator=(), and bpp::SimpleCommentable::setComments().
|
protected |
Definition at line 50 of file CompressedVectorSiteContainer.h.
Referenced by addSite(), clear(), getNumberOfSites(), getSite_(), getSiteCoordinates(), operator=(), removeSite(), sequence(), setSite(), and site().
|
protected |
Definition at line 49 of file CompressedVectorSiteContainer.h.
Referenced by addSite(), clear(), getSequenceComments(), operator=(), and sequence().
|
protected |
Definition at line 47 of file CompressedVectorSiteContainer.h.
Referenced by addSite(), clear(), CompressedVectorSiteContainer(), getNumberOfSequences(), getSequenceKeys(), getSequencePosition(), hasSequence(), operator=(), removeSite(), sequence(), sequenceKey(), setSequenceKeys(), setSequenceNames(), and setSite().
|
protected |
Definition at line 48 of file CompressedVectorSiteContainer.h.
Referenced by addSite(), clear(), CompressedVectorSiteContainer(), getSequenceNames(), operator=(), sequence(), and setSequenceNames().
|
protected |
Definition at line 46 of file CompressedVectorSiteContainer.h.
Referenced by addSite(), clear(), CompressedVectorSiteContainer(), getNumberOfUniqueSites(), getSite_(), getSiteCoordinates(), getSiteIndex_(), operator=(), reindexSites(), removeSite(), sequence(), setSite(), and site().