bpp-seq  2.2.0
bpp::SiteContainer Class Referenceabstract

The SiteContainer interface. More...

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

+ Inheritance diagram for bpp::SiteContainer:
+ Collaboration diagram for bpp::SiteContainer:

Public Member Functions

 SiteContainer ()
 
virtual ~SiteContainer ()
 
SiteContainerclone () const =0
 
virtual const SitegetSite (size_t siteIndex) const =0 throw (IndexOutOfBoundsException)
 Get a site from the container. More...
 
virtual void setSite (size_t siteIndex, const Site &site, bool checkPosition)=0 throw (Exception)
 Set a site in the container. More...
 
virtual void addSite (const Site &site, bool checkPosition)=0 throw (Exception)
 Add a site in the container. More...
 
virtual void addSite (const Site &site, int position, bool checkPosition)=0 throw (Exception)
 Add a site in the container. More...
 
virtual void addSite (const Site &site, size_t siteIndex, bool checkPosition)=0 throw (Exception)
 Add a site in the container. More...
 
virtual void addSite (const Site &site, size_t siteIndex, int position, bool checkPosition)=0 throw (Exception)
 Add a site in the container. More...
 
virtual SiteremoveSite (size_t siteIndex)=0 throw (IndexOutOfBoundsException, Exception)
 Remove a site from the container. More...
 
virtual void deleteSite (size_t siteIndex)=0 throw (IndexOutOfBoundsException, Exception)
 Delete a site in the container. More...
 
virtual void deleteSites (size_t siteIndex, size_t length)=0 throw (IndexOutOfBoundsException, Exception)
 Delete a continuous range of sites in the container. More...
 
virtual size_t getNumberOfSites () const =0
 Get the number of sites 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 const std::vector< int > & getContent (size_t sequenceIndex) const =0 throw (IndexOutOfBoundsException)
 Get the content of a sequence. More...
 
virtual std::string toString (size_t sequenceIndex) const =0 throw (IndexOutOfBoundsException)
 Convert a particular sequence to a string. More...
 
virtual const SequencegetSequence (size_t sequenceIndex) const =0 throw (IndexOutOfBoundsException)
 Retrieve a sequence object from the container. More...
 
virtual void setSequence (size_t sequenceIndex, const Sequence &sequence, bool checkName)=0 throw (Exception)
 Replace a sequence in the container. More...
 
virtual SequenceremoveSequence (size_t sequenceIndex)=0 throw (IndexOutOfBoundsException, Exception)
 Extract (and remove) a sequence from the container. More...
 
virtual void deleteSequence (size_t sequenceIndex)=0 throw (IndexOutOfBoundsException, Exception)
 Delete a sequence of the container. More...
 
virtual const std::string & getName (size_t sequenceIndex) const =0 throw (IndexOutOfBoundsException)
 Get the name of a particular sequence. More...
 
virtual const CommentsgetComments (size_t sequenceIndex) const =0 throw (IndexOutOfBoundsException)
 Get comments of a particular sequence. More...
 
virtual void setComments (size_t sequenceIndex, const Comments &comments)=0 throw (IndexOutOfBoundsException)
 Set the comments of a particular sequence. More...
 
virtual size_t getSequencePosition (const std::string &name) const =0 throw (SequenceNotFoundException)
 Get the position of a sequence in sequence container from its name. More...
 
virtual const AlphabetgetAlphabet () const =0
 Get sequence 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 void addSequence (const Sequence &sequence, bool checkName)=0 throw (Exception)
 Add a sequence to the container. 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 sequences in the container. More...
 
virtual SequenceContainercreateEmptyContainer () const =0
 Return a copy of this container, but with no sequence inside. More...
 
SequenceContainer methods.
virtual const std::vector< int > & getContent (const std::string &name) const =0 throw (SequenceNotFoundException)
 Get the content of a sequence. More...
 
virtual std::string toString (const std::string &name) const =0 throw (SequenceNotFoundException)
 Convert a particular sequence to a string. More...
 
virtual const SequencegetSequence (const std::string &name) const =0 throw (SequenceNotFoundException)
 Retrieve a sequence object from the container. More...
 
