bpp-seq3  3.0.0
bpp::TemplateVectorSequenceContainer< SequenceType > Class Template Referenceabstract

The VectorSequenceContainer class. More...

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

+ Inheritance diagram for bpp::TemplateVectorSequenceContainer< SequenceType >:
+ Collaboration diagram for bpp::TemplateVectorSequenceContainer< SequenceType >:

Public Member Functions

 TemplateVectorSequenceContainer (std::shared_ptr< const Alphabet > alphabet, std::vector< std::unique_ptr< SequenceType >> &vs)
 Build a container with pointers to sequence objects. More...
 
 TemplateVectorSequenceContainer (std::shared_ptr< const Alphabet > alphabet)
 Build an empty container that will contain sequences of a particular alphabet. More...
 
TemplateVectorSequenceContaineroperator= (const TemplateVectorSequenceContainer &vsc)
 Assign from a VectorSequenceContainer. More...
 
TemplateVectorSequenceContaineroperator= (const TemplateSequenceContainerInterface< SequenceType, std::string > &sc)
 Copy from a SequenceContainer. More...
 
virtual ~TemplateVectorSequenceContainer ()
 
void clear () override
 Delete all data in the container. 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
 
Copy constructors:
 TemplateVectorSequenceContainer (const TemplateVectorSequenceContainer< SequenceType > &vsc)
 Copy from a VectorSequenceContainer. More...
 
 TemplateVectorSequenceContainer (const TemplateSequenceContainerInterface< SequenceType, std::string > &sc)
 Copy from a SequenceContainer. More...
 
The Clonable interface.
TemplateVectorSequenceContainer< SequenceType > * clone () const override
 
The SequenceContainer interface.
TemplateVectorSequenceContainer< SequenceType > * createEmptyContainer () const override
 Return a copy of this container, but with no data inside. More...
 
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 operator() (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, 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...
 
SequenceType::ElementType & valueAt (const std::string &sequenceKey, size_t elementPosition) 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...
 
SequenceType::ElementType & valueAt (size_t sequencePosition, size_t elementPosition) 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...
 
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...
 
std::unique_ptr< SequenceType > removeSequence (const std::string &sequenceKey) 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...
 
const SequenceType & sequence (size_t sequencePosition) const override
 Retrieve a sequence object from 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...
 
std::unique_ptr< SequenceType > removeSequence (size_t sequencePosition) override
 Remove 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

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_
 

Detailed Description

template<class SequenceType>
class bpp::TemplateVectorSequenceContainer< SequenceType >

The VectorSequenceContainer class.

This is the simplest implementation of the SequenceContainer interface. std::shared_ptr<Sequence> are stored in a std::vector, as well as in a std::map.

Definition at line 30 of file VectorSequenceContainer.h.

Constructor & Destructor Documentation

◆ TemplateVectorSequenceContainer() [1/4]

template<class SequenceType >
bpp::TemplateVectorSequenceContainer< SequenceType >::TemplateVectorSequenceContainer ( std::shared_ptr< const Alphabet alphabet,
std::vector< std::unique_ptr< SequenceType >> &  vs 
)
inline

Build a container with pointers to sequence objects.

The keys of the map are set to the names of the sequences.

Parameters
alphabetThe alphabet of the container.
vsA vector of smart pointers toward sequence objects.

Definition at line 45 of file VectorSequenceContainer.h.

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

◆ TemplateVectorSequenceContainer() [2/4]

template<class SequenceType >
bpp::TemplateVectorSequenceContainer< SequenceType >::TemplateVectorSequenceContainer ( std::shared_ptr< const Alphabet alphabet)
inline

Build an empty container that will contain sequences of a particular alphabet.

Parameters
alphabetThe alphabet of the container.

Definition at line 62 of file VectorSequenceContainer.h.

◆ TemplateVectorSequenceContainer() [3/4]

◆ TemplateVectorSequenceContainer() [4/4]

◆ ~TemplateVectorSequenceContainer()

template<class SequenceType >
virtual bpp::TemplateVectorSequenceContainer< SequenceType >::~TemplateVectorSequenceContainer ( )
inlinevirtual

Definition at line 150 of file VectorSequenceContainer.h.

Member Function Documentation

◆ addSequence() [1/2]

template<class SequenceType >
void bpp::TemplateVectorSequenceContainer< SequenceType >::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)
inlinevirtual

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

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

