bpp-seq3  3.0.0
bpp::TemplateSiteContainerInterface< SiteType, SequenceType, HashType > Class Template Referenceabstract

The SiteContainer interface. More...

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

+ Inheritance diagram for bpp::TemplateSiteContainerInterface< SiteType, SequenceType, HashType >:
+ Collaboration diagram for bpp::TemplateSiteContainerInterface< SiteType, SequenceType, HashType >:

Public Member Functions

 TemplateSiteContainerInterface ()
 
virtual ~TemplateSiteContainerInterface ()
 
TemplateSiteContainerInterface< SiteType, SequenceType, HashType > * clone () const override=0
 
TemplateSiteContainerInterface< SiteType, SequenceType, HashType > * createEmptyContainer () const override=0
 Return a copy of this container, but with no data inside. More...
 
virtual const SiteType & site (size_t sitePosition) const override=0
 Get a site from the container. More...
 
virtual void setSite (size_t sitePosition, std::unique_ptr< SiteType > &site, bool checkCoordinate=true)=0
 Set a site in the container. More...
 
virtual void addSite (std::unique_ptr< SiteType > &site, bool checkCoordinate)=0
 Add a site in the container. More...
 
virtual void addSite (std::unique_ptr< SiteType > &site, size_t sitePosition, bool checkCoordinate)=0
 Add a site in the container. More...
 
virtual std::unique_ptr< SiteType > removeSite (size_t sitePosition)=0
 Remove a site from the container. More...
 
virtual void deleteSite (size_t sitePosition)=0
 Delete a site from the container. More...
 
virtual void deleteSites (size_t sitePosition, size_t length) override=0
 Remove a continuous range of sites in the container. More...
 
virtual size_t getNumberOfSites () const override=0
 Get the number of aligned positions in the container. More...
 
virtual void reindexSites () override=0
 Set all coordinate attributes. More...
 
virtual Vint getSiteCoordinates () const=0
 Get all coordinates of sites. More...
 
virtual void setSiteCoordinates (const Vint &vCoordinates)=0
 Set all coordinates of sites. More...
 
virtual const Alphabetalphabet () const =0
 Get the container's alphabet. More...
 
virtual std::shared_ptr< const AlphabetgetAlphabet () const =0
 Get a pointer toward the container's alphabet. More...
 
virtual size_t getNumberOfSequences () const =0
 Get the number of sequences in the container. More...
 
virtual std::vector< HashType > getSequenceKeys () const =0
 
virtual void setSequenceKeys (const std::vector< HashType > &sequenceKeys)=0
 Reset all sequence keys. More...
 
virtual double getStateValueAt (size_t sitePosition, const HashType &sequenceKey, int state) const =0
 Get the value of a state at a given position. More...
 
virtual double getStateValueAt (size_t sitePosition, size_t sequencePosition, int state) const =0
 Get value of a state at a given position. More...
 
virtual double operator() (size_t sitePosition, const HashType &sequenceKey, int state) const =0
 Get the value of a state at a given position. More...
 
virtual double operator() (size_t sitePosition, size_t sequencePosition, int state) const =0
 Get the value of a state at a given position. More...
 
virtual void clear ()=0
 Delete all data in the container. More...
 
virtual bool hasSequence (const HashType &sequenceKey) const =0
 Check if a certain key is associated to a sequence in the container. More...
 
virtual const CommentsgetComments () const =0
 Get the comments. More...
 
virtual void setComments (const Comments &comments)=0
 Set the comments. More...
 
virtual void clearComments ()=0
 
Access by key
virtual const CoreSequenceInterfacesequence (const HashType &sequenceKey) const =0
 Retrieve a sequence object from the container. More...
 
virtual void deleteSequence (const HashType &sequenceKey)=0
 Remove and delete a sequence from the container. More...
 
Access by position
virtual const CoreSequenceInterfacesequence (size_t sequencePosition) const =0
 Retrieve a sequence object from the container. More...
 
virtual void deleteSequence (size_t sequencePosition)=0
 Remove and delete a sequence from the container. More...
 
Index management

Position to key and key to position.

