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

The AlignedSequencesContainer class. More...

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

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

Public Member Functions

 TemplateAlignedSequenceContainer (std::shared_ptr< const Alphabet > alphabet, std::vector< std::unique_ptr< Sequence >> vs)
 Build a container with pointers to sequence objects. More...
 
 TemplateAlignedSequenceContainer (std::shared_ptr< const Alphabet > alphabet)
 Build a new empty container with the specified alphabet. More...
 
 TemplateAlignedSequenceContainer (const TemplateAlignedSequenceContainer< SequenceType, SiteType > &asc)
 Copy constructor. More...
 
 TemplateAlignedSequenceContainer (const TemplateSiteContainerInterface< SiteType, SequenceType, std::string > &sc)
 Convert any SiteContainer object into a AlignedSequenceContainer object. More...
 
 TemplateAlignedSequenceContainer (const TemplateSequenceContainerInterface< SequenceType, std::string > &sc)
 Try to coerce a SequenceContainer object into an AlignedSequenceContainer object. More...
 
TemplateAlignedSequenceContaineroperator= (const TemplateAlignedSequenceContainer< SequenceType, SiteType > &asc)
 
TemplateAlignedSequenceContainer< SequenceType, SiteType > & operator= (const TemplateSiteContainerInterface< SiteType, SequenceType, std::string > &sc)
 
TemplateAlignedSequenceContaineroperator= (const TemplateSequenceContainerInterface< SequenceType, std::string > &sc)
 
virtual ~TemplateAlignedSequenceContainer ()
 
SequenceType::ElementType & valueAt (const std::string &sequenceKey, size_t sitePosition) override
 Get the content of the dataset at a specific position (sequence key, site position). More...
 
SequenceType::ElementType & valueAt (const size_t sequencePosition, size_t sitePosition) override
 Get the content of the dataset at a specific position (sequence position, site position). More...
 
virtual void addSequence (std::unique_ptr< SequenceType > &sequencePtr)
 Add a sequence to the container, using its name as a key. More...
 
const Alphabetalphabet () const override
 Get the container's alphabet. More...
 
std::shared_ptr< const AlphabetgetAlphabet () const override
 Get a pointer toward the container's alphabet. More...
 
virtual const CommentsgetComments () const =0
 Get the comments. More...
 
const CommentsgetComments () const override
 Get the comments. More...
 
virtual void setComments (const Comments &comments)=0
 Set the comments. More...
 
void setComments (const Comments &comments) override
 Set the comments. More...
 
virtual void clearComments ()=0
 
void clearComments () override
 
The Clonable interface.
TemplateAlignedSequenceContainer< SequenceType, SiteType > * clone () const override
 
The SiteContainer interface implementation:
const SiteType & site (size_t sitePosition) const override
 Get a site from the container. More...
 
void setSite (size_t sitePosition, std::unique_ptr< SiteType > &site, bool checkCoordinate=true) override
 Set a site in the container. More...
 
std::unique_ptr< SiteType > removeSite (size_t sitePosition) override
 Remove a site from the container. More...
 
void deleteSite (size_t sitePosition) override
 Delete a site from the container. More...
 
void deleteSites (size_t sitePosition, size_t length) override
 Remove a continuous range of sites in the container. More...
 
void addSite (std::unique_ptr< SiteType > &site, bool checkCoordinate=true) override
 Add a site in the container. More...
 
void addSite (std::unique_ptr< SiteType > &site, size_t sitePosition, bool checkCoordinate=true) override
 Add a site in the container. More...
 
void clear () override
 Delete all data in the container. More...
 
TemplateAlignedSequenceContainercreateEmptyContainer () const override
 Return a copy of this container, but with no data inside. More...
 
size_t getNumberOfSites () const override
 Get the number of aligned positions in the container. More...
 
Vint getSiteCoordinates () const override
 Get all coordinates of sites. More...
 
void setSiteCoordinates (const Vint &vCoordinates) override
 Set all coordinates of sites. More...
 
void reindexSites () override
 Set all coordinate attributes. More...
 