virtual void setSequence (const std::string &name, const Sequence &sequence, bool checkName)=0 throw (Exception)
 Replace a sequence in the container. More...
 
virtual SequenceremoveSequence (const std::string &name)=0 throw (SequenceNotFoundException, Exception)
 Extract (and remove) a sequence from the container. More...
 
virtual void deleteSequence (const std::string &name)=0 throw (SequenceNotFoundException, Exception)
 Delete a sequence of the container. More...
 
virtual const CommentsgetComments (const std::string &name) const =0 throw (SequenceNotFoundException)
 Get comments of a particular sequence. More...
 
virtual void setComments (const std::string &name, const Comments &comments)=0 throw (SequenceNotFoundException)
 Set the comments of a particular sequence. More...
 
virtual size_t getNumberOfSequences () const =0
 Get the number of sequences in the container. More...
 
virtual std::vector< std::string > getSequencesNames () const =0
 Get all the names of the sequences in the container. More...
 
virtual void setSequencesNames (const std::vector< std::string > &names, bool checkNames)=0 throw (Exception)
 Set all sequence names. 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 & valueAt (const std::string &sequenceName, size_t elementIndex)=0 throw (SequenceNotFoundException, IndexOutOfBoundsException)
 Element access function. More...
 
virtual const int & valueAt (const std::string &sequenceName, size_t elementIndex) const =0 throw (SequenceNotFoundException, IndexOutOfBoundsException)
 Element access function. More...
 
virtual int & valueAt (size_t sequenceIndex, size_t elementIndex)=0 throw (IndexOutOfBoundsException)
 Element access operator. More...
 
virtual const int & valueAt (size_t sequenceIndex, size_t elementIndex) const =0 throw (IndexOutOfBoundsException)
 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...
 

Detailed Description

The SiteContainer interface.

Container implementing the SiteContainer interface deal with aligned sequences. This interface provides methods to retrieve, add or set sites in the alignment. As for SequenceContainers, the maintenance of Sites is up to the container. All site objects are cloned befored being added and retrieved. All sites stored are deleted in the destructor of the container or after having called the deleteSite() method.

Definition at line 63 of file SiteContainer.h.

Constructor & Destructor Documentation

◆ SiteContainer()

bpp::SiteContainer::SiteContainer ( )
inline

Definition at line 67 of file SiteContainer.h.

◆ ~SiteContainer()

virtual bpp::SiteContainer::~SiteContainer ( )
inlinevirtual

Definition at line 68 of file SiteContainer.h.

Member Function Documentation

◆ addSequence()

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

Add a sequence to the container.

Parameters
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.
Exceptions
ExceptionAny other kind of exception, if the name of the sequence is already used, are whatever else depending on the implementation.

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

Referenced by bpp::SequenceContainerTools::append(), and bpp::NexusIOSequence::appendAlignmentFromStream().

◆ addSite() [1/4]

virtual void bpp::SiteContainer::addSite ( const Site site,
bool  checkPosition 
)
throw (Exception
)
pure virtual

Add a site in the container.

Parameters
siteThe site to add.
checkPositionLook if the position of the new site match a position attribute in the container.
Exceptions
ExceptionIf the specified site does not exists or is not correct.

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

Referenced by bpp::SiteContainerTools::merge().

◆ addSite() [2/4]

virtual void bpp::SiteContainer::addSite ( const Site site,
int  position,
bool  checkPosition 
)
throw (Exception
)
pure virtual

Add a site in the container.

Parameters
siteThe site to add.
positionThe new position of the site, to superseed the one in 'site'.
checkPositionLook if the position of the new site match a position attribute in the container.
Exceptions
ExceptionIf the specified site does not exists or is not correct.

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

◆ addSite() [3/4]

virtual void bpp::SiteContainer::addSite ( const Site site,
size_t  siteIndex,
bool  checkPosition 
)
throw (Exception
)
pure virtual

Add a site in the container.

Parameters
siteThe site to add.
siteIndexThe position where to insert the site.
checkPositionLook if the position of the new site match a position attribute in the container.
Exceptions
ExceptionIf the specified site does not exists or is not correct.

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

◆ addSite() [4/4]