◆ 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 >
TemplateVectorSequenceContainer<SequenceType>* bpp::TemplateVectorSequenceContainer< SequenceType >::clone ( ) const
inlineoverridevirtual

◆ createEmptyContainer()

template<class SequenceType >
TemplateVectorSequenceContainer<SequenceType>* bpp::TemplateVectorSequenceContainer< SequenceType >::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::TemplateSequenceContainerInterface< SequenceType, std::string >.

Definition at line 176 of file VectorSequenceContainer.h.

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

◆ deleteSequence() [1/2]

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

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)
inlineoverridevirtual

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_.

◆ 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
inlineoverridevirtual

◆ getSequenceComments()

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

◆ getSequenceKeys()

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

◆ getSequenceNames()

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

◆ getSequencePosition()

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

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

◆ getStateValueAt() [1/2]

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

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
inlineoverridevirtual

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
inlineoverridevirtual

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 >
void bpp::TemplateVectorSequenceContainer< SequenceType >::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
inlineoverridevirtual

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
inlineoverridevirtual

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/2]

◆ operator=() [2/2]

◆ removeSequence() [1/2]

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

◆ removeSequence() [2/2]

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

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_.

◆ sequence() [1/2]

◆ sequence() [2/2]

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

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)
inlineprotectedvirtual

◆ sequence_() [2/2]

◆ sequenceKey()

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

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 >
void bpp::TemplateVectorSequenceContainer< SequenceType >::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 259 of file VectorSequenceContainer.h.

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

Referenced by bpp::TemplateAlignedSequenceContainer< SequenceType, SiteType >::setSequence().

◆ setSequence() [2/3]

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

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.

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

Definition at line 295 of file VectorSequenceContainer.h.

References bpp::VectorMappedContainer< T >::addObject(), bpp::AbstractTemplateSequenceContainer< SequenceType, std::string >::getAlphabet(), bpp::TemplateVectorSequenceContainer< SequenceType >::sequenceKey(), and bpp::TemplateVectorSequenceContainer< SequenceType >::sequenceVectorMap_.

◆ setSequence() [3/3]

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

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.

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

Definition at line 303 of file VectorSequenceContainer.h.

References bpp::VectorMappedContainer< T >::addObject(), bpp::AbstractTemplateSequenceContainer< SequenceType, std::string >::getAlphabet(), bpp::TemplateVectorSequenceContainer< SequenceType >::sequenceKey(), and bpp::TemplateVectorSequenceContainer< SequenceType >::sequenceVectorMap_.

◆ setSequenceKeys()

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

◆ setSequenceNames()

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

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

◆ valueAt() [1/4]

template<class SequenceType >
const SequenceType::ElementType& bpp::TemplateVectorSequenceContainer< SequenceType >::valueAt ( const std::string &  sequenceKey,
size_t  sitePosition 
) const
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 229 of file VectorSequenceContainer.h.

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

◆ valueAt() [2/4]

template<class SequenceType >
SequenceType::ElementType& bpp::TemplateVectorSequenceContainer< SequenceType >::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 234 of file VectorSequenceContainer.h.

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

◆ valueAt() [3/4]

template<class SequenceType >
const SequenceType::ElementType& bpp::TemplateVectorSequenceContainer< SequenceType >::valueAt ( size_t  sequencePosition,
size_t  sitePosition 
) const
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 239 of file VectorSequenceContainer.h.

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

◆ valueAt() [4/4]

template<class SequenceType >
SequenceType::ElementType& bpp::TemplateVectorSequenceContainer< SequenceType >::valueAt ( 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 244 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_

◆ sequenceVectorMap_


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