Redefinition of VectorSequenceContainer methods, to check for sequence lengths.
void setSequence (const std::string &sequenceKey, std::unique_ptr< SequenceType > &sequencePtr) override
 Replace a sequence in the container. More...
 
void addSequence (const std::string &sequenceKey, std::unique_ptr< SequenceType > &sequencePtr) override
 Add a sequence to the container. More...
 
void setSequence (size_t sequencePosition, std::unique_ptr< SequenceType > &sequencePtr) override
 Replace a sequence in the container. More...
 
void setSequence (size_t sequencePosition, std::unique_ptr< SequenceType > &sequencePtr, const std::string &sequenceKey) override
 Replace a sequence in the container. More...
 
void insertSequence (size_t sequencePosition, std::unique_ptr< SequenceType > &sequencePtr, const std::string &sequenceKey) override
 Insert a sequence in the container. More...
 
The SequenceContainer interface.
double getStateValueAt (size_t sitePosition, const std::string &sequenceKey, int state) const override
 Get the value of a state at a given position. More...
 
double getStateValueAt (size_t sitePosition, size_t sequencePosition, int state) const override
 Get value of a state at a given position. More...
 
double operator() (size_t sitePosition, const std::string &sequenceKey, int state) const override
 Get the value of a state at a given position. More...
 
double operator() (size_t sitePosition, size_t sequencePosition, int state) const override
 Get the value of a state at a given position. More...
 
size_t getNumberOfSequences () const override
 Get the number of sequences in the container. More...
 
std::vector< std::string > getSequenceKeys () const override
 
void setSequenceKeys (const std::vector< std::string > &sequenceKeys) override
 Reset all sequence keys. More...
 
const std::string & sequenceKey (size_t sequencePosition) const override
 Get the key associated to a given sequence. More...
 
size_t getSequencePosition (const std::string &sequenceKey) const override
 Get the position of a sequence with a given key in the container. More...
 
const SequenceType::ElementType & valueAt (const std::string &sequenceKey, size_t elementPosition) const override
 Get the content of the dataset at a specific position (sequence key, site position). More...
 
const SequenceType::ElementType & valueAt (size_t sequencePosition, size_t elementPosition) const override
 Get the content of the dataset at a specific position (sequence position, site position). More...
 
bool hasSequence (const std::string &sequenceKey) const override
 Check if a certain key is associated to a sequence in the container. More...
 
const SequenceType & sequence (const std::string &sequenceKey) const override
 Retrieve a sequence object from the container. More...
 
const SequenceType & sequence (size_t sequencePosition) const override
 Retrieve a sequence object from the container. More...
 
std::unique_ptr< SequenceType > removeSequence (const std::string &sequenceKey) override
 Remove a sequence from the container. More...
 
std::unique_ptr< SequenceType > removeSequence (size_t sequencePosition) override
 Remove a sequence from the container. More...
 
void deleteSequence (const std::string &sequenceKey) override
 Remove and delete a sequence from the container. More...
 
void deleteSequence (size_t sequencePosition) override
 Remove and delete a sequence from the container. More...
 
std::vector< std::string > getSequenceNames () const override
 
void setSequenceNames (const std::vector< std::string > &names, bool updateKeys) override
 Batch-set all sequence names. More...
 
std::vector< CommentsgetSequenceComments () const override
 

Protected Member Functions

bool checkSize_ (const Sequence &sequenceRef)
 Check sequence's size before insertion in sequence container. More...
 
virtual SequenceType & sequence_ (size_t sequencePosition)
 
virtual SequenceType & sequence_ (const std::string &sequenceKey)
 getSequence with given key More...
 

Protected Attributes

VectorMappedContainer< SequenceType > sequenceVectorMap_
 
std::shared_ptr< const Alphabetalphabet_
 The container's alphabet. More...
 
Comments comments_
 

Private Attributes

VectorPositionedContainer< SiteType > siteVector_
 
std::vector< int > coordinates_
 
size_t length_
 

Detailed Description

template<class SequenceType, class SiteType>
class bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >

The AlignedSequencesContainer class.

This class inherits from the VectorSequenceContainer and add site access. Sequence addition methods are re-defined to check for sequence lengths. Sequence access is in $O(1)$, and site access in $O(n)$, where $n$ is the number of sequences in the container.