virtual const HashType & sequenceKey (size_t sequencePosition) const =0
 Get the key associated to a given sequence. More...
 
virtual size_t getSequencePosition (const HashType &sequenceKey) const =0
 Get the position of a sequence with a given key in the container. More...
 
Access sequence names
virtual std::vector< std::string > getSequenceNames () const =0
 
virtual void setSequenceNames (const std::vector< std::string > &names, bool updateKeys)=0
 Batch-set all sequence names. More...
 
virtual std::vector< CommentsgetSequenceComments () const =0
 
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 const SequenceType & sequence (size_t sequencePosition) const override=0
 Retrieve a sequence object from the container. More...
 
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 std::unique_ptr< SequenceType > removeSequence (size_t sequencePosition)=0
 Remove a sequence from the container. More...
 
virtual const SequenceType::ElementType & valueAt (size_t sequencePosition, size_t sitePosition) const=0
 Get the content of the dataset at a specific position (sequence position, site position). More...
 
virtual SequenceType::ElementType & valueAt (size_t sequencePosition, size_t sitePosition)=0
 Get the content of the dataset at a specific position (sequence position, site position). More...
 
virtual void insertSequence (size_t sequencePosition, std::unique_ptr< SequenceType > &sequencePtr, const HashType &sequenceKey)=0
 Insert a sequence in the container. More...
 

Detailed Description

template<class SiteType, class SequenceType, class HashType>
class bpp::TemplateSiteContainerInterface< SiteType, SequenceType, HashType >

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.

Definition at line 26 of file SiteContainer.h.

Constructor & Destructor Documentation

◆ TemplateSiteContainerInterface()

template<class SiteType , class SequenceType , class HashType >
bpp::TemplateSiteContainerInterface< SiteType, SequenceType, HashType >::TemplateSiteContainerInterface ( )
inline

Definition at line 31 of file SiteContainer.h.

◆ ~TemplateSiteContainerInterface()

template<class SiteType , class SequenceType , class HashType >
virtual bpp::TemplateSiteContainerInterface< SiteType, SequenceType, HashType >::~TemplateSiteContainerInterface ( )
inlinevirtual

Definition at line 32 of file SiteContainer.h.

Member Function Documentation

◆ addSequence()

virtual void bpp::TemplateSequenceContainerInterface< SequenceType, HashType >::addSequence ( const HashType &  sequenceKey,
std::unique_ptr< SequenceType > &  sequencePtr 
)
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.

Parameters
sequenceKeyThe key to which the sequence is associated.
sequencePtrThe sequence to add.

◆ addSite() [1/2]

template<class SiteType , class SequenceType , class HashType >
virtual void bpp::TemplateSiteContainerInterface< SiteType, SequenceType, HashType >::addSite ( std::unique_ptr< SiteType > &  site,
bool  checkCoordinate 
)
pure virtual

Add a site in the container.

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

Implemented in bpp::TemplateVectorSiteContainer< SiteType, SequenceType >, bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >, and bpp::CompressedVectorSiteContainer.

Referenced by bpp::SiteContainerTools::getSelectedSites(), bpp::SiteContainerTools::merge(), and bpp::SiteContainerTools::sampleSites().

◆ addSite() [2/2]

template<class SiteType , class SequenceType , class HashType >
virtual void bpp::TemplateSiteContainerInterface< SiteType, SequenceType, HashType >::addSite ( std::unique_ptr< SiteType > &  site,
size_t  sitePosition,
bool  checkCoordinate 
)
pure virtual

Add a site in the container.

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

Implemented in bpp::TemplateVectorSiteContainer< SiteType, SequenceType >, bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >, and bpp::CompressedVectorSiteContainer.

◆ alphabet()

template<class HashType = std::string>
virtual const Alphabet& bpp::TemplateSequenceDataInterface< HashType >::alphabet ( ) const
pure virtualinherited

◆ clear()

◆ clearComments()

virtual void bpp::Commentable::clearComments ( )
pure virtualinherited

Implemented in bpp::SimpleCommentable.

◆ clone()

template<class SiteType , class SequenceType , class HashType >
TemplateSiteContainerInterface<SiteType, SequenceType, HashType>* bpp::TemplateSiteContainerInterface< SiteType, SequenceType, HashType >::clone ( ) const
overridepure virtual

