bpp-seq3  3.0.0
bpp::AbstractSequenceSymbolList< T > Class Template Referenceabstract

The AbstractSequenceSymbolList virtual class : SymbolList<T> is built, there. More...

#include <Bpp/Seq/CoreSequenceSymbolList.h>

+ Inheritance diagram for bpp::AbstractSequenceSymbolList< T >:
+ Collaboration diagram for bpp::AbstractSequenceSymbolList< T >:

Public Member Functions

virtual ~AbstractSequenceSymbolList ()
 
const AlphabetgetAlphabet () const
 Get the alphabet associated to the list. More...
 
size_t size () const
 Get the number of elements in the list. More...
 
virtual void setContent (const std::vector< T > &list)
 Set the whole content of the list. More...
 
virtual const std::vector< T > & getContent () const
 
virtual std::string toString () const
 Convert the list as a string. More...
 
void deleteElement (size_t pos)
 Remove the element at position 'pos'. More...
 
void deleteElements (size_t pos, size_t len)
 Remove the elements at position 'pos'. More...
 
void addElement (const T &v)
 Add a character to the end of the list. More...
 
void addElement (size_t pos, const T &v)
 Add a character at a certain position in the list. More...
 
void setElement (size_t pos, const T &v)
 Set the element at position 'pos' to character 'c'. More...
 
virtual const T & getElement (size_t pos) const
 Get the element at position 'pos' as a character. More...
 
virtual const T & getValue (size_t pos) const
 checked access to a character in list. More...
 
virtual const T & operator[] (size_t pos) const
 Operator [] overloaded for quick access to a character in list. More...
 
virtual T & operator[] (size_t pos)
 Operator [] overloaded for quick access to a character in list. More...
 
virtual void shuffle ()
 Randomly shuffle the content of the list, with linear complexity. More...
 
virtual double getStateValueAt (size_t siteIndex, int state) const
 
virtual double operator() (size_t siteIndex, int state) const
 
virtual const CommentsgetComments () const =0
 Get the comments. More...
 
virtual void setComments (const Comments &comments)=0
 Set the comments. More...
 
virtual void clearComments ()=0
 Clear the comments. More...
 
The Clonable interface
AbstractSequenceSymbolListclone () const =0
 
Setting/getting the name of the sequence.
virtual const std::string & getName () const =0
 Get the name of this sequence. More...
 
virtual void setName (const std::string &name)=0
 Set the name of this sequence. More...
 
Adjusting the size of the sequence.
virtual void setToSizeR (size_t newSize)=0
 Set up the size of a sequence from the right side. More...
 
virtual void setToSizeL (size_t newSize)=0
 Set up the size of a sequence from the left side. More...
 

Protected Attributes

std::vector< T > content_
 The list content. More...
 

Private Attributes

const Alphabetalphabet_
 The Alphabet attribute must be initialized in constructor and then can never be changed. More...
 

Detailed Description

template<class T>
class bpp::AbstractSequenceSymbolList< T >

The AbstractSequenceSymbolList virtual class : SymbolList<T> is built, there.

Definition at line 93 of file CoreSequenceSymbolList.h.

Constructor & Destructor Documentation

◆ ~AbstractSequenceSymbolList()

template<class T >
virtual bpp::AbstractSequenceSymbolList< T >::~AbstractSequenceSymbolList ( )
inlinevirtual

Definition at line 107 of file CoreSequenceSymbolList.h.

Member Function Documentation

◆ addElement() [1/2]

template<class T >
void bpp::SymbolList< T >::addElement ( const T &  c)
inlinevirtualinherited

Add a character to the end of the list.

Parameters
cThe character to add.

Implements bpp::CoreSymbolList< T >.

Reimplemented in bpp::EdSymbolList< T >.

Definition at line 199 of file SymbolList.h.

References bpp::SymbolList< T >::content_.

Referenced by bpp::EdSymbolList< T >::addElement().

◆ addElement() [2/2]

template<class T >
void bpp::SymbolList< T >::addElement ( size_t  pos,
const T &  c 
)
inlinevirtualinherited

Add a character at a certain position in the list.

Parameters
posThe postion where to insert the element.
cThe character to add.

Implements bpp::CoreSymbolList< T >.

Reimplemented in bpp::EdSymbolList< T >.

Definition at line 204 of file SymbolList.h.

References bpp::SymbolList< T >::content_, and bpp::SymbolList< T >::size().

◆ clearComments()

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

◆ clone()

template<class T >
AbstractSequenceSymbolList* bpp::AbstractSequenceSymbolList< T >::clone ( ) const
pure virtual

◆ deleteElement()

template<class T >
void bpp::SymbolList< T >::deleteElement ( size_t  pos)
inlinevirtualinherited