Sites are built on the fly when needed, otherwise they are only nullptr

See VectorSiteContainer for an alternative implementation.

See also
VectorSequenceContainer, Sequence, Site, VectorSiteContainer

Definition at line 39 of file AlignedSequenceContainer.h.

Constructor & Destructor Documentation

◆ TemplateAlignedSequenceContainer() [1/5]

template<class SequenceType , class SiteType >
bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::TemplateAlignedSequenceContainer ( std::shared_ptr< const Alphabet alphabet,
std::vector< std::unique_ptr< Sequence >>  vs 
)
inline

◆ TemplateAlignedSequenceContainer() [2/5]

template<class SequenceType , class SiteType >
bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::TemplateAlignedSequenceContainer ( std::shared_ptr< const Alphabet alphabet)
inline

Build a new empty container with the specified alphabet.

Parameters
alphabetThe alphabet of the container.

Definition at line 88 of file AlignedSequenceContainer.h.

References bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::reindexSites().

◆ TemplateAlignedSequenceContainer() [3/5]

template<class SequenceType , class SiteType >
bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::TemplateAlignedSequenceContainer ( const TemplateAlignedSequenceContainer< SequenceType, SiteType > &  asc)
inline

Copy constructor.

Parameters
ascThe container to copy.

Definition at line 103 of file AlignedSequenceContainer.h.

◆ TemplateAlignedSequenceContainer() [4/5]

template<class SequenceType , class SiteType >
bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::TemplateAlignedSequenceContainer ( const TemplateSiteContainerInterface< SiteType, SequenceType, std::string > &  sc)
inline

Convert any SiteContainer object into a AlignedSequenceContainer object.

Parameters
scThe container to copy.

Definition at line 115 of file AlignedSequenceContainer.h.

◆ TemplateAlignedSequenceContainer() [5/5]

◆ ~TemplateAlignedSequenceContainer()

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

Definition at line 193 of file AlignedSequenceContainer.h.

Member Function Documentation

◆ addSequence() [1/2]

template<class SequenceType , class SiteType >
void bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::addSequence ( const std::string &  sequenceKey,
std::unique_ptr< SequenceType > &  sequencePtr 
)
inlineoverridevirtual

◆ addSequence() [2/2]

template<class SequenceType >
virtual void bpp::TemplateVectorSequenceContainer< SequenceType >::addSequence ( std::unique_ptr< SequenceType > &  sequencePtr)
inlinevirtualinherited

Add a sequence to the container, using its name as a key.

Parameters
sequencePtrA unique_ptr to the sequence to add.

Definition at line 371 of file VectorSequenceContainer.h.

References bpp::TemplateVectorSequenceContainer< SequenceType >::addSequence().

◆ addSite() [1/2]

template<class SequenceType , class SiteType >
void bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::addSite ( std::unique_ptr< SiteType > &  site,
bool  checkCoordinate = true 
)
inlineoverridevirtual

◆ addSite() [2/2]

template<class SequenceType , class SiteType >
void bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::addSite ( std::unique_ptr< SiteType > &  site,
size_t  sitePosition,
bool  checkCoordinate = true 
)
inlineoverridevirtual

◆ alphabet()

const Alphabet& bpp::AbstractTemplateSequenceContainer< SequenceType, std::string >::alphabet ( ) const
inlineoverridevirtualinherited

Get the container's alphabet.

Returns
The alphabet associated to this container.

Implements bpp::TemplateSequenceDataInterface< std::string >.

Definition at line 95 of file AbstractSequenceContainer.h.

◆ checkSize_()

template<class SequenceType , class SiteType >
bool bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::checkSize_ ( const Sequence sequenceRef)
inlineprotected

◆ clear()

◆ clearComments() [1/2]

void bpp::SimpleCommentable::clearComments ( )
inlineoverridevirtualinherited

Implements bpp::Commentable.

Definition at line 88 of file Commentable.h.

References bpp::SimpleCommentable::comments_.

◆ clearComments() [2/2]

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

Implemented in bpp::SimpleCommentable.

◆ clone()

