bpp-seq3  3.0.0
bpp::AlignedValuesContainer Class Referenceabstract

The Container of Aligned Values interface. More...

#include <Bpp/Seq/Container/AlignedValuesContainer.h>

+ Inheritance diagram for bpp::AlignedValuesContainer:
+ Collaboration diagram for bpp::AlignedValuesContainer:

Public Member Functions

 AlignedValuesContainer ()
 
virtual ~AlignedValuesContainer ()
 
AlignedValuesContainerclone () const =0
 
virtual const CruxSymbolListSitegetSymbolListSite (size_t siteIndex) const =0
 Get a CruxSymbolListSite from a given position. More...
 
virtual CruxSymbolListSitegetSymbolListSite (size_t siteIndex)=0
 
virtual void deleteSites (size_t siteIndex, size_t length)=0
 Remove a continuous range of sites in the container. More...
 
virtual size_t getNumberOfSites () const =0
 Get the number of aligned positions in the container. More...
 
virtual void reindexSites ()=0
 Set all positions attributes. More...
 
virtual Vint getSitePositions () const =0
 Get all position attributes of sites. More...
 
virtual void setSitePositions (Vint vPositions)=0
 Set all position attributes of sites. More...
 
virtual std::string toString (size_t sequenceIndex) const =0
 
virtual std::string toString (const std::string &name) const=0
 Convert a particular sequence to a string. More...
 
virtual std::string toString (const std::string &name) const =0
 Convert a particular sequence to a string. More...
 
virtual const std::string & getName (size_t sequenceIndex) const =0
 Get the name of a particular row of the alignement (aka sequence). More...
 
virtual size_t getSequencePosition (const std::string &name) const =0
 Get the position of a sequence in sequence container from its name. More...
 
virtual double getStateValueAt (size_t siteIndex, size_t sequenceIndex, int state) const =0
 
virtual double getStateValueAt (size_t siteIndex, const std::string &sequenceName, int state) const=0
 get value of a state in a position More...
 
virtual double getStateValueAt (size_t siteIndex, const std::string &sequenceName, int state) const =0
 get value of a state in a position More...
 
virtual double operator() (size_t siteIndex, size_t sequenceIndex, int state) const =0
 
virtual double operator() (size_t siteIndex, const std::string &sequenceName, int state) const =0
 
virtual const CommentsgetComments (size_t sequenceIndex) const =0
 
virtual const CommentsgetComments (const std::string &name) const=0
 Get comments of a particular sequence. More...
 
virtual const CommentsgetComments (const std::string &name) const =0
 Get comments of a particular sequence. More...
 
virtual void setComments (size_t sequenceIndex, const Comments &comments)=0
 
virtual void setComments (const std::string &name, const Comments &comments)=0
 Set the comments of a particular sequence. More...
 
virtual void setComments (const std::string &name, const Comments &comments)=0
 Set the comments of a particular sequence. More...
 
virtual const AlphabetgetAlphabet () const =0
 Get container's alphabet. More...
 
virtual bool hasSequence (const std::string &name) const =0
 Check if a sequence with a given name is present in the container. More...
 
virtual size_t getNumberOfSequences () const =0
 Get the number of sequences in the container. More...
 
virtual std::vector< std::string > getSequenceNames () const =0
 Get all the names of the sequences in the container. More...
 
virtual void setSequenceNames (const std::vector< std::string > &names, bool checkNames)=0
 Set all sequence names. More...
 
virtual const CommentsgetGeneralComments () const =0
 Get the comments of this container. More...
 
virtual void setGeneralComments (const Comments &comments)=0
 Set the comments of this container. More...
 
virtual void deleteGeneralComments ()=0
 Delete the comments associated to this container. More...
 
virtual void clear ()=0
 Delete all data in the container. More...
 
virtual SequencedValuesContainercreateEmptyContainer () const =0
 Return a copy of this container, but with no data inside. More...
 

Detailed Description

The Container of Aligned Values interface.

Container implementing the AlignedValuesContainer interface deal with aligned data.

Definition at line 62 of file AlignedValuesContainer.h.