◆ createEmptyContainer()

template<class SiteType , class SequenceType , class HashType >
TemplateSiteContainerInterface<SiteType, SequenceType, HashType>* bpp::TemplateSiteContainerInterface< SiteType, SequenceType, HashType >::createEmptyContainer ( ) const
overridepure virtual

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.

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

Implements bpp::TemplateSequenceContainerInterface< SequenceType, HashType >.

Implemented in bpp::TemplateVectorSiteContainer< SiteType, SequenceType >, bpp::CompressedVectorSiteContainer, and bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >.

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

◆ deleteSequence() [1/2]

template<class HashType = std::string>
virtual void bpp::TemplateSequenceDataInterface< HashType >::deleteSequence ( const HashType &  sequenceKey)
pure virtualinherited

Remove and delete a sequence from the container.

Parameters
sequenceKeyThe key to which the sequence is associated.

Implemented in bpp::TemplateVectorSiteContainer< SiteType, SequenceType >, bpp::TemplateVectorSequenceContainer< SequenceType >, and bpp::CompressedVectorSiteContainer.

◆ deleteSequence() [2/2]

template<class HashType = std::string>
virtual void bpp::TemplateSequenceDataInterface< HashType >::deleteSequence ( size_t  sequencePosition)
pure virtualinherited

Remove and delete a sequence from the container.

Parameters
sequencePositionThe position of the sequence.

Implemented in bpp::TemplateVectorSiteContainer< SiteType, SequenceType >, bpp::TemplateVectorSequenceContainer< SequenceType >, and bpp::CompressedVectorSiteContainer.

◆ deleteSite()

template<class SiteType , class SequenceType , class HashType >
virtual void bpp::TemplateSiteContainerInterface< SiteType, SequenceType, HashType >::deleteSite ( size_t  sitePosition)
pure virtual

Delete a site from the container.

The site is deleted (ie the container is shortened).

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

Implemented in bpp::TemplateVectorSiteContainer< SiteType, SequenceType >, bpp::CompressedVectorSiteContainer, and bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >.

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

◆ deleteSites()

template<class SiteType , class SequenceType , class HashType >
virtual void bpp::TemplateSiteContainerInterface< SiteType, SequenceType, HashType >::deleteSites ( size_t  sitePosition,
size_t  length 
)
overridepure virtual

Remove a continuous range of sites in the container.

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

Implements bpp::TemplateAlignmentDataInterface< HashType >.

Implemented in bpp::TemplateVectorSiteContainer< SiteType, SequenceType >, bpp::CompressedVectorSiteContainer, and bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >.

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

◆ getAlphabet()

template<class HashType = std::string>
virtual std::shared_ptr<const Alphabet> bpp::TemplateSequenceDataInterface< HashType >::getAlphabet ( ) const
pure virtualinherited

Get a pointer toward the container's alphabet.

Returns
A pointer toward the alphabet associated to this container.

Implemented in bpp::AbstractTemplateSequenceContainer< SequenceType, HashType >, bpp::AbstractTemplateSequenceContainer< SequenceType, std::string >, and bpp::AbstractTemplateSequenceContainer< Sequence, std::string >.

Referenced by bpp::Pasta::appendAlignmentFromStream(), bpp::Clustal::appendAlignmentFromStream(), bpp::DCSE::appendAlignmentFromStream(), bpp::GenBank::appendSequencesFromStream(), bpp::Fasta::appendSequencesFromStream(), bpp::Mase::appendSequencesFromStream(), bpp::SiteContainerTools::bootstrapSites(), 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::SiteContainerTools::getSelectedSites(), bpp::SiteContainerTools::getSequencePositions(), bpp::SiteContainerTools::getSitesWithoutGaps(), bpp::SiteContainerTools::getSitesWithoutStopCodon(), bpp::SiteContainerTools::merge(), bpp::SequenceContainerTools::mergeByKey(), bpp::AbstractTemplateSequenceContainer< SequenceType, HashType >::operator=(), bpp::Phylip::readInterleaved(), bpp::Phylip::readSequential(), bpp::SiteContainerTools::removeGapOnlySites(), bpp::SiteContainerTools::removeGapOrUnresolvedOnlySites(), bpp::SiteContainerTools::removeGapSites(), bpp::SiteContainerTools::removeSitesWithStopCodon(), bpp::SiteContainerTools::resolveDottedAlignment(), bpp::SiteContainerTools::sampleSites(), bpp::Phylip::writeInterleaved(), and bpp::Phylip::writeSequential().