template<class SequenceType , class SiteType >
TemplateAlignedSequenceContainer<SequenceType, SiteType>* bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::clone ( ) const
inlineoverridevirtual

◆ createEmptyContainer()

template<class SequenceType , class SiteType >
TemplateAlignedSequenceContainer* bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::createEmptyContainer ( ) const
inlineoverridevirtual

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::TemplateSiteContainerInterface< SiteType, SequenceType, std::string >.

Definition at line 422 of file AlignedSequenceContainer.h.

References bpp::AbstractTemplateSequenceContainer< SequenceType, std::string >::getAlphabet(), bpp::SimpleCommentable::getComments(), and bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::TemplateAlignedSequenceContainer().

◆ deleteSequence() [1/2]

template<class SequenceType >
void bpp::TemplateVectorSequenceContainer< SequenceType >::deleteSequence ( const std::string &  sequenceKey)
inlineoverridevirtualinherited

Remove and delete a sequence from the container.

Parameters
sequenceKeyThe key to which the sequence is associated.

Implements bpp::TemplateSequenceDataInterface< std::string >.

Definition at line 280 of file VectorSequenceContainer.h.

References bpp::VectorMappedContainer< T >::deleteObject(), bpp::TemplateVectorSequenceContainer< SequenceType >::sequenceKey(), and bpp::TemplateVectorSequenceContainer< SequenceType >::sequenceVectorMap_.

◆ deleteSequence() [2/2]

template<class SequenceType >
void bpp::TemplateVectorSequenceContainer< SequenceType >::deleteSequence ( size_t  sequencePosition)
inlineoverridevirtualinherited

Remove and delete a sequence from the container.

Parameters
sequencePositionThe position of the sequence.

Implements bpp::TemplateSequenceDataInterface< std::string >.

Definition at line 285 of file VectorSequenceContainer.h.

References bpp::VectorMappedContainer< T >::deleteObject(), and bpp::TemplateVectorSequenceContainer< SequenceType >::sequenceVectorMap_.

◆ deleteSite()

◆ deleteSites()

template<class SequenceType , class SiteType >
void bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::deleteSites ( size_t  sitePosition,
size_t  length 
)
inlineoverridevirtual

◆ getAlphabet()

std::shared_ptr<const Alphabet> bpp::AbstractTemplateSequenceContainer< SequenceType, std::string >::getAlphabet ( ) const
inlineoverridevirtualinherited

Get a pointer toward the container's alphabet.

Returns
A pointer toward the alphabet associated to this container.

Implements bpp::TemplateSequenceDataInterface< std::string >.

Definition at line 101 of file AbstractSequenceContainer.h.

◆ getComments() [1/2]

◆ getComments() [2/2]

◆ getNumberOfSequences()

template<class SequenceType >
size_t bpp::TemplateVectorSequenceContainer< SequenceType >::getNumberOfSequences ( ) const
inlineoverridevirtualinherited

◆ getNumberOfSites()

◆ getSequenceComments()

template<class SequenceType >
std::vector<Comments> bpp::TemplateVectorSequenceContainer< SequenceType >::getSequenceComments ( ) const
inlineoverridevirtualinherited

◆ getSequenceKeys()

template<class SequenceType >
std::vector<std::string> bpp::TemplateVectorSequenceContainer< SequenceType >::getSequenceKeys ( ) const
inlineoverridevirtualinherited

◆ getSequenceNames()

template<class SequenceType >
std::vector<std::string> bpp::TemplateVectorSequenceContainer< SequenceType >::getSequenceNames ( ) const
inlineoverridevirtualinherited

◆ getSequencePosition()

template<class SequenceType >
size_t bpp::TemplateVectorSequenceContainer< SequenceType >::getSequencePosition ( const std::string &  sequenceKey) const
inlineoverridevirtualinherited

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.

Implements bpp::TemplateSequenceDataInterface< std::string >.

Definition at line 224 of file VectorSequenceContainer.h.

References bpp::VectorMappedContainer< T >::getObjectPosition(), bpp::TemplateVectorSequenceContainer< SequenceType >::sequenceKey(), and bpp::TemplateVectorSequenceContainer< SequenceType >::sequenceVectorMap_.