Constructor & Destructor Documentation

◆ AlignedValuesContainer()

bpp::AlignedValuesContainer::AlignedValuesContainer ( )
inline

Definition at line 66 of file AlignedValuesContainer.h.

◆ ~AlignedValuesContainer()

virtual bpp::AlignedValuesContainer::~AlignedValuesContainer ( )
inlinevirtual

Definition at line 67 of file AlignedValuesContainer.h.

Member Function Documentation

◆ clear()

virtual void bpp::SequencedValuesContainer::clear ( )
pure virtualinherited

◆ clone()

◆ createEmptyContainer()

virtual SequencedValuesContainer* bpp::SequencedValuesContainer::createEmptyContainer ( ) const
pure virtualinherited

Return a copy of this container, but with no data inside.

This method creates a new SequencedValuesContainer objet. The class of this container depends on the derivative class.

Returns
A new empty container, with the same alphabet as this one.

Implemented in bpp::VectorSiteContainer, bpp::VectorSequenceContainer, bpp::VectorProbabilisticSiteContainer, bpp::VectorProbabilisticSequenceContainer, bpp::CompressedVectorSiteContainer, and bpp::AlignedSequenceContainer.

◆ deleteGeneralComments()

virtual void bpp::SequencedValuesContainer::deleteGeneralComments ( )
pure virtualinherited

Delete the comments associated to this container.

Implemented in bpp::AbstractValuesContainer, and bpp::AbstractProbabilisticSequenceContainer.

◆ deleteSites()

virtual void bpp::AlignedValuesContainer::deleteSites ( size_t  siteIndex,
size_t  length 
)
pure virtual

Remove a continuous range of sites in the container.

Parameters
siteIndexThe position of the first site in the container.
lengthThe length of the region to delete, starting at pposition siteIndex.
Exceptions
IndexOutOfBoundsExceptionIf the specified range is not valid.

Implemented in bpp::VectorSiteContainer, bpp::VectorProbabilisticSiteContainer, bpp::CompressedVectorSiteContainer, and bpp::AlignedSequenceContainer.

Referenced by bpp::SequenceApplicationTools::getSitesToAnalyse(), bpp::SiteContainerTools::removeGapOnlySites(), and bpp::SiteContainerTools::removeGapOrUnresolvedOnlySites().

◆ getAlphabet()

virtual const Alphabet* bpp::SequencedValuesContainer::getAlphabet ( ) const
pure virtualinherited

Get container's alphabet.

Returns
The alphabet associated to this container.

Implemented in bpp::AbstractValuesContainer.

Referenced by bpp::Clustal::appendAlignmentFromStream(), bpp::DCSE::appendAlignmentFromStream(), bpp::NexusIOSequence::appendAlignmentFromStream(), bpp::Fasta::appendSequencesFromStream(), bpp::GenBank::appendSequencesFromStream(), bpp::Mase::appendSequencesFromStream(), bpp::SiteContainerTools::changeGapsToUnknownCharacters(), bpp::SiteContainerTools::changeUnresolvedCharactersToGaps(), bpp::SequenceContainerTools::convertAlphabet(), bpp::SequenceContainerTools::getCodonPosition(), bpp::SiteContainerTools::getCompleteSites(), bpp::SiteContainerTools::getConsensus(), bpp::SequenceContainerTools::getFrequencies(), bpp::SiteContainerTools::getSelectedPositions(), bpp::MaseTools::getSelectedSequences(), bpp::SiteContainerTools::getSelectedSites(), bpp::SiteContainerTools::getSequencePositions(), bpp::SequenceApplicationTools::getSitesToAnalyse(), bpp::SiteContainerTools::getSitesWithoutGaps(), bpp::SequenceContainerTools::merge(), bpp::SiteContainerTools::merge(), bpp::AbstractSequenceContainer::operator=(), bpp::Phylip::readInterleaved(), bpp::Phylip::readSequential(), bpp::SiteContainerTools::removeGapOnlySites(), bpp::SiteContainerTools::removeGapOrUnresolvedOnlySites(), bpp::SiteContainerTools::removeGapSites(), bpp::SiteContainerTools::removeStopCodonSites(), bpp::SiteContainerTools::resolveDottedAlignment(), bpp::SiteContainerTools::sampleSites(), bpp::Phylip::writeInterleaved(), and bpp::Phylip::writeSequential().