◆ getComments()

◆ getNumberOfSequences()

template<class HashType = std::string>
virtual size_t bpp::TemplateSequenceDataInterface< HashType >::getNumberOfSequences ( ) const
pure virtualinherited

Get the number of sequences in the container.

Returns
The number of sequences in the container.

Implemented in bpp::TemplateVectorSiteContainer< SiteType, SequenceType >, bpp::TemplateVectorSequenceContainer< SequenceType >, and bpp::CompressedVectorSiteContainer.

Referenced by bpp::SequenceContainerTools::append(), bpp::SiteContainerTools::changeGapsToUnknownCharacters(), bpp::SiteContainerTools::changeUnresolvedCharactersToGaps(), bpp::SiteContainerTools::computeSimilarityMatrix(), bpp::SequenceContainerTools::convertAlphabet(), bpp::SequenceContainerTools::getCodonPosition(), bpp::SequenceContainerTools::getCounts(), bpp::SequenceContainerTools::getFrequencies(), bpp::SiteContainerTools::getSequencePositions(), bpp::SequenceApplicationTools::getSitesToAnalyse(), bpp::SiteContainerTools::getSitesWithoutStopCodon(), bpp::SequenceContainerTools::hasSequenceWithName(), bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::operator=(), bpp::TemplateVectorSequenceContainer< SequenceType >::operator=(), bpp::SiteContainerTools::removeGapOnlySites(), bpp::SiteContainerTools::removeGapOrUnresolvedOnlySites(), bpp::SiteContainerTools::removeGapSites(), bpp::SiteContainerTools::removeSitesWithStopCodon(), bpp::SiteContainerTools::resolveDottedAlignment(), bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::TemplateAlignedSequenceContainer(), bpp::TemplateVectorSequenceContainer< SequenceType >::TemplateVectorSequenceContainer(), bpp::Pasta::writeAlignment(), bpp::Clustal::writeAlignment(), bpp::Phylip::writeAlignment(), bpp::Stockholm::writeAlignment(), bpp::Phylip::writeInterleaved(), bpp::Pasta::writeSequences(), and bpp::Phylip::writeSequential().

◆ getNumberOfSites()

template<class SiteType , class SequenceType , class HashType >
virtual size_t bpp::TemplateSiteContainerInterface< SiteType, SequenceType, HashType >::getNumberOfSites ( ) const
overridepure virtual

◆ getSequenceComments()

template<class HashType = std::string>
virtual std::vector<Comments> bpp::TemplateSequenceDataInterface< HashType >::getSequenceComments ( ) const
pure virtualinherited

◆ getSequenceKeys()

◆ getSequenceNames()

◆ getSequencePosition()

template<class HashType = std::string>
virtual size_t bpp::TemplateSequenceDataInterface< HashType >::getSequencePosition ( const HashType &  sequenceKey) const
pure virtualinherited

Get the position of a sequence with a given key in the container.

Parameters
sequenceKeyThe key to which the sequence is associated.
Returns
The position of the sequence with name 'name', if it exists.

Implemented in bpp::TemplateVectorSiteContainer< SiteType, SequenceType >, bpp::TemplateVectorSequenceContainer< SequenceType >, and bpp::CompressedVectorSiteContainer.

◆ getSiteCoordinates()

virtual Vint bpp::TemplateAlignmentDataInterface< HashType >::getSiteCoordinates ( ) const
pure virtualinherited

Get all coordinates of sites.

Returns
A vector with all site coordinates.

◆ getStateValueAt() [1/2]

template<class HashType = std::string>
virtual double bpp::TemplateSequenceDataInterface< HashType >::getStateValueAt ( size_t  sitePosition,
const HashType &  sequenceKey,
int  state 
) const
pure virtualinherited