Remove the element at position 'pos'.

Parameters
posThe position of the element to remove.

Implements bpp::CruxSymbolList.

Reimplemented in bpp::EdSymbolList< T >, and bpp::EdSymbolList< int >.

Definition at line 185 of file SymbolList.h.

References bpp::SymbolList< T >::content_, and bpp::SymbolList< T >::size().

Referenced by bpp::EdSymbolList< T >::deleteElement().

◆ deleteElements()

template<class T >
void bpp::SymbolList< T >::deleteElements ( size_t  pos,
size_t  len 
)
inlinevirtualinherited

Remove the elements at position 'pos'.

Parameters
posThe position of the first element to remove.
lenThe length of the region to remove.

Implements bpp::CruxSymbolList.

Reimplemented in bpp::EdSymbolList< T >, and bpp::EdSymbolList< int >.

Definition at line 192 of file SymbolList.h.

References bpp::SymbolList< T >::content_, and bpp::SymbolList< T >::size().

Referenced by bpp::EdSymbolList< T >::deleteElements().

◆ getAlphabet()

template<class T >
const Alphabet* bpp::SymbolList< T >::getAlphabet ( ) const
inlinevirtualinherited

◆ getComments()

◆ getContent()

template<class T >
virtual const std::vector<T>& bpp::SymbolList< T >::getContent ( ) const
inlinevirtualinherited

Implements bpp::CoreSymbolList< T >.

Definition at line 178 of file SymbolList.h.

References bpp::SymbolList< T >::content_.

◆ getElement()

template<class T >
virtual const T& bpp::SymbolList< T >::getElement ( size_t  pos) const
inlinevirtualinherited

Get the element at position 'pos' as a character.

Parameters
posThe position of the character to retrieve.

Implements bpp::CoreSymbolList< T >.

Definition at line 220 of file SymbolList.h.

References bpp::SymbolList< T >::content_, and bpp::SymbolList< T >::size().

◆ getName()

virtual const std::string& bpp::CoreSequence::getName ( ) const
pure virtualinherited

Get the name of this sequence.

Returns
This sequence name.

Implemented in bpp::SequenceWithAnnotation, and bpp::AbstractCoreSequence.

Referenced by bpp::VectorProbabilisticSequenceContainer::addSequence(), bpp::VectorProbabilisticSiteContainer::addSequence(), bpp::VectorSequenceContainer::addSequence(), bpp::VectorSiteContainer::addSequence(), bpp::SequenceTools::combineSequences(), bpp::SequenceTools::concatenate(), bpp::AllelicAlphabet::convertFromStateAlphabet(), bpp::SequenceWithAnnotationTools::createMaskAnnotation(), bpp::VectorSequenceContainer::deleteSequenceByName(), bpp::AbstractProbabilisticSequenceContainer::getName(), bpp::AbstractSequenceContainer::getName(), bpp::VectorProbabilisticSequenceContainer::getName(), bpp::SequenceTools::getPutativeHaplotypes(), bpp::VectorSequenceContainer::getSequenceByName(), bpp::AbstractCoreSequence::operator=(), bpp::SequenceWithAnnotation::operator=(), bpp::VectorSequenceContainer::removeSequenceByName(), bpp::CodonAlphabet::reverse(), bpp::WordAlphabet::reverse(), bpp::NucleicAcidsReplication::reverse(), bpp::AbstractReverseTransliterator::reverse(), bpp::SequenceTools::RNYslice(), bpp::VectorProbabilisticSiteContainer::setSequence(), bpp::VectorProbabilisticSequenceContainer::setSequence(), bpp::VectorSiteContainer::setSequence(), bpp::VectorSequenceContainer::setSequence(), bpp::SequenceTools::subseq(), bpp::SequenceTools::subtractHaplotype(), bpp::NucleicAcidsReplication::translate(), bpp::AbstractTransliterator::translate(), bpp::CodonAlphabet::translate(), bpp::WordAlphabet::translate(), bpp::Clustal::writeAlignment(), bpp::Pasta::writeSequence(), and bpp::Fasta::writeSequence().

◆ getStateValueAt()

◆ getValue()

template<class T >
virtual const T& bpp::SymbolList< T >::getValue ( size_t  pos) const
inlinevirtualinherited

checked access to a character in list.

Parameters
posThe position to retrieve.
Returns
The T value of character at position pos.

Implements bpp::CoreSymbolList< T >.

Definition at line 227 of file SymbolList.h.

References bpp::SymbolList< T >::content_, and bpp::SymbolList< T >::size().

Referenced by bpp::CodonSiteTools::generateCodonSiteWithoutRareVariant(), bpp::CodonSiteTools::isFourFoldDegenerated(), and bpp::CodonSiteTools::numberOfSubstitutions().