◆ getComments() [1/3]

virtual const Comments& bpp::SequencedValuesContainer::getComments ( const std::string &  name) const
pure virtualinherited

Get comments of a particular sequence.

Parameters
nameThe name of the sequence.
Returns
The comments associated to sequence with name 'name'.
Exceptions
SequenceNotFoundExceptionIf the name does not match any sequence in the container.

Implemented in bpp::VectorProbabilisticSequenceContainer, bpp::AbstractSequenceContainer, and bpp::AbstractProbabilisticSequenceContainer.

Referenced by bpp::SequenceContainerTools::getCodonPosition(), and bpp::Mase::writeSequences().

◆ getComments() [2/3]

virtual const Comments& bpp::SequencedValuesContainer::getComments
inherited

Get comments of a particular sequence.

Parameters
sequenceIndexThe position of the sequence.
Returns
The comments associated to sequence at position 'sequenceIndex'.
Exceptions
IndexOutOfBoundsExceptionIf the position does not match any sequence in the container.

◆ getComments() [3/3]

virtual const Comments& bpp::OrderedValuesContainer::getComments ( size_t  sequenceIndex) const
pure virtualinherited

◆ getGeneralComments()

◆ getName()

virtual const std::string& bpp::OrderedValuesContainer::getName ( size_t  sequenceIndex) const
pure virtualinherited

Get the name of a particular row of the alignement (aka sequence).

Parameters
sequenceIndexThe position of the sequence.
Returns
The name of the sequence at position 'sequenceIndex'.
Exceptions
IndexOutOfBoundsExceptionIf the position does not match any sequence in the container.

Implemented in bpp::VectorProbabilisticSequenceContainer, bpp::AbstractSequenceContainer, and bpp::AbstractProbabilisticSequenceContainer.

Referenced by bpp::VectorSiteContainer::VectorSiteContainer().

◆ getNumberOfSequences()

virtual size_t bpp::SequencedValuesContainer::getNumberOfSequences ( ) const
pure virtualinherited

Get the number of sequences in the container.

Returns
The number of sequences in the container.

Implemented in bpp::VectorSiteContainer, bpp::VectorSequenceContainer, bpp::VectorProbabilisticSiteContainer, bpp::VectorProbabilisticSequenceContainer, and bpp::CompressedVectorSiteContainer.

Referenced by bpp::AlignedSequenceContainer::AlignedSequenceContainer(), bpp::SequenceContainerTools::append(), bpp::NexusIOSequence::appendAlignmentFromStream(), bpp::SiteContainerTools::changeGapsToUnknownCharacters(), bpp::SiteContainerTools::changeUnresolvedCharactersToGaps(), bpp::SiteContainerTools::computeSimilarityMatrix(), bpp::SequenceContainerTools::convertAlphabet(), bpp::SequenceContainerTools::getSelectedSequences(), bpp::SiteContainerTools::getSequencePositions(), bpp::SequenceApplicationTools::getSitesToAnalyse(), bpp::SimpleSequenceContainerIterator::hasMoreSequences(), bpp::VectorSequenceContainer::operator=(), bpp::VectorSiteContainer::operator=(), bpp::SiteContainerTools::removeGapOnlySites(), bpp::SiteContainerTools::removeGapOrUnresolvedOnlySites(), bpp::SiteContainerTools::removeGapSites(), bpp::SiteContainerTools::removeStopCodonSites(), bpp::SiteContainerTools::resolveDottedAlignment(), bpp::VectorProbabilisticSiteContainer::VectorProbabilisticSiteContainer(), bpp::VectorSequenceContainer::VectorSequenceContainer(), bpp::VectorSiteContainer::VectorSiteContainer(), bpp::Clustal::writeAlignment(), bpp::Phylip::writeAlignment(), bpp::Stockholm::writeAlignment(), bpp::Phylip::writeInterleaved(), and bpp::Phylip::writeSequential().