Get the value of a state at a given position.

Parameters
sitePositionindex of the site
sequenceKeykey of the sequence in the container
statestate in the alphabet

Implemented in bpp::TemplateVectorSiteContainer< SiteType, SequenceType >, bpp::TemplateVectorSequenceContainer< SequenceType >, and bpp::CompressedVectorSiteContainer.

◆ getStateValueAt() [2/2]

template<class HashType = std::string>
virtual double bpp::TemplateSequenceDataInterface< HashType >::getStateValueAt ( size_t  sitePosition,
size_t  sequencePosition,
int  state 
) const
pure virtualinherited

Get value of a state at a given position.

Parameters
sitePositionindex of the site
sequencePositionindex of the sequence in the container
statestate in the alphabet

Implemented in bpp::TemplateVectorSiteContainer< SiteType, SequenceType >, bpp::TemplateVectorSequenceContainer< SequenceType >, and bpp::CompressedVectorSiteContainer.

◆ hasSequence()

template<class HashType = std::string>
virtual bool bpp::TemplateSequenceDataInterface< HashType >::hasSequence ( const HashType &  sequenceKey) const
pure virtualinherited

Check if a certain key is associated to a sequence in the container.

Parameters
sequenceKeyThe key to which the sequence is associated.
Returns
True if the key was found in the contained.

Implemented in bpp::TemplateVectorSiteContainer< SiteType, SequenceType >, bpp::TemplateVectorSequenceContainer< SequenceType >, and bpp::CompressedVectorSiteContainer.

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

◆ insertSequence()

virtual void bpp::TemplateSequenceContainerInterface< SequenceType, HashType >::insertSequence ( size_t  sequencePosition,
std::unique_ptr< SequenceType > &  sequencePtr,
const HashType &  sequenceKey 
)
pure virtualinherited

Insert a sequence in the container.

Parameters
sequencePositionThe position of the sequence.
sequencePtrThe sequence to add.
sequenceKeyThe new key of the sequence.

◆ operator()() [1/2]

template<class HashType = std::string>
virtual double bpp::TemplateSequenceDataInterface< HashType >::operator() ( size_t  sitePosition,
const HashType &  sequenceKey,
int  state 
) const
pure virtualinherited

Get the value of a state at a given position.

Same as getValueAt.

Parameters
sitePositionindex of the site
sequenceKeykey of the sequence in the container
statestate in the alphabet

Implemented in bpp::TemplateVectorSiteContainer< SiteType, SequenceType >, bpp::TemplateVectorSequenceContainer< SequenceType >, and bpp::CompressedVectorSiteContainer.

◆ operator()() [2/2]

template<class HashType = std::string>
virtual double bpp::TemplateSequenceDataInterface< HashType >::operator() ( size_t  sitePosition,
size_t  sequencePosition,
int  state 
) const
pure virtualinherited

Get the value of a state at a given position.

Same as getValueAt.

Parameters
sitePositionindex of the site
sequencePositionindex of the sequence in the container
statestate in the alphabet

Implemented in bpp::TemplateVectorSiteContainer< SiteType, SequenceType >, bpp::TemplateVectorSequenceContainer< SequenceType >, and bpp::CompressedVectorSiteContainer.

◆ reindexSites()

template<class SiteType , class SequenceType , class HashType >
virtual void bpp::TemplateSiteContainerInterface< SiteType, SequenceType, HashType >::reindexSites ( )
overridepure virtual

◆ removeSequence() [1/2]

virtual std::unique_ptr<SequenceType> bpp::TemplateSequenceContainerInterface< SequenceType, HashType >::removeSequence ( const HashType &  sequenceKey)
pure virtualinherited

Remove a sequence from the container.

Parameters
sequenceKeyThe key to which the sequence is associated.

◆ removeSequence() [2/2]

virtual std::unique_ptr<SequenceType> bpp::TemplateSequenceContainerInterface< SequenceType, HashType >::removeSequence ( size_t  sequencePosition)
pure virtualinherited

Remove a sequence from the container.

Parameters
sequencePositionThe position of the sequence.