Referenced by bpp::TemplateVectorSequenceContainer< SequenceType >::setSequence().

◆ getSiteCoordinates()

template<class SequenceType , class SiteType >
Vint bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::getSiteCoordinates ( ) const
inlineoverridevirtual

◆ getStateValueAt() [1/2]

template<class SequenceType >
double bpp::TemplateVectorSequenceContainer< SequenceType >::getStateValueAt ( size_t  sitePosition,
const std::string &  sequenceKey,
int  state 
) const
inlineoverridevirtualinherited

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

Implements bpp::TemplateSequenceDataInterface< std::string >.

Definition at line 184 of file VectorSequenceContainer.h.

References bpp::TemplateVectorSequenceContainer< SequenceType >::sequence(), and bpp::TemplateVectorSequenceContainer< SequenceType >::sequenceKey().

◆ getStateValueAt() [2/2]

template<class SequenceType >
double bpp::TemplateVectorSequenceContainer< SequenceType >::getStateValueAt ( size_t  sitePosition,
size_t  sequencePosition,
int  state 
) const
inlineoverridevirtualinherited

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

Implements bpp::TemplateSequenceDataInterface< std::string >.

Definition at line 194 of file VectorSequenceContainer.h.

References bpp::TemplateVectorSequenceContainer< SequenceType >::sequence().

◆ hasSequence()

template<class SequenceType >
bool bpp::TemplateVectorSequenceContainer< SequenceType >::hasSequence ( const std::string &  sequenceKey) const
inlineoverridevirtualinherited

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.

Implements bpp::TemplateSequenceDataInterface< std::string >.

Definition at line 249 of file VectorSequenceContainer.h.

References bpp::MappedNamedContainer< T >::hasObject(), bpp::TemplateVectorSequenceContainer< SequenceType >::sequenceKey(), and bpp::TemplateVectorSequenceContainer< SequenceType >::sequenceVectorMap_.

◆ insertSequence()

template<class SequenceType , class SiteType >
void bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::insertSequence ( size_t  sequencePosition,
std::unique_ptr< SequenceType > &  sequencePtr,
const std::string &  sequenceKey 
)
inlineoverridevirtual

◆ operator()() [1/2]

template<class SequenceType >
double bpp::TemplateVectorSequenceContainer< SequenceType >::operator() ( size_t  sitePosition,
const std::string &  sequenceKey,
int  state 
) const
inlineoverridevirtualinherited

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

Implements bpp::TemplateSequenceDataInterface< std::string >.

Definition at line 189 of file VectorSequenceContainer.h.

References bpp::TemplateVectorSequenceContainer< SequenceType >::sequence(), and bpp::TemplateVectorSequenceContainer< SequenceType >::sequenceKey().

◆ operator()() [2/2]

template<class SequenceType >
double bpp::TemplateVectorSequenceContainer< SequenceType >::operator() ( size_t  sitePosition,
size_t  sequencePosition,
int  state 
) const
inlineoverridevirtualinherited

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

Implements bpp::TemplateSequenceDataInterface< std::string >.

Definition at line 199 of file VectorSequenceContainer.h.

References bpp::TemplateVectorSequenceContainer< SequenceType >::sequence().

◆ operator=() [1/3]

◆ operator=() [2/3]

◆ operator=() [3/3]

◆ reindexSites()

◆ removeSequence() [1/2]

template<class SequenceType >
std::unique_ptr<SequenceType> bpp::TemplateVectorSequenceContainer< SequenceType >::removeSequence ( const std::string &  sequenceKey)
inlineoverridevirtualinherited

◆ removeSequence() [2/2]

template<class SequenceType >
std::unique_ptr<SequenceType> bpp::TemplateVectorSequenceContainer< SequenceType >::removeSequence ( size_t  sequencePosition)
inlineoverridevirtualinherited

Remove a sequence from the container.

Parameters
sequencePositionThe position of the sequence.

Implements bpp::TemplateSequenceContainerInterface< SequenceType, std::string >.

Definition at line 319 of file VectorSequenceContainer.h.

References bpp::VectorMappedContainer< T >::removeObject(), and bpp::TemplateVectorSequenceContainer< SequenceType >::sequenceVectorMap_.

