bpp-seq3  3.0.0
bpp::TemplateAlignmentDataInterface< HashType > Class Template Referenceabstract

The Container of Aligned Values interface. More...

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

+ Inheritance diagram for bpp::TemplateAlignmentDataInterface< HashType >:
+ Collaboration diagram for bpp::TemplateAlignmentDataInterface< HashType >:

Public Member Functions

 TemplateAlignmentDataInterface ()
 
virtual ~TemplateAlignmentDataInterface ()
 
TemplateAlignmentDataInterfaceclone () const override=0
 
virtual const CoreSiteInterfacesite (size_t siteIndex) const =0
 Get a site from a given position. More...
 
virtual void deleteSites (size_t siteIndex, size_t length)=0
 Remove a continuous range of sites in the container. More...
 
virtual size_t getNumberOfSites () const =0
 Get the number of aligned positions in the container. More...
 
virtual void reindexSites ()=0
 Set all positions attributes. More...
 
virtual Vint 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< std::string > getSequenceKeys () const=0
 
virtual void setSequenceKeys (const std::vector< std::string > &sequenceKeys)=0
 Reset all sequence keys. More...
 
virtual double getStateValueAt (size_t sitePosition, const std::string &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 std::string &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 TemplateSequenceDataInterface< std::string > * createEmptyContainer () const=0
 Return a copy of this container, but with no data inside. More...
 
virtual bool hasSequence (const std::string &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 std::string &sequenceKey) const=0
 Retrieve a sequence object from the container. More...
 
virtual void deleteSequence (const std::string &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 std::string & sequenceKey (size_t sequencePosition) const=0
 Get the key associated to a given sequence. More...
 
virtual size_t getSequencePosition (const std::string &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
 

Detailed Description

template<class HashType = std::string>
class bpp::TemplateAlignmentDataInterface< HashType >

The Container of Aligned Values interface.

Container implementing the AlignedValuesContainer interface deal with aligned data.

Definition at line 24 of file AlignmentData.h.

Constructor & Destructor Documentation

◆ TemplateAlignmentDataInterface()

template<class HashType = std::string>
bpp::TemplateAlignmentDataInterface< HashType >::TemplateAlignmentDataInterface ( )
inline

Definition at line 28 of file AlignmentData.h.

◆ ~TemplateAlignmentDataInterface()

template<class HashType = std::string>
virtual bpp::TemplateAlignmentDataInterface< HashType >::~TemplateAlignmentDataInterface ( )
inlinevirtual

Definition at line 29 of file AlignmentData.h.

Member Function Documentation

◆ alphabet()

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

◆ clear()

◆ clearComments()

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

Implemented in bpp::SimpleCommentable.

◆ clone()

◆ createEmptyContainer()

virtual TemplateSequenceDataInterface<std::string >* bpp::TemplateSequenceDataInterface< std::string >::createEmptyContainer ( ) const
pure virtualinherited

◆ deleteSequence() [1/2]

virtual void bpp::TemplateSequenceDataInterface< std::string >::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]

virtual void bpp::TemplateSequenceDataInterface< std::string >::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.

◆ deleteSites()

template<class HashType = std::string>
virtual void bpp::TemplateAlignmentDataInterface< HashType >::deleteSites ( size_t  siteIndex,
size_t  length 
)
pure virtual

Remove a continuous range of sites in the container.

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

Implemented in bpp::TemplateSiteContainerInterface< SiteType, SequenceType, HashType >, bpp::TemplateSiteContainerInterface< Site, Sequence, std::string >, bpp::TemplateSiteContainerInterface< SiteType, SequenceType, std::string >, bpp::TemplateVectorSiteContainer< SiteType, SequenceType >, bpp::CompressedVectorSiteContainer, and bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >.

◆ getAlphabet()

virtual std::shared_ptr<const Alphabet> bpp::TemplateSequenceDataInterface< std::string >::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 >.

◆ getComments()

◆ getNumberOfSequences()

virtual size_t bpp::TemplateSequenceDataInterface< std::string >::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.

◆ getNumberOfSites()

◆ getSequenceComments()

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

◆ getSequenceKeys()

virtual std::vector<std::string > bpp::TemplateSequenceDataInterface< std::string >::getSequenceKeys ( ) const
pure virtualinherited

◆ getSequenceNames()

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

◆ getSequencePosition()

virtual size_t bpp::TemplateSequenceDataInterface< std::string >::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()

template<class HashType = std::string>
virtual Vint bpp::TemplateAlignmentDataInterface< HashType >::getSiteCoordinates ( ) const
pure virtual

◆ getStateValueAt() [1/2]

virtual double bpp::TemplateSequenceDataInterface< std::string >::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]

virtual double bpp::TemplateSequenceDataInterface< std::string >::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()

virtual bool bpp::TemplateSequenceDataInterface< std::string >::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.

◆ operator()() [1/2]

virtual double bpp::TemplateSequenceDataInterface< std::string >::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]

virtual double bpp::TemplateSequenceDataInterface< std::string >::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()

◆ sequence() [1/2]

virtual const CoreSequenceInterface& bpp::TemplateSequenceDataInterface< std::string >::sequence ( const std::string &  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 >, and bpp::CompressedVectorSiteContainer.

◆ sequence() [2/2]

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

Retrieve a sequence object from the container.

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

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

◆ sequenceKey()

virtual const std::string & bpp::TemplateSequenceDataInterface< std::string >::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.

◆ setComments()

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

◆ setSequenceKeys()

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

◆ setSequenceNames()

virtual void bpp::TemplateSequenceDataInterface< std::string >::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.

◆ setSiteCoordinates()

template<class HashType = std::string>
virtual void bpp::TemplateAlignmentDataInterface< HashType >::setSiteCoordinates ( const Vint vCoordinates)
pure virtual

Set all coordinates of sites.

Parameters
vCoordinatesA vector with all site coordinates.

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

◆ site()


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