◆ removeSite()

template<class SiteType , class SequenceType , class HashType >
virtual std::unique_ptr<SiteType> bpp::TemplateSiteContainerInterface< SiteType, SequenceType, HashType >::removeSite ( size_t  sitePosition)
pure virtual

Remove a site from the container.

The site is deleted (ie the container is shortened) and a pointer toward it is returned.

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

Implemented in bpp::TemplateVectorSiteContainer< SiteType, SequenceType >, bpp::CompressedVectorSiteContainer, and bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >.

◆ sequence() [1/4]

template<class HashType = std::string>
virtual const CoreSequenceInterface& bpp::TemplateSequenceDataInterface< HashType >::sequence ( const HashType &  sequenceKey) const
pure virtualinherited

Retrieve a sequence object from the container.

Parameters
sequenceKeyThe key to which the sequence is associated.
Returns
A reference toward the Sequence with corresponding name.

Implemented in bpp::TemplateSequenceContainerInterface< SequenceType, std::string >, bpp::TemplateVectorSiteContainer< SiteType, SequenceType >, bpp::TemplateVectorSequenceContainer< SequenceType >, bpp::CompressedVectorSiteContainer, and bpp::TemplateSequenceContainerInterface< SequenceType, HashType >.

◆ sequence() [2/4]

virtual const SequenceType& bpp::TemplateSequenceContainerInterface< SequenceType, HashType >::sequence ( const HashType &  sequenceKey) const
overridepure virtualinherited

Retrieve a sequence object from the container.

Parameters
sequenceKeyThe key to which the sequence is associated.
Returns
A reference toward the Sequence with corresponding name.

Implements bpp::TemplateSequenceDataInterface< HashType >.

◆ sequence() [3/4]

template<class HashType = std::string>
virtual const CoreSequenceInterface& bpp::TemplateSequenceDataInterface< HashType >::sequence ( size_t  sequencePosition) const
pure virtualinherited

◆ sequence() [4/4]

virtual const SequenceType& bpp::TemplateSequenceContainerInterface< SequenceType, HashType >::sequence ( size_t  sequencePosition) const
overridepure virtualinherited

Retrieve a sequence object from the container.

Parameters
sequencePositionThe position of the sequence.
Returns
A reference toward the Sequence object with corresponding name.

Implements bpp::TemplateSequenceDataInterface< HashType >.

◆ sequenceKey()

template<class HashType = std::string>
virtual const HashType& bpp::TemplateSequenceDataInterface< HashType >::sequenceKey ( size_t  sequencePosition) const
pure virtualinherited

Get the key associated to a given sequence.

Parameters
sequencePositionThe position of the sequence in the container.
Returns
The key to which the sequence is associated.

Implemented in bpp::TemplateVectorSiteContainer< SiteType, SequenceType >, bpp::TemplateVectorSequenceContainer< SequenceType >, and bpp::CompressedVectorSiteContainer.

Referenced by bpp::TemplateVectorSequenceContainer< SequenceType >::operator=(), and bpp::TemplateVectorSequenceContainer< SequenceType >::TemplateVectorSequenceContainer().

◆ setComments()

virtual void bpp::Commentable::setComments ( const Comments comments)
pure virtualinherited

◆ setSequence() [1/3]

virtual void bpp::TemplateSequenceContainerInterface< SequenceType, HashType >::setSequence ( const HashType &  sequenceKey,
std::unique_ptr< SequenceType > &  sequencePtr 
)
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.

Parameters
sequenceKeyThe key to which the sequence is associated.
sequencePtrThe sequence to set.

◆ setSequence() [2/3]

virtual void bpp::TemplateSequenceContainerInterface< SequenceType, HashType >::setSequence ( size_t  sequencePosition,
std::unique_ptr< SequenceType > &  sequencePtr 
)
pure virtualinherited

Replace a sequence in the container.

The original key associated to the sequence will be kept.

Parameters
sequencePositionThe position of the sequence.
sequencePtrThe sequence to add.

◆ setSequence() [3/3]