virtual void bpp::SiteContainer::addSite ( const Site site,
size_t  siteIndex,
int  position,
bool  checkPosition 
)
throw (Exception
)
pure virtual

Add a site in the container.

Parameters
siteThe site to add.
siteIndexThe position where to insert the site.
positionThe new position of the site, to superseed the one in 'site'.
checkPositionLook if the position of the new site match a position attribute in the container.
Exceptions
ExceptionIf the specified site does not exists or is not correct.

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

◆ clear()

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

◆ clone()

SiteContainer* bpp::SiteContainer::clone ( ) const
pure virtual

◆ createEmptyContainer()

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

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

This method creates a new SequenceContainer 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::CompressedVectorSiteContainer, bpp::VectorSequenceContainer, bpp::VectorSiteContainer, bpp::MapSequenceContainer, and bpp::AlignedSequenceContainer.

◆ deleteGeneralComments()

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

Delete the comments associated to this container.

Implemented in bpp::AbstractSequenceContainer.

◆ deleteSequence() [1/2]

virtual void bpp::OrderedSequenceContainer::deleteSequence ( size_t  sequenceIndex)
throw (IndexOutOfBoundsException,
Exception
)
pure virtualinherited

Delete a sequence of the container.

Parameters
sequenceIndexThe position of the sequence.
Exceptions
IndexOutOfBoundsExceptionIf the position does not match any sequence in the container.

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

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

◆ deleteSequence() [2/2]

virtual void bpp::OrderedSequenceContainer::deleteSequence ( const std::string &  name)
throw (SequenceNotFoundException,
Exception
)
pure virtualinherited

Delete a sequence of the container.

Parameters
nameThe name of the sequence.
Exceptions
SequenceNotFoundExceptionIf the name does not match any sequence in the container.

Implements bpp::SequenceContainer.

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

◆ deleteSite()

virtual void bpp::SiteContainer::deleteSite ( size_t  siteIndex)
throw (IndexOutOfBoundsException,
Exception
)
pure virtual

Delete a site in the container.

Parameters
siteIndexThe position of the site in the container.
Exceptions
IndexOutOfBoundsExceptionIf the specified site does not exists.

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

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

◆ deleteSites()

virtual void bpp::SiteContainer::deleteSites ( size_t  siteIndex,
size_t  length 
)
throw (IndexOutOfBoundsException,
Exception
)
pure virtual

Delete 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::AlignedSequenceContainer, bpp::CompressedVectorSiteContainer, and bpp::VectorSiteContainer.

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

◆ getAlphabet()

◆ getComments() [1/2]

virtual const Comments& bpp::OrderedSequenceContainer::getComments ( size_t  sequenceIndex) const
throw (IndexOutOfBoundsException
)
pure virtualinherited

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.

Implemented in bpp::AbstractSequenceContainer.

Referenced by bpp::CompressedVectorSiteContainer::CompressedVectorSiteContainer(), bpp::VectorSiteContainer::operator=(), bpp::CompressedVectorSiteContainer::operator=(), and bpp::VectorSiteContainer::VectorSiteContainer().

◆ getComments() [2/2]

virtual const Comments& bpp::OrderedSequenceContainer::getComments ( const std::string &  name) const
throw (SequenceNotFoundException
)
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.

Implements bpp::SequenceContainer.

Implemented in bpp::AbstractSequenceContainer.

◆ getContent() [1/2]

virtual const std::vector<int>& bpp::OrderedSequenceContainer::getContent ( size_t  sequenceIndex) const
throw (IndexOutOfBoundsException
)
pure virtualinherited

Get the content of a sequence.

Parameters
sequenceIndexThe position of the sequence.
Returns
The content of the sequence as a vector of integers.
Exceptions
IndexOutOfBoundsExceptionIf the position does not match any sequence in the container.

Implemented in bpp::AbstractSequenceContainer.

◆ getContent() [2/2]

virtual const std::vector<int>& bpp::OrderedSequenceContainer::getContent ( const std::string &  name) const
throw (SequenceNotFoundException
)
pure virtualinherited

Get the content of a sequence.

Parameters
nameThe name of the sequence.
Returns
The content of the sequence as a vector of integers.
Exceptions
SequenceNotFoundExceptionIf the name does not match any sequence in the container.