◆ removeSite()

template<class SequenceType , class SiteType >
std::unique_ptr<SiteType> bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::removeSite ( size_t  sitePosition)
inlineoverridevirtual

◆ sequence() [1/2]

◆ sequence() [2/2]

template<class SequenceType >
const SequenceType& bpp::TemplateVectorSequenceContainer< SequenceType >::sequence ( size_t  sequencePosition) const
inlineoverridevirtualinherited

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::TemplateSequenceContainerInterface< SequenceType, std::string >.

Definition at line 290 of file VectorSequenceContainer.h.

References bpp::MappedNamedContainer< T >::getObject(), and bpp::TemplateVectorSequenceContainer< SequenceType >::sequenceVectorMap_.

◆ sequence_() [1/2]

template<class SequenceType >
virtual SequenceType& bpp::TemplateVectorSequenceContainer< SequenceType >::sequence_ ( const std::string &  sequenceKey)
inlineprotectedvirtualinherited

◆ sequence_() [2/2]

◆ sequenceKey()

template<class SequenceType >
const std::string& bpp::TemplateVectorSequenceContainer< SequenceType >::sequenceKey ( size_t  sequencePosition) const
inlineoverridevirtualinherited

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.

Implements bpp::TemplateSequenceDataInterface< std::string >.

Definition at line 219 of file VectorSequenceContainer.h.

References bpp::VectorMappedContainer< T >::getObjectName(), and bpp::TemplateVectorSequenceContainer< SequenceType >::sequenceVectorMap_.

Referenced by bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::addSequence(), bpp::TemplateVectorSequenceContainer< SequenceType >::addSequence(), bpp::TemplateVectorSequenceContainer< SequenceType >::deleteSequence(), bpp::TemplateVectorSequenceContainer< SequenceType >::getSequencePosition(), bpp::TemplateVectorSequenceContainer< SequenceType >::getStateValueAt(), bpp::TemplateVectorSequenceContainer< SequenceType >::hasSequence(), bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::insertSequence(), bpp::TemplateVectorSequenceContainer< SequenceType >::insertSequence(), bpp::TemplateVectorSequenceContainer< SequenceType >::operator()(), bpp::TemplateVectorSequenceContainer< SequenceType >::operator=(), bpp::TemplateVectorSequenceContainer< SequenceType >::removeSequence(), bpp::TemplateVectorSequenceContainer< SequenceType >::sequence(), bpp::TemplateVectorSequenceContainer< SequenceType >::sequence_(), bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::setSequence(), bpp::TemplateVectorSequenceContainer< SequenceType >::setSequence(), bpp::TemplateVectorSequenceContainer< SequenceType >::TemplateVectorSequenceContainer(), bpp::TemplateVectorSequenceContainer< SequenceType >::valueAt(), and bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::valueAt().

◆ setComments() [1/2]

◆ setComments() [2/2]

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

◆ setSequence() [1/3]

template<class SequenceType , class SiteType >
void bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::setSequence ( const std::string &  sequenceKey,
std::unique_ptr< SequenceType > &  sequencePtr 
)
inlineoverridevirtual

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.

Implements bpp::TemplateSequenceContainerInterface< SequenceType, std::string >.

Definition at line 463 of file AlignedSequenceContainer.h.

References bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::checkSize_(), bpp::TemplateVectorSequenceContainer< SequenceType >::getNumberOfSequences(), bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::length_, bpp::TemplateVectorSequenceContainer< SequenceType >::sequenceKey(), and bpp::TemplateVectorSequenceContainer< SequenceType >::setSequence().

◆ setSequence() [2/3]

template<class SequenceType , class SiteType >
void bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::setSequence ( size_t  sequencePosition,
std::unique_ptr< SequenceType > &  sequencePtr 
)
inlineoverridevirtual

◆ setSequence() [3/3]

template<class SequenceType , class SiteType >
void bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::setSequence ( size_t  sequencePosition,
std::unique_ptr< SequenceType > &  sequencePtr,
const std::string &  sequenceKey 
)
inlineoverridevirtual

◆ setSequenceKeys()