virtual void bpp::TemplateSequenceContainerInterface< SequenceType, HashType >::setSequence ( size_t  sequencePosition,
std::unique_ptr< SequenceType > &  sequencePtr,
const HashType &  sequenceKey 
)
pure virtualinherited

Replace a sequence in the container.

The original key associated to the sequence will be kept.

Parameters
sequencePositionThe position of the sequence.
sequencePtrThe sequence to add.
sequenceKeyThe new key of the sequence.

◆ setSequenceKeys()

template<class HashType = std::string>
virtual void bpp::TemplateSequenceDataInterface< HashType >::setSequenceKeys ( const std::vector< HashType > &  sequenceKeys)
pure virtualinherited

◆ setSequenceNames()

template<class HashType = std::string>
virtual void bpp::TemplateSequenceDataInterface< HashType >::setSequenceNames ( const std::vector< std::string > &  names,
bool  updateKeys 
)
pure virtualinherited

Batch-set all sequence names.

Parameters
namesA vector of sequence names. Must be the same size as the number of sequences in the container, otherwise a DimensionException is thrown.
updateKeysTell whether the keys of the sequences should be updated with the new sequence names.

Implemented in bpp::TemplateVectorSiteContainer< SiteType, SequenceType >, bpp::TemplateVectorSequenceContainer< SequenceType >, and bpp::CompressedVectorSiteContainer.

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

◆ setSite()

template<class SiteType , class SequenceType , class HashType >
virtual void bpp::TemplateSiteContainerInterface< SiteType, SequenceType, HashType >::setSite ( size_t  sitePosition,
std::unique_ptr< SiteType > &  site,
bool  checkCoordinate = true 
)
pure virtual

Set a site in the container.

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

Implemented in bpp::TemplateVectorSiteContainer< SiteType, SequenceType >, bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >, and bpp::CompressedVectorSiteContainer.

Referenced by bpp::SiteContainerTools::changeGapsToUnknownCharacters(), and bpp::SiteContainerTools::changeUnresolvedCharactersToGaps().

◆ setSiteCoordinates()

virtual void bpp::TemplateAlignmentDataInterface< HashType >::setSiteCoordinates ( const Vint vCoordinates)
pure virtualinherited

Set all coordinates of sites.

Parameters
vCoordinatesA vector with all site coordinates.

◆ site()

template<class SiteType , class SequenceType , class HashType >
virtual const SiteType& bpp::TemplateSiteContainerInterface< SiteType, SequenceType, HashType >::site ( size_t  sitePosition) const
overridepure virtual

◆ valueAt() [1/4]

virtual const SequenceType::ElementType& bpp::TemplateSequenceContainerInterface< SequenceType, HashType >::valueAt ( const HashType &  sequenceKey,
size_t  sitePosition 
) const
pure virtualinherited

Get the content of the dataset at a specific position (sequence key, site position).

Parameters
sequenceKeykey of the sequence in the container
sitePositionindex of the site
Returns
The element at the given position.

◆ valueAt() [2/4]

virtual SequenceType::ElementType& bpp::TemplateSequenceContainerInterface< SequenceType, HashType >::valueAt ( const HashType &  sequenceKey,
size_t  sitePosition 
)
pure virtualinherited

Get the content of the dataset at a specific position (sequence key, site position).

Parameters
sequenceKeykey of the sequence in the container
sitePositionindex of the site
Returns
The element at the given position.

◆ valueAt() [3/4]

virtual const SequenceType::ElementType& bpp::TemplateSequenceContainerInterface< SequenceType, HashType >::valueAt ( size_t  sequencePosition,
size_t  sitePosition 
) const
pure virtualinherited

Get the content of the dataset at a specific position (sequence position, site position).

Parameters
sequencePositionindex of the sequence in the container
sitePositionindex of the site
Returns
The element at the given position.

◆ valueAt() [4/4]

virtual SequenceType::ElementType& bpp::TemplateSequenceContainerInterface< SequenceType, HashType >::valueAt ( size_t  sequencePosition,
size_t  sitePosition 
)
pure virtualinherited

Get the content of the dataset at a specific position (sequence position, site position).

Parameters
sequencePositionindex of the sequence in the container
sitePositionindex of the site
Returns
The element at the given position.

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