bpp-seq3  3.0.0
bpp::AbstractSequenceContainer Class Referenceabstract

Partial implementation of the OrderedSequenceContainer interface. More...

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

+ Inheritance diagram for bpp::AbstractSequenceContainer:
+ Collaboration diagram for bpp::AbstractSequenceContainer:

Public Member Functions

 AbstractSequenceContainer (const Alphabet *alpha)
 This constructor initialize the alphabet pointer. More...
 
 AbstractSequenceContainer (const AbstractSequenceContainer &sc)
 
AbstractSequenceContaineroperator= (const AbstractSequenceContainer &sc)
 
 AbstractSequenceContainer (const SequenceContainer &sc)
 Copy constructor from any SequenceContainer object. More...
 
AbstractSequenceContaineroperator= (const SequenceContainer &sc)
 Assignation operator from any SequenceContainer object. More...
 
virtual ~AbstractSequenceContainer ()
 
std::string toString (const std::string &name) const
 Convert a particular sequence to a string. More...
 
const CommentsgetComments (const std::string &name) const
 Get comments of a particular sequence. More...
 
void setComments (const std::string &name, const Comments &comments)
 Set the comments of a particular sequence. More...
 
virtual const SequencegetSequence (size_t sequenceIndex) const =0
 Retrieve a sequence object from the container. More...
 
virtual const SequencegetSequence (const std::string &name) const =0
 Retrieve a sequence object from the container. More...
 
virtual void setSequence (size_t sequenceIndex, const Sequence &sequence, bool checkName)=0
 Replace a sequence in the container. More...
 
virtual void setSequence (const std::string &name, const Sequence &sequence, bool checkName)=0
 Replace a sequence in the container. More...
 
virtual std::shared_ptr< SequenceremoveSequence (size_t sequenceIndex)=0
 Extract (and remove) a sequence from the container. More...
 
virtual std::shared_ptr< SequenceremoveSequence (const std::string &name)=0
 Extract (and remove) a sequence from the container. More...
 
virtual double operator() (size_t siteIndex, const std::string &sequenceName, int state) const =0
 
virtual double operator() (size_t siteIndex, size_t sequenceIndex, int state) const =0
 
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 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, 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 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...
 
virtual Clonableclone () const=0
 
OrderedValuesContainerclone () const =0
 
virtual size_t getSequencePosition (const std::string &name) const =0
 Get the position of a sequence in sequence container from its name. More...
 
void setComments (const Comments &comments)
 Set the comments. More...
 
const CommentsgetComments () const
 Get the comments. More...
 
void clearComments ()
 
From the OrderedSequenceContainer interface
virtual const std::string & getName (size_t sequenceIndex) const
 Get the name of a particular row of the alignement (aka sequence). More...
 
virtual std::string toString (size_t sequenceIndex) const
 
virtual const CommentsgetComments (size_t sequenceIndex) const
 
virtual void setComments (size_t sequenceIndex, const Comments &comments)=0
 
SequenceContainer methods.
virtual const SequencegetSequence (const std::string &name) const=0
 Retrieve a sequence object from the container. More...
 
virtual void setSequence (const std::string &name, const Sequence &sequence, bool checkName)=0
 Replace a sequence in the container. More...
 
virtual std::shared_ptr< SequenceremoveSequence (const std::string &name)=0
 Extract (and remove) a sequence from the container. More...
 
virtual std::string toString (size_t sequenceIndex) const=0
 
virtual const CommentsgetComments (size_t sequenceIndex) const=0
 
virtual void setComments (size_t sequenceIndex, const Comments &comments)=0
 
Provide direct access to sequences content.
Warning
These operators allow you to modifiy the content of the sequences. No checking is performed for your modifications, so use with care, or consider using the setContent() methods.
virtual int & valueAt (const std::string &sequenceName, size_t elementIndex)=0
 Element access function. More...
 
virtual const int & valueAt (const std::string &sequenceName, size_t elementIndex) const =0
 Element access function. More...
 
virtual int & valueAt (size_t sequenceIndex, size_t elementIndex)=0
 Element access operator. More...
 
virtual const int & valueAt (size_t sequenceIndex, size_t elementIndex) const =0
 Element access operator. More...
 
virtual int & operator() (size_t sequenceIndex, size_t elementIndex)=0
 Element access operator. More...
 
virtual const int & operator() (size_t sequenceIndex, size_t elementIndex) const =0
 Element access operator. More...
 
Provide direct access to sequences content.
Warning
These operators allow you to modifiy the content of the sequences. No checking is performed for your modifications, so use with care, or consider using the setContent() methods.
virtual int & operator() (const std::string &sequenceName, size_t elementIndex)=0
 Element access operator. More...
 
virtual const int & operator() (const std::string &sequenceName, size_t elementIndex) const =0
 Element access operator. More...
 
virtual void addSequence (const Sequence &sequence, bool checkName)=0
 Add a sequence to the container. More...
 
From the SequencedValuesContainer interface
const AlphabetgetAlphabet () const
 Get container's alphabet. More...
 
const CommentsgetGeneralComments () const
 Get the comments of this container. More...
 
void setGeneralComments (const Comments &comments)
 Set the comments of this container. More...
 
void deleteGeneralComments ()
 Delete the comments associated to this container. More...
 

Protected Attributes

const Alphabetalphabet_
 The container's alphabet. More...
 
Comments comments_
 

Detailed Description

Partial implementation of the OrderedSequenceContainer interface.

This abstract class provides an alphabet and comments, with associated methods.

Definition at line 56 of file AbstractSequenceContainer.h.

Constructor & Destructor Documentation

◆ AbstractSequenceContainer() [1/3]

bpp::AbstractSequenceContainer::AbstractSequenceContainer ( const Alphabet alpha)
inline

This constructor initialize the alphabet pointer.

This constructor is to be called by constructors of derived classes.

Parameters
alphaThe alphabet to be associated to this container.

Definition at line 68 of file AbstractSequenceContainer.h.

◆ AbstractSequenceContainer() [2/3]

bpp::AbstractSequenceContainer::AbstractSequenceContainer ( const AbstractSequenceContainer sc)
inline

Definition at line 71 of file AbstractSequenceContainer.h.

◆ AbstractSequenceContainer() [3/3]

bpp::AbstractSequenceContainer::AbstractSequenceContainer ( const SequenceContainer sc)
inline

Copy constructor from any SequenceContainer object.

Parameters
scAnother sequence container.

Definition at line 86 of file AbstractSequenceContainer.h.

◆ ~AbstractSequenceContainer()

virtual bpp::AbstractSequenceContainer::~AbstractSequenceContainer ( )
inlinevirtual

Definition at line 103 of file AbstractSequenceContainer.h.

Member Function Documentation

◆ addSequence()

virtual void bpp::SequenceContainer::addSequence ( const Sequence sequence,
bool  checkName 
)
pure virtualinherited

◆ clear()

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

◆ clearComments()

◆ 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() [1/2]

void bpp::AbstractValuesContainer::deleteGeneralComments ( )
inlinevirtualinherited

Delete the comments associated to this container.

Implements bpp::SequencedValuesContainer.

Definition at line 115 of file AbstractValuesContainer.h.

References bpp::Commentable::clearComments().

◆ deleteGeneralComments() [2/2]

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

Delete the comments associated to this container.

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

◆ getAlphabet() [1/2]

const Alphabet* bpp::AbstractValuesContainer::getAlphabet ( ) const
inlinevirtualinherited

Get container's alphabet.

Returns
The alphabet associated to this container.

Implements bpp::SequencedValuesContainer.

Definition at line 99 of file AbstractValuesContainer.h.

References bpp::AbstractValuesContainer::alphabet_.

Referenced by bpp::VectorProbabilisticSequenceContainer::addSequence(), bpp::VectorProbabilisticSiteContainer::addSequence(), bpp::VectorSequenceContainer::addSequence(), bpp::VectorSiteContainer::addSequence(), bpp::CompressedVectorSiteContainer::addSite(), bpp::AlignedSequenceContainer::addSite(), bpp::VectorSiteContainer::addSite(), bpp::VectorProbabilisticSiteContainer::addSite(), bpp::Pasta::appendSequencesFromStream(), bpp::AlignedSequenceContainer::createEmptyContainer(), bpp::CompressedVectorSiteContainer::createEmptyContainer(), bpp::VectorProbabilisticSequenceContainer::createEmptyContainer(), bpp::VectorProbabilisticSiteContainer::createEmptyContainer(), bpp::VectorSequenceContainer::createEmptyContainer(), bpp::VectorSiteContainer::createEmptyContainer(), bpp::CompressedVectorSiteContainer::getSequence(), bpp::VectorSiteContainer::getSequence(), bpp::VectorProbabilisticSiteContainer::getSequence(), bpp::AlignedSequenceContainer::getSite(), bpp::CompressedVectorSiteContainer::getStateValueAt(), bpp::VectorProbabilisticSiteContainer::getStateValueAt(), bpp::VectorSiteContainer::getStateValueAt(), bpp::VectorProbabilisticSequenceContainer::getStateValueAt(), bpp::VectorSequenceContainer::getStateValueAt(), bpp::CompressedVectorSiteContainer::operator()(), bpp::VectorProbabilisticSiteContainer::operator()(), bpp::VectorSiteContainer::operator()(), bpp::VectorProbabilisticSequenceContainer::operator()(), bpp::VectorSequenceContainer::operator()(), bpp::VectorProbabilisticSiteContainer::realloc(), bpp::VectorSiteContainer::realloc(), bpp::CompressedVectorSiteContainer::removeSite(), bpp::CompressedVectorSiteContainer::setComments(), bpp::VectorProbabilisticSiteContainer::setSequence(), bpp::VectorProbabilisticSequenceContainer::setSequence(), bpp::VectorSiteContainer::setSequence(), bpp::VectorSequenceContainer::setSequence(), bpp::AlignedSequenceContainer::setSite(), bpp::CompressedVectorSiteContainer::setSite(), and bpp::VectorSiteContainer::setSite().