template<class SequenceType >
void bpp::TemplateVectorSequenceContainer< SequenceType >::setSequenceKeys ( const std::vector< std::string > &  sequenceKeys)
inlineoverridevirtualinherited

◆ setSequenceNames()

template<class SequenceType >
void bpp::TemplateVectorSequenceContainer< SequenceType >::setSequenceNames ( const std::vector< std::string > &  names,
bool  updateKeys 
)
inlineoverridevirtualinherited

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.

Implements bpp::TemplateSequenceDataInterface< std::string >.

Definition at line 338 of file VectorSequenceContainer.h.

References bpp::TemplateVectorSequenceContainer< SequenceType >::getNumberOfSequences(), bpp::TemplateVectorSequenceContainer< SequenceType >::sequence_(), bpp::TemplateVectorSequenceContainer< SequenceType >::sequenceVectorMap_, and bpp::VectorMappedContainer< T >::setObjectNames().

◆ setSite()

template<class SequenceType , class SiteType >
void bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::setSite ( size_t  sitePosition,
std::unique_ptr< SiteType > &  site,
bool  checkCoordinate = true 
)
inlineoverridevirtual

◆ setSiteCoordinates()

template<class SequenceType , class SiteType >
void bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::setSiteCoordinates ( const Vint vCoordinates)
inlineoverridevirtual

◆ site()

template<class SequenceType , class SiteType >
const SiteType& bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::site ( size_t  sitePosition) const
inlineoverridevirtual

◆ valueAt() [1/4]

template<class SequenceType , class SiteType >
SequenceType::ElementType& bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::valueAt ( const size_t  sequencePosition,
size_t  sitePosition 
)
inlineoverridevirtual

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.

Implements bpp::TemplateSequenceContainerInterface< SequenceType, std::string >.

Definition at line 559 of file AlignedSequenceContainer.h.

References bpp::VectorPositionedContainer< T >::addObject(), bpp::TemplateVectorSequenceContainer< SequenceType >::sequence_(), and bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::siteVector_.

◆ valueAt() [2/4]

template<class SequenceType >
const SequenceType::ElementType& bpp::TemplateVectorSequenceContainer< SequenceType >::valueAt ( const std::string &  sequenceKey,
size_t  sitePosition 
) const
inlineoverridevirtualinherited

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.

Implements bpp::TemplateSequenceContainerInterface< SequenceType, std::string >.

Definition at line 229 of file VectorSequenceContainer.h.

References bpp::TemplateVectorSequenceContainer< SequenceType >::sequence(), and bpp::TemplateVectorSequenceContainer< SequenceType >::sequenceKey().

◆ valueAt() [3/4]

template<class SequenceType , class SiteType >
SequenceType::ElementType& bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::valueAt ( const std::string &  sequenceKey,
size_t  sitePosition 
)
inlineoverridevirtual

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.

Implements bpp::TemplateSequenceContainerInterface< SequenceType, std::string >.

Definition at line 552 of file AlignedSequenceContainer.h.

References bpp::VectorPositionedContainer< T >::addObject(), bpp::TemplateVectorSequenceContainer< SequenceType >::sequence_(), bpp::TemplateVectorSequenceContainer< SequenceType >::sequenceKey(), and bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::siteVector_.

◆ valueAt() [4/4]

template<class SequenceType >
const SequenceType::ElementType& bpp::TemplateVectorSequenceContainer< SequenceType >::valueAt ( size_t  sequencePosition,
size_t  sitePosition 
) const
inlineoverridevirtualinherited

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.

Implements bpp::TemplateSequenceContainerInterface< SequenceType, std::string >.

Definition at line 239 of file VectorSequenceContainer.h.

References bpp::TemplateVectorSequenceContainer< SequenceType >::sequence().

Member Data Documentation

◆ alphabet_

std::shared_ptr<const Alphabet> bpp::AbstractTemplateSequenceContainer< SequenceType, std::string >::alphabet_
protectedinherited

The container's alphabet.

Definition at line 31 of file AbstractSequenceContainer.h.

◆ comments_

◆ coordinates_

◆ length_

◆ sequenceVectorMap_

◆ siteVector_


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