◆ getNumberOfSites()

virtual size_t bpp::AlignedValuesContainer::getNumberOfSites ( ) const
pure virtual

Get the number of aligned positions in the container.

Returns
The number of sites in the container.

Implemented in bpp::VectorSiteContainer, bpp::VectorProbabilisticSiteContainer, bpp::CompressedVectorSiteContainer, and bpp::AlignedSequenceContainer.

Referenced by bpp::SiteContainerTools::bootstrapSites(), bpp::SiteContainerTools::changeGapsToUnknownCharacters(), bpp::SiteContainerTools::changeUnresolvedCharactersToGaps(), bpp::CompressedVectorSiteContainer::CompressedVectorSiteContainer(), bpp::SequenceApplicationTools::getAlignedContainer(), bpp::SiteContainerTools::getCompleteSites(), bpp::SiteContainerTools::getSequencePositions(), bpp::SequenceApplicationTools::getSitesToAnalyse(), bpp::SiteContainerTools::getSitesWithoutGaps(), bpp::SimpleSiteContainerIterator::hasMoreSites(), bpp::NoGapSiteContainerIterator::hasMoreSites(), bpp::CompleteSiteContainerIterator::hasMoreSites(), bpp::SiteContainerTools::merge(), bpp::AlignedSequenceContainer::operator=(), bpp::CompressedVectorSiteContainer::operator=(), bpp::VectorSiteContainer::operator=(), bpp::SiteContainerTools::removeGapOnlySites(), bpp::SiteContainerTools::removeGapOrUnresolvedOnlySites(), bpp::SiteContainerTools::removeGapSites(), bpp::SiteContainerTools::removeStopCodonSites(), bpp::SiteContainerTools::resolveDottedAlignment(), bpp::SiteContainerTools::sampleSites(), bpp::SiteContainerTools::translateSequence(), bpp::VectorProbabilisticSiteContainer::VectorProbabilisticSiteContainer(), and bpp::VectorSiteContainer::VectorSiteContainer().

◆ getSequenceNames()

virtual std::vector<std::string> bpp::SequencedValuesContainer::getSequenceNames ( ) const
pure virtualinherited

Get all the names of the sequences in the container.

Returns
A vector of strings with all sequence names.

Implemented in bpp::VectorSiteContainer, bpp::VectorSequenceContainer, bpp::VectorProbabilisticSiteContainer, bpp::VectorProbabilisticSequenceContainer, and bpp::CompressedVectorSiteContainer.

Referenced by bpp::SequenceContainerTools::append(), bpp::CompressedVectorSiteContainer::CompressedVectorSiteContainer(), bpp::SiteContainerTools::computeSimilarityMatrix(), bpp::SequenceContainerTools::convertAlphabet(), bpp::SequenceContainerTools::getCodonPosition(), bpp::SiteContainerTools::getCompleteSites(), bpp::SequenceContainerTools::getCounts(), bpp::SequenceContainerTools::getFrequencies(), bpp::SiteContainerTools::getSelectedSites(), bpp::SiteContainerTools::getSitesWithoutGaps(), bpp::SequenceContainerTools::keepOnlySelectedSequences(), bpp::SequenceContainerTools::merge(), bpp::SiteContainerTools::merge(), bpp::VectorSequenceContainer::operator=(), bpp::CompressedVectorSiteContainer::operator=(), bpp::VectorSiteContainer::operator=(), bpp::SiteContainerTools::removeGapOnlySites(), bpp::SiteContainerTools::removeGapOrUnresolvedOnlySites(), bpp::SiteContainerTools::removeGapSites(), bpp::SiteContainerTools::removeStopCodonSites(), bpp::SiteContainerTools::resolveDottedAlignment(), bpp::SequenceApplicationTools::restrictSelectedSequencesByName(), bpp::SiteContainerTools::sampleSites(), bpp::SequenceContainerTools::sequencesHaveTheSameLength(), bpp::VectorProbabilisticSiteContainer::VectorProbabilisticSiteContainer(), bpp::VectorSequenceContainer::VectorSequenceContainer(), bpp::VectorSiteContainer::VectorSiteContainer(), bpp::Pasta::writeAlignedValues(), bpp::Stockholm::writeAlignment(), bpp::Phylip::writeInterleaved(), bpp::Fasta::writeSequences(), bpp::Mase::writeSequences(), and bpp::Phylip::writeSequential().