Implements bpp::SequenceContainer.

Implemented in bpp::AbstractSequenceContainer.

◆ getGeneralComments()

virtual const Comments& bpp::SequenceContainer::getGeneralComments ( ) const
pure virtualinherited

Get the comments of this container.

Returns
The comments associated to this container.

Implemented in bpp::AbstractSequenceContainer.

Referenced by bpp::SiteContainerTools::getSelectedSites(), bpp::AbstractSequenceContainer::operator=(), and bpp::VectorSequenceContainer::VectorSequenceContainer().

◆ getName()

virtual const std::string& bpp::OrderedSequenceContainer::getName ( size_t  sequenceIndex) const
throw (IndexOutOfBoundsException
)
pure virtualinherited

Get the name of a particular 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::AbstractSequenceContainer.

◆ getNumberOfSequences()

◆ getNumberOfSites()

◆ getSequence() [1/2]

◆ getSequence() [2/2]

virtual const Sequence& bpp::OrderedSequenceContainer::getSequence ( const std::string &  name) const
throw (SequenceNotFoundException
)
pure virtualinherited

Retrieve a sequence object from the container.

Parameters
nameThe name of the sequence.
Returns
A reference toward the Sequence with corresponding name.
Exceptions
SequenceNotFoundExceptionIf the name does not match any sequence in the container.

Implements bpp::SequenceContainer.

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

◆ getSequencePosition()

virtual size_t bpp::OrderedSequenceContainer::getSequencePosition ( const std::string &  name) const
throw (SequenceNotFoundException
)
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::VectorSequenceContainer, bpp::MapSequenceContainer, bpp::CompressedVectorSiteContainer, and bpp::VectorSiteContainer.

◆ getSequencesNames()

◆ getSite()

◆ getSitePositions()

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

Get all position attributes of sites.

Returns
A vector with all site positions.

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

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

◆ hasSequence()

virtual bool bpp::SequenceContainer::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::CompressedVectorSiteContainer, bpp::VectorSequenceContainer, bpp::VectorSiteContainer, and bpp::MapSequenceContainer.

◆ operator()() [1/4]

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::CompressedVectorSiteContainer, bpp::VectorSequenceContainer, bpp::VectorSiteContainer, and bpp::MapSequenceContainer.

◆ operator()() [2/4]

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::CompressedVectorSiteContainer, bpp::VectorSequenceContainer, bpp::VectorSiteContainer, and bpp::MapSequenceContainer.

◆ operator()() [3/4]

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::CompressedVectorSiteContainer, bpp::VectorSequenceContainer, bpp::VectorSiteContainer, and bpp::MapSequenceContainer.

◆ operator()() [4/4]

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::CompressedVectorSiteContainer, bpp::VectorSequenceContainer, bpp::VectorSiteContainer, and bpp::MapSequenceContainer.

◆ reindexSites()

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

◆ removeSequence() [1/2]

virtual Sequence* bpp::OrderedSequenceContainer::removeSequence ( size_t  sequenceIndex)
throw (IndexOutOfBoundsException,
Exception
)
pure virtualinherited

Extract (and remove) a sequence from the container.

Parameters
sequenceIndexThe position of the sequence.
Exceptions
IndexOutOfBoundsExceptionIf the name does not match any sequence in the container.

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

◆ removeSequence() [2/2]

virtual Sequence* bpp::OrderedSequenceContainer::removeSequence ( const std::string &  name)
throw (SequenceNotFoundException,
Exception
)
pure virtualinherited

Extract (and remove) a sequence from the container.

Parameters
nameThe name of the sequence.
Exceptions
SequenceNotFoundExceptionIf the name does not match any sequence in the container.

Implements bpp::SequenceContainer.

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

◆ removeSite()

virtual Site* bpp::SiteContainer::removeSite ( size_t  siteIndex)
throw (IndexOutOfBoundsException,
Exception
)
pure virtual

Remove a site from the container.

The site is not deleted, a pointer toward it is returned.

Parameters
siteIndexThe position of the site in the container.
Returns
A pointer toward site i in the alignment.
Exceptions
IndexOutOfBoundsExceptionIf the specified site does not exists.

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

◆ setComments() [1/2]