◆ operator()()

virtual double bpp::CruxSymbolList::operator() ( size_t  siteIndex,
int  state 
) const
inlinevirtualinherited

◆ operator[]() [1/2]

template<class T >
virtual T& bpp::SymbolList< T >::operator[] ( size_t  pos)
inlinevirtualinherited

Operator [] overloaded for quick access to a character in list.

Parameters
posThe position to retrieve.
Returns
The T value of character at position pos.

Implements bpp::CoreSymbolList< T >.

Definition at line 236 of file SymbolList.h.

References bpp::SymbolList< T >::content_.

◆ operator[]() [2/2]

template<class T >
virtual const T& bpp::SymbolList< T >::operator[] ( size_t  pos) const
inlinevirtualinherited

Operator [] overloaded for quick access to a character in list.

Parameters
posThe position to retrieve.
Returns
The T value of character at position pos.

Implements bpp::CoreSymbolList< T >.

Definition at line 234 of file SymbolList.h.

References bpp::SymbolList< T >::content_.

◆ setComments()

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

◆ setContent()

template<class T >
virtual void bpp::SymbolList< T >::setContent ( const std::vector< T > &  list)
inlinevirtualinherited

Set the whole content of the list.

Parameters
listThe new content of the list.
See also
The list constructor for information about the way lists are internaly stored.

Implements bpp::CoreSymbolList< T >.

Reimplemented in bpp::EdSymbolList< T >, bpp::EdSymbolList< int >, bpp::SequenceWithAnnotation, bpp::BasicSequence, bpp::EdIntSymbolList, and bpp::BasicIntSymbolList.

Definition at line 173 of file SymbolList.h.

References bpp::SymbolList< T >::content_.

Referenced by bpp::BasicIntSymbolList::setContent(), bpp::EdSymbolList< T >::setContent(), and bpp::SymbolList< T >::SymbolList().

◆ setElement()

template<class T >
void bpp::SymbolList< T >::setElement ( size_t  pos,
const T &  c 
)
inlinevirtualinherited

Set the element at position 'pos' to character 'c'.

Parameters
posThe position of the character to set.
cThe value of the element.

Implements bpp::CoreSymbolList< T >.

Reimplemented in bpp::EdSymbolList< T >.

Definition at line 212 of file SymbolList.h.

References bpp::SymbolList< T >::content_, and bpp::SymbolList< T >::size().

Referenced by bpp::EdSymbolList< T >::setElement().

◆ setName()

◆ setToSizeL()

virtual void bpp::CoreSequence::setToSizeL ( size_t  newSize)
pure virtualinherited

Set up the size of a sequence from the left side.

All new characters are filled with gaps. If the specified size is < to the sequence size, the sequence will be truncated.

Parameters
newSizeThe new size of the sequence.

Implemented in bpp::SequenceWithAnnotation, bpp::BasicSequence, and bpp::BasicProbabilisticSequence.

◆ setToSizeR()

virtual void bpp::CoreSequence::setToSizeR ( size_t  newSize)
pure virtualinherited

Set up the size of a sequence from the right side.

All new characters are filled with gaps. If the specified size is < to the sequence size, the sequence will be truncated.

Parameters
newSizeThe new size of the sequence.

Implemented in bpp::SequenceWithAnnotation, bpp::BasicSequence, and bpp::BasicProbabilisticSequence.

Referenced by bpp::SequenceTools::concatenate().

◆ shuffle()

template<class T >
virtual void bpp::SymbolList< T >::shuffle ( )
inlinevirtualinherited

Randomly shuffle the content of the list, with linear complexity.

Implements bpp::CruxSymbolList.

Definition at line 238 of file SymbolList.h.

References bpp::SymbolList< T >::content_.

◆ size()

◆ toString()

template<class T >
virtual std::string bpp::SymbolList< T >::toString ( ) const
inlinevirtualinherited

Convert the list as a string.

This method is useful for dumping a list to a file or to the screen for display.

Returns
The whole list as a string.

Implements bpp::CruxSymbolList.

Reimplemented in bpp::BasicSequence, bpp::EdIntSymbolList, and bpp::BasicIntSymbolList.

Definition at line 180 of file SymbolList.h.

Member Data Documentation

◆ alphabet_

template<class T >
const Alphabet* bpp::SymbolList< T >::alphabet_
privateinherited

The Alphabet attribute must be initialized in constructor and then can never be changed.

To apply another alphabet to a list you'll have to create a new list.

Definition at line 79 of file SymbolList.h.

Referenced by bpp::SymbolList< T >::getAlphabet(), and bpp::SymbolList< T >::operator=().

◆ content_


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