◆ getSequencePosition()

virtual size_t bpp::OrderedValuesContainer::getSequencePosition ( const std::string &  name) const
pure virtualinherited

Get the position of a sequence in sequence container from its name.

Parameters
nameThe name of the sequence.
Returns
The position of the sequence with name 'name', if it exists.
Exceptions
SequenceNotFoundExceptionIf no sequence with name 'name' could be found.

Implemented in bpp::VectorSiteContainer, bpp::VectorSequenceContainer, bpp::VectorProbabilisticSiteContainer, bpp::VectorProbabilisticSequenceContainer, and bpp::CompressedVectorSiteContainer.

Referenced by bpp::AbstractProbabilisticSequenceContainer::setComments(), bpp::AbstractSequenceContainer::setComments(), and bpp::AbstractValuesContainer::setComments().

◆ getSitePositions()

virtual Vint bpp::AlignedValuesContainer::getSitePositions ( ) const
pure virtual

Get all position attributes of sites.

Returns
A vector with all site positions.

Implemented in bpp::VectorSiteContainer, bpp::VectorProbabilisticSiteContainer, bpp::CompressedVectorSiteContainer, and bpp::AlignedSequenceContainer.

Referenced by bpp::AlignedSequenceContainer::operator=().

◆ getStateValueAt() [1/3]

virtual double bpp::SequencedValuesContainer::getStateValueAt ( size_t  siteIndex,
const std::string &  sequenceName,
int  state 
) const
pure virtualinherited

get value of a state in a position

Parameters
siteIndexindex of the site
sequenceNamename of the sequence in the container
statestate in the alphabet

Implemented in bpp::VectorSiteContainer, bpp::VectorSequenceContainer, bpp::VectorProbabilisticSiteContainer, bpp::VectorProbabilisticSequenceContainer, and bpp::CompressedVectorSiteContainer.

◆ getStateValueAt() [2/3]

virtual double bpp::SequencedValuesContainer::getStateValueAt
inherited

get value of a state in a position

Parameters
siteIndexindex of the site
sequenceNamename of the sequence in the container
statestate in the alphabet

◆ getStateValueAt() [3/3]

virtual double bpp::OrderedValuesContainer::getStateValueAt ( size_t  siteIndex,
size_t  sequenceIndex,
int  state 
) const
pure virtualinherited

◆ getSymbolListSite() [1/2]

◆ getSymbolListSite() [2/2]

virtual CruxSymbolListSite& bpp::AlignedValuesContainer::getSymbolListSite ( size_t  siteIndex)
pure virtual

◆ hasSequence()

virtual bool bpp::SequencedValuesContainer::hasSequence ( const std::string &  name) const
pure virtualinherited

Check if a sequence with a given name is present in the container.

Parameters
nameThe name of the sequence.
Returns
True if a sequence with the given name is present in the container.

Implemented in bpp::VectorSiteContainer, bpp::VectorSequenceContainer, bpp::VectorProbabilisticSiteContainer, bpp::VectorProbabilisticSequenceContainer, and bpp::CompressedVectorSiteContainer.

Referenced by bpp::SequenceContainerTools::getSelectedSequences().

◆ operator()() [1/2]

virtual double bpp::SequencedValuesContainer::operator() ( size_t  siteIndex,
const std::string &  sequenceName,
int  state 
) const
pure virtualinherited

◆ operator()() [2/2]

virtual double bpp::OrderedValuesContainer::operator() ( size_t  siteIndex,
size_t  sequenceIndex,
int  state 
) const
pure virtualinherited

◆ reindexSites()

virtual void bpp::AlignedValuesContainer::reindexSites ( )
pure virtual

◆ setComments() [1/3]

virtual void bpp::SequencedValuesContainer::setComments
inherited

Set the comments of a particular sequence.