virtual void bpp::OrderedSequenceContainer::setComments ( size_t  sequenceIndex,
const Comments comments 
)
throw (IndexOutOfBoundsException
)
pure virtualinherited

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.

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

◆ setComments() [2/2]

virtual void bpp::OrderedSequenceContainer::setComments ( const std::string &  name,
const Comments comments 
)
throw (SequenceNotFoundException
)
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.

Implements bpp::SequenceContainer.

Implemented in bpp::VectorSequenceContainer, and bpp::AbstractSequenceContainer.

◆ setGeneralComments()

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

Set the comments of this container.

Parameters
commentsThe comments to be associated to this container.

Implemented in bpp::AbstractSequenceContainer.

◆ setSequence() [1/2]

virtual void bpp::OrderedSequenceContainer::setSequence ( size_t  sequenceIndex,
const Sequence sequence,
bool  checkName 
)
throw (Exception
)
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.
Exceptions
IndexOutOfBoundsExceptionIf the position does not match any sequence in the container.
ExceptionAny other kind of exception.

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

◆ setSequence() [2/2]

virtual void bpp::OrderedSequenceContainer::setSequence ( const std::string &  name,
const Sequence sequence,
bool  checkName 
)
throw (Exception
)
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.
Exceptions
SequenceNotFoundExceptionIf the name does not match any sequence in the container.
ExceptionAny other kind of exception, if the name of the sequence is already used, are whatever else depending on the implementation.

Implements bpp::SequenceContainer.

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

◆ setSequencesNames()

virtual void bpp::OrderedSequenceContainer::setSequencesNames ( const std::vector< std::string > &  names,
bool  checkNames 
)
throw (Exception
)
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.

Implements bpp::SequenceContainer.

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

◆ setSite()

virtual void bpp::SiteContainer::setSite ( size_t  siteIndex,
const Site site,
bool  checkPosition 
)
throw (Exception
)
pure virtual

Set a site in the container.

Parameters
siteIndexThe position of the site in the container.
siteThe site to set.
checkPositionLook if the position of the new site match a position attribute in the container.
Exceptions
ExceptionIf the specified site does not exists or is not correct.

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

◆ toString() [1/2]

virtual std::string bpp::OrderedSequenceContainer::toString ( size_t  sequenceIndex) const
throw (IndexOutOfBoundsException
)
pure virtualinherited

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.

Implemented in bpp::AbstractSequenceContainer.

◆ toString() [2/2]

virtual std::string bpp::OrderedSequenceContainer::toString ( const std::string &  name) const
throw (SequenceNotFoundException
)
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.

Implements bpp::SequenceContainer.

Implemented in bpp::AbstractSequenceContainer.

◆ valueAt() [1/4]

virtual int& bpp::OrderedSequenceContainer::valueAt ( const std::string &  sequenceName,
size_t  elementIndex 
)
throw (SequenceNotFoundException,
IndexOutOfBoundsException
)
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.
Exceptions
SequenceNotFoundExceptionIf no corresponding sequence is found in the container.
IndexOutOfBoundsExceptionIf the element position is not valid.

Implements bpp::SequenceContainer.

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

◆ valueAt() [2/4]

virtual const int& bpp::OrderedSequenceContainer::valueAt ( const std::string &  sequenceName,
size_t  elementIndex 
) const
throw (SequenceNotFoundException,
IndexOutOfBoundsException
)
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.
Exceptions
SequenceNotFoundExceptionIf no corresponding sequence is found in the container.
IndexOutOfBoundsExceptionIf the element position is not valid.

Implements bpp::SequenceContainer.

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

◆ valueAt() [3/4]

virtual int& bpp::OrderedSequenceContainer::valueAt ( size_t  sequenceIndex,
size_t  elementIndex 
)
throw (IndexOutOfBoundsException
)
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.
Exceptions
IndexOutOfBoundsExceptionIf a position is not valid.

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

◆ valueAt() [4/4]

virtual const int& bpp::OrderedSequenceContainer::valueAt ( size_t  sequenceIndex,
size_t  elementIndex 
) const
throw (IndexOutOfBoundsException
)
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.
Exceptions
IndexOutOfBoundsExceptionIf a position is not valid.

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


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