◆ getAlphabet() [2/2]

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(), 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/4]

◆ getComments() [2/4]

const Comments& bpp::AbstractSequenceContainer::getComments ( const std::string &  name) const
inlinevirtual

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.

Implements bpp::SequencedValuesContainer.

Definition at line 111 of file AbstractSequenceContainer.h.

References bpp::CoreSequence::getComments(), and bpp::OrderedSequenceContainer::getSequence().

◆ getComments() [3/4]

virtual const Comments& bpp::AbstractSequenceContainer::getComments ( size_t  sequenceIndex) const
inlinevirtual

◆ getComments() [4/4]

◆ getGeneralComments() [1/2]

const Comments& bpp::AbstractValuesContainer::getGeneralComments ( ) const
inlinevirtualinherited

◆ getGeneralComments() [2/2]

◆ getName()

virtual const std::string& bpp::AbstractSequenceContainer::getName ( size_t  sequenceIndex) const
inlinevirtual

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.

Implements bpp::OrderedValuesContainer.

Definition at line 127 of file AbstractSequenceContainer.h.

References bpp::CoreSequence::getName(), and bpp::OrderedSequenceContainer::getSequence().

Referenced by bpp::VectorSequenceContainer::getSequenceNames(), and bpp::VectorSequenceContainer::hasSequenceByName().

◆ 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().

◆ getSequence() [1/3]

◆ getSequence() [2/3]

◆ getSequence() [3/3]

◆ 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(), setComments(), and bpp::AbstractValuesContainer::setComments().

◆ 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

◆ 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/6]

virtual const int& bpp::SequenceContainer::operator() ( const std::string &  sequenceName,
size_t  elementIndex 
) const
pure virtualinherited

Element access operator.

Allows direct access to the data stored in the container. This method is faster then the valueAt function, but input parameters are not checked!

Parameters
sequenceNameThe sequence name.
elementIndexThe element position within the sequence.

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

◆ operator()() [2/6]

virtual int& bpp::SequenceContainer::operator() ( const std::string &  sequenceName,
size_t  elementIndex 
)
pure virtualinherited

Element access operator.

Allows direct access to the data stored in the container. This method is faster then the valueAt function, but input parameters are not checked!

Parameters
sequenceNameThe sequence name.
elementIndexThe element position within the sequence.

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

◆ operator()() [3/6]

virtual const int& bpp::OrderedSequenceContainer::operator() ( size_t  sequenceIndex,
size_t  elementIndex 
) const
pure virtualinherited

Element access operator.

Allows direct access to the data stored in the container. This method is faster then the valueAt function, but input parameters are not checked!

Parameters
sequenceIndexThe sequence position.
elementIndexThe element position within the sequence.

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

◆ operator()() [4/6]

virtual int& bpp::OrderedSequenceContainer::operator() ( size_t  sequenceIndex,
size_t  elementIndex 
)
pure virtualinherited

Element access operator.

Allows direct access to the data stored in the container. This method is faster then the valueAt function, but input parameters are not checked!

Parameters
sequenceIndexThe sequence position.
elementIndexThe element position within the sequence.

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

◆ operator()() [5/6]

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

◆ operator()() [6/6]

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

◆ operator=() [1/2]

◆ operator=() [2/2]

AbstractSequenceContainer& bpp::AbstractSequenceContainer::operator= ( const SequenceContainer sc)
inline

◆ removeSequence() [1/3]

virtual std::shared_ptr<Sequence> bpp::SequenceContainer::removeSequence
inherited

Extract (and remove) a sequence from the container.

Parameters
nameThe name of the sequence.

Referenced by bpp::VectorSiteContainer::removeSequence(), bpp::VectorSequenceContainer::removeSequenceByKey(), and bpp::VectorSequenceContainer::removeSequenceByName().

◆ removeSequence() [2/3]

virtual std::shared_ptr<Sequence> bpp::SequenceContainer::removeSequence ( const std::string &  name)
pure virtualinherited

Extract (and remove) a sequence from the container.

Parameters
nameThe name of the sequence.

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

Referenced by bpp::SequenceApplicationTools::restrictSelectedSequencesByName().

◆ removeSequence() [3/3]

virtual std::shared_ptr<Sequence> bpp::OrderedSequenceContainer::removeSequence ( size_t  sequenceIndex)
pure virtualinherited

Extract (and remove) a sequence from the container.

Parameters
sequenceIndexThe position of the sequence.

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

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

◆ setComments() [1/4]

◆ setComments() [2/4]

void bpp::AbstractSequenceContainer::setComments ( const std::string &  name,
const Comments comments 
)
inlinevirtual

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.

Implements bpp::SequencedValuesContainer.

Definition at line 116 of file AbstractSequenceContainer.h.

References bpp::OrderedValuesContainer::getSequencePosition(), and bpp::OrderedSequenceContainer::setComments().

◆ setComments() [3/4]

virtual void bpp::AbstractSequenceContainer::setComments ( size_t  sequenceIndex,
const Comments comments 
)
pure virtual

◆ setComments() [4/4]

virtual void bpp::OrderedValuesContainer::setComments
inherited

Referenced by setComments().

◆ setGeneralComments() [1/2]

◆ setGeneralComments() [2/2]

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().

◆ setSequence() [1/3]

virtual void bpp::SequenceContainer::setSequence
inherited

Replace a sequence in the container.

Parameters
nameThe name of the sequence.
sequenceThe sequence to add.
checkNameTell if the container must check if the name of the sequence is already used in the container before adding it.

Referenced by bpp::VectorSiteContainer::setSequence(), bpp::VectorSequenceContainer::setSequence(), and bpp::AlignedSequenceContainer::setSequence().

◆ setSequence() [2/3]

virtual void bpp::SequenceContainer::setSequence ( const std::string &  name,
const Sequence sequence,
bool  checkName 
)
pure virtualinherited

Replace a sequence in the container.

Parameters
nameThe name of the sequence.
sequenceThe sequence to add.
checkNameTell if the container must check if the name of the sequence is already used in the container before adding it.

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

◆ setSequence() [3/3]

virtual void bpp::OrderedSequenceContainer::setSequence ( size_t  sequenceIndex,
const Sequence sequence,
bool  checkName 
)
pure virtualinherited

Replace a sequence in the container.

Parameters
sequenceIndexThe position of the sequence.
sequenceThe sequence to add.
checkNameTell if the container must check if the name of the sequence is already used in the container before adding it.

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

◆ 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().

◆ toString() [1/3]

std::string bpp::AbstractSequenceContainer::toString ( const std::string &  name) const
inlinevirtual

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.

Implements bpp::SequencedValuesContainer.

Definition at line 106 of file AbstractSequenceContainer.h.

References bpp::OrderedSequenceContainer::getSequence(), and bpp::CruxSymbolList::toString().

◆ toString() [2/3]

virtual std::string bpp::AbstractSequenceContainer::toString ( size_t  sequenceIndex) const
inlinevirtual

◆ toString() [3/3]

virtual std::string bpp::OrderedValuesContainer::toString
inherited

◆ valueAt() [1/4]

virtual const int& bpp::OrderedSequenceContainer::valueAt ( const std::string &  sequenceName,
size_t  elementIndex 
) const
pure virtualinherited

Element access function.

Allows direct access to the data stored in the container.

Parameters
sequenceNameThe sequence name.
elementIndexThe element position within the sequence.

Implements bpp::SequenceContainer.

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

◆ valueAt() [2/4]

virtual int& bpp::OrderedSequenceContainer::valueAt ( const std::string &  sequenceName,
size_t  elementIndex 
)
pure virtualinherited

Element access function.

Allows direct access to the data stored in the container.

Parameters
sequenceNameThe sequence name.
elementIndexThe element position within the sequence.

Implements bpp::SequenceContainer.

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

◆ valueAt() [3/4]

virtual const int& bpp::OrderedSequenceContainer::valueAt ( size_t  sequenceIndex,
size_t  elementIndex 
) const
pure virtualinherited

Element access operator.

Allows direct access to the data stored in the container.

Parameters
sequenceIndexThe sequence position.
elementIndexThe element position within the sequence.

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

◆ valueAt() [4/4]

virtual int& bpp::OrderedSequenceContainer::valueAt ( size_t  sequenceIndex,
size_t  elementIndex 
)
pure virtualinherited

Element access operator.

Allows direct access to the data stored in the container.

Parameters
sequenceIndexThe sequence position.
elementIndexThe element position within the sequence.

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

Member Data Documentation

◆ alphabet_

const Alphabet* bpp::AbstractValuesContainer::alphabet_
protectedinherited

◆ comments_

Comments bpp::Commentable::comments_
protectedinherited

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