Parameters
sequenceIndexThe position of the sequence.
commentsThe comments to set to sequence with position 'i'.
Exceptions
IndexOutOfBoundsExceptionIf the position does not match any sequence in the container.

Referenced by bpp::AbstractProbabilisticSequenceContainer::setComments(), bpp::AbstractValuesContainer::setComments(), and bpp::VectorProbabilisticSequenceContainer::setComments().

◆ setComments() [2/3]

virtual void bpp::SequencedValuesContainer::setComments ( const std::string &  name,
const Comments comments 
)
pure virtualinherited

Set the comments of a particular sequence.

Parameters
nameThe name of the sequence.
commentsThe comments to set to sequence with name 'name'.
Exceptions
SequenceNotFoundExceptionIf the name does not match any sequence in the container.

Implemented in bpp::VectorProbabilisticSequenceContainer, bpp::AbstractValuesContainer, bpp::AbstractSequenceContainer, and bpp::AbstractProbabilisticSequenceContainer.

◆ setComments() [3/3]

◆ setGeneralComments()

virtual void bpp::SequencedValuesContainer::setGeneralComments ( const Comments comments)
pure virtualinherited

Set the comments of this container.

Parameters
commentsThe comments to be associated to this container.

Implemented in bpp::AbstractValuesContainer, and bpp::AbstractProbabilisticSequenceContainer.

Referenced by bpp::Clustal::appendAlignmentFromStream(), bpp::Fasta::appendSequencesFromStream(), and bpp::Mase::appendSequencesFromStream().

◆ setSequenceNames()

virtual void bpp::SequencedValuesContainer::setSequenceNames ( const std::vector< std::string > &  names,
bool  checkNames 
)
pure virtualinherited

Set all sequence names.

Parameters
namesA vector of strings with all sequence names. Its size must be strictly equal to the the size of the container (the number of sequences).
checkNamesTell if the container must check if the name of the sequence is already used in the container before adding it.
Exceptions
ExceptionIf there are redundant names in the input vector.

Implemented in bpp::VectorSiteContainer, bpp::VectorSequenceContainer, bpp::VectorProbabilisticSiteContainer, bpp::VectorProbabilisticSequenceContainer, and bpp::CompressedVectorSiteContainer.

Referenced by bpp::SequenceContainerTools::createContainerWithSequenceNames(), bpp::SiteContainerTools::getCompleteSites(), and bpp::SiteContainerTools::getSitesWithoutGaps().

◆ setSitePositions()

virtual void bpp::AlignedValuesContainer::setSitePositions ( Vint  vPositions)
pure virtual

Set all position attributes of sites.

Parameters
vPositionsA vector with all site positions.

Implemented in bpp::VectorSiteContainer, bpp::VectorProbabilisticSiteContainer, bpp::CompressedVectorSiteContainer, and bpp::AlignedSequenceContainer.

◆ toString() [1/3]

virtual std::string bpp::SequencedValuesContainer::toString ( const std::string &  name) const
pure virtualinherited

Convert a particular sequence to a string.

Parameters
nameThe name of the sequence.
Returns
A string describing the content of the sequence.
Exceptions
SequenceNotFoundExceptionIf the name does not match any sequence in the container.

Implemented in bpp::VectorProbabilisticSequenceContainer, bpp::AbstractSequenceContainer, and bpp::AbstractProbabilisticSequenceContainer.

Referenced by bpp::SequenceContainerTools::convertAlphabet(), bpp::Phylip::writeInterleaved(), bpp::Mase::writeSequences(), and bpp::Phylip::writeSequential().

◆ toString() [2/3]

virtual std::string bpp::SequencedValuesContainer::toString
inherited

Convert a particular sequence to a string.

Parameters
sequenceIndexThe position of the sequence.
Returns
A string describing the content of the sequence.
Exceptions
IndexOutOfBoundsExceptionIf the position does not match any sequence in the container.

◆ toString() [3/3]

virtual std::string bpp::OrderedValuesContainer::toString ( size_t  sequenceIndex) const
pure virtualinherited

The documentation for this class was generated from the following file: