bpp-seq3  3.0.0
bpp::BasicProbabilisticSequence Class Referenceabstract

A basic implementation of the ProbabilisticSequence interface. More...

#include <Bpp/Seq/ProbabilisticSequence.h>

+ Inheritance diagram for bpp::BasicProbabilisticSequence:
+ Collaboration diagram for bpp::BasicProbabilisticSequence:

Public Types

typedef Table< double > DataTable
 

Public Member Functions

 BasicProbabilisticSequence (const Alphabet *alpha)
 Empty constructor : build a void ProbabilisticSequence with just an Alphabet. More...
 
 BasicProbabilisticSequence (const std::string &name, const Table< double > &sequence, const Alphabet *alpha)
 Direct constructor : build a ProbabilisticSequence object from Table<double>. More...
 
 BasicProbabilisticSequence (const std::string &name, const Table< double > &sequence, const Comments &comments, const Alphabet *alpha)
 Direct constructor : build a ProbabilisticSequence object from Table<double>. More...
 
 BasicProbabilisticSequence (const BasicProbabilisticSequence &s)
 The copy constructor. This does not perform a hard copy of the alphabet object. More...
 
BasicProbabilisticSequenceoperator= (const BasicProbabilisticSequence &s)
 The assignment operator. This does not perform a hard cop of the alphabet object. More...
 
virtual ~BasicProbabilisticSequence ()
 
void setContent (const Table< double > &content)
 
const std::vector< std::vector< double > > & getContent () const
 
const DataTablegetTable () const
 Get contents with alphabet states as column names. More...
 
void setToSizeR (size_t newSize)
 Set up the size of a sequence from the right side. More...
 
void setToSizeL (size_t newSize)
 Set up the size of a sequence from the left side. More...
 
void clearComments ()
 Clear the comments. More...
 
virtual const AlphabetgetAlphabet () const =0
 Get the alphabet associated to the list. More...
 
virtual size_t size () const =0
 Get the number of elements in the list. More...
 
virtual std::string toString () const =0
 Convert the list as a string. 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...
 
const AlphabetgetAlphabet () const
 Get the alphabet associated to the list. More...
 
size_t size () const
 Get the number of elements in the list. More...
 
void setContent (const std::vector< std::vector< double > > &list)
 Set the whole content of the list. More...
 
std::string toString () const
 Convert the list as a string. More...
 
void addElement (const std::vector< double > &element)
 Add a character to the end of the list. More...
 
void addElement (size_t pos, const std::vector< double > &element)
 Add a character at a certain position in the list. More...
 
void setElement (size_t pos, const std::vector< double > &element)
 Set the element at position 'pos' to character 'c'. More...
 
const std::vector< double > & getElement (size_t pos) const
 Get the element at position 'pos' as a character. More...
 
virtual void deleteElement (size_t pos)
 Remove the element at position 'pos'. More...
 
virtual void deleteElements (size_t pos, size_t len)
 Remove the elements at position 'pos'. More...
 
const std::vector< double > & getValue (size_t pos) const
 checked access to a character in list. More...
 
const std::vector< double > & operator[] (size_t pos) const
 Operator [] overloaded for quick access to a character in list. More...
 
std::vector< double > & operator[] (size_t pos)
 Operator [] overloaded for quick access to a character in list. More...
 
double getStateValueAt (size_t siteIndex, int state) const
 
double operator() (size_t siteIndex, int state) const
 
void shuffle ()
 Randomly shuffle the content of the list, with linear complexity. More...
 
The Clonable interface
BasicProbabilisticSequenceclone () const
 
Acting on the content of the list.
virtual void setContent (const std::vector< T > &list)=0
 Set the whole content of the list. More...
 
Edition methods.
virtual void addElement (const T &c)=0
 Add a character to the end of the list. More...
 
virtual void addElement (size_t pos, const T &c)=0
 Add a character at a certain position in the list. More...
 
virtual void setElement (size_t pos, const T &c)=0
 Set the element at position 'pos' to character 'c'. More...
 
virtual const T & getElement (size_t pos) const =0
 Get the element at position 'pos' as a character. More...
 
Provide direct access to the list content.
Warning
These operators allow you to modifiy the list content. No alphabet checking is performed for your modifications, so use with care, or consider using the setContent() method.
virtual const T & getValue (size_t pos) const =0
 checked access to a character in list. More...
 
virtual const T & operator[] (size_t pos) const =0
 Operator [] overloaded for quick access to a character in list. More...
 
virtual T & operator[] (size_t pos)=0
 Operator [] overloaded for quick access to a character in list. More...
 
Edition methods.
virtual void deleteElement (size_t pos)=0
 Remove the element at position 'pos'. More...
 
virtual void deleteElements (size_t pos, size_t len)=0
 Remove the elements at position 'pos'. More...
 
Provide direct access to the list content.
Warning
These operators allow you to modifiy the list content. No alphabet checking is performed for your modifications, so use with care, or consider using the setContent() method.
virtual void shuffle ()=0
 Randomly shuffle the content of the list, with linear complexity. More...
 
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...
 
Setting/getting the name of the sequence.
const std::string & getName () const
 Get the name of this sequence. More...
 
void setName (const std::string &name)
 Set the name of this sequence. More...
 
const CommentsgetComments () const
 Get the comments. More...
 
void setComments (const Comments &comments)
 Set the comments. More...
 

Protected Attributes

Comments comments_
 
DataTable content_
 The list content. More...
 

Private Attributes

std::string name_
 The sequence name. More...
 
const Alphabetalphabet_
 The Alphabet attribute must be initialized in the constructor and then can never be changed. More...
 

Detailed Description

A basic implementation of the ProbabilisticSequence interface.

This is a general purpose container, containing an ordered list of elmements. The states represented by the elements is defined by an alphabet object, which is passed to the contructor by a pointer.

ProbabilisticSequence objects also contain a name attribute and potentially several comment lines.

See also
Alphabet

Definition at line 102 of file ProbabilisticSequence.h.

Member Typedef Documentation

◆ DataTable

Definition at line 110 of file ProbabilisticSymbolList.h.

Constructor & Destructor Documentation

◆ BasicProbabilisticSequence() [1/4]

BasicProbabilisticSequence::BasicProbabilisticSequence ( const Alphabet alpha)

Empty constructor : build a void ProbabilisticSequence with just an Alphabet.

One can use it safely for all types of Alphabet in order to build an empty ProbabilisticSequence, i.e., without name nor sequence data.

Parameters
alphaA pointer to the Alphabet to be used with this ProbabilisticSequence.

Definition at line 48 of file ProbabilisticSequence.cpp.

Referenced by clone().

◆ BasicProbabilisticSequence() [2/4]

BasicProbabilisticSequence::BasicProbabilisticSequence ( const std::string &  name,
const Table< double > &  sequence,
const Alphabet alpha 
)

Direct constructor : build a ProbabilisticSequence object from Table<double>.

One can use it safely for RNA, DNA and protein sequences.

Parameters
nameThe sequence name.
sequenceThe entire sequence to parsed as a Table<double>.
alphaA pointer to the alphabet associated with this sequence.
Exceptions
Exceptionif the content is internally inconsistent, or is inconsistent with the specified alphabet.

Definition at line 51 of file ProbabilisticSequence.cpp.

References setContent().

◆ BasicProbabilisticSequence() [3/4]

BasicProbabilisticSequence::BasicProbabilisticSequence ( const std::string &  name,
const Table< double > &  sequence,
const Comments comments,
const Alphabet alpha 
)

Direct constructor : build a ProbabilisticSequence object from Table<double>.

One can use it safely for RNA, DNA and protein sequences.

Parameters
nameThe sequence name.
sequenceThe entire sequence to parsed as a Table<double>.
commentsComments to add to the sequence.
alphaA pointer to the alphabet associated with this sequence.
Exceptions
Exceptionif the content is internally inconsistent, or is inconsistent with the specified alphabet.

Definition at line 57 of file ProbabilisticSequence.cpp.

◆ BasicProbabilisticSequence() [4/4]

BasicProbabilisticSequence::BasicProbabilisticSequence ( const BasicProbabilisticSequence s)

The copy constructor. This does not perform a hard copy of the alphabet object.

Definition at line 62 of file ProbabilisticSequence.cpp.

◆ ~BasicProbabilisticSequence()

virtual bpp::BasicProbabilisticSequence::~BasicProbabilisticSequence ( )
inlinevirtual

Definition at line 169 of file ProbabilisticSequence.h.

Member Function Documentation

◆ addElement() [1/4]

void BasicProbabilisticSymbolList::addElement ( const std::vector< double > &  c)
virtualinherited

◆ addElement() [2/4]

template<class T >
virtual void bpp::CoreSymbolList< T >::addElement ( const T &  c)
pure virtualinherited

◆ addElement() [3/4]

void BasicProbabilisticSymbolList::addElement ( size_t  pos,
const std::vector< double > &  c 
)
virtualinherited

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< std::vector< double > >.

Definition at line 199 of file ProbabilisticSymbolList.cpp.

References bpp::Table< class >::addColumn(), bpp::BasicProbabilisticSymbolList::content_, and bpp::Table< class >::getNumberOfRows().

◆ addElement() [4/4]

template<class T >
virtual void bpp::CoreSymbolList< T >::addElement ( size_t  pos,
const T &  c 
)
pure virtualinherited

Add a character at a certain position in the list.

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

Implemented in bpp::EdSymbolList< T >, bpp::SymbolList< T >, and bpp::BasicProbabilisticSymbolList.

◆ clearComments()

void bpp::BasicProbabilisticSequence::clearComments ( )
inlinevirtual

Clear the comments.

Implements bpp::CoreSequence.

Definition at line 189 of file ProbabilisticSequence.h.

References bpp::Commentable::clearComments().

◆ clone()

BasicProbabilisticSequence* bpp::BasicProbabilisticSequence::clone ( ) const
inlinevirtual

Implements bpp::AbstractCoreSequence.

Definition at line 162 of file ProbabilisticSequence.h.

References BasicProbabilisticSequence().

◆ deleteElement() [1/2]

virtual void bpp::BasicProbabilisticSymbolList::deleteElement ( size_t  pos)
inlinevirtualinherited

Remove the element at position 'pos'.

Parameters
posThe position of the element to remove.

Implements bpp::CruxSymbolList.

Definition at line 213 of file ProbabilisticSymbolList.h.

References bpp::BasicProbabilisticSymbolList::content_, and bpp::Table< class >::deleteColumn().

◆ deleteElement() [2/2]

virtual void bpp::CruxSymbolList::deleteElement ( size_t  pos)
pure virtualinherited

◆ deleteElements() [1/2]

virtual void bpp::BasicProbabilisticSymbolList::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.

Definition at line 215 of file ProbabilisticSymbolList.h.

References bpp::BasicProbabilisticSymbolList::content_, and bpp::Table< class >::deleteRows().

◆ deleteElements() [2/2]

virtual void bpp::CruxSymbolList::deleteElements ( size_t  pos,
size_t  len 
)
pure virtualinherited

Remove the elements at position 'pos'.

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

Implemented in bpp::EdSymbolList< T >, bpp::EdSymbolList< int >, bpp::SymbolList< T >, bpp::SymbolList< int >, and bpp::BasicProbabilisticSymbolList.

Referenced by bpp::AlignedSequenceContainer::deleteSites().

◆ getAlphabet() [1/2]

const Alphabet* bpp::BasicProbabilisticSymbolList::getAlphabet ( ) const
inlinevirtualinherited

Get the alphabet associated to the list.

Returns
A const pointer to the alphabet.
See also
Alphabet class.

Implements bpp::CruxSymbolList.

Definition at line 183 of file ProbabilisticSymbolList.h.

References bpp::BasicProbabilisticSymbolList::alphabet_.

Referenced by bpp::BasicProbabilisticSymbolList::BasicProbabilisticSymbolList(), bpp::BasicProbabilisticSymbolList::getStateValueAt(), and bpp::BasicProbabilisticSymbolList::operator()().

◆ getAlphabet() [2/2]

virtual const Alphabet* bpp::CruxSymbolList::getAlphabet ( ) const
pure virtualinherited

Get the alphabet associated to the list.

Returns
A const pointer to the alphabet.
See also
Alphabet class.

Implemented in bpp::SymbolList< T >, bpp::SymbolList< int >, and bpp::BasicProbabilisticSymbolList.

Referenced by bpp::VectorProbabilisticSequenceContainer::addSequence(), bpp::VectorProbabilisticSiteContainer::addSequence(), bpp::VectorSequenceContainer::addSequence(), bpp::VectorSiteContainer::addSequence(), bpp::CompressedVectorSiteContainer::addSite(), bpp::AlignedSequenceContainer::addSite(), bpp::VectorSiteContainer::addSite(), bpp::SiteContainerTools::alignNW(), bpp::BasicSequence::append(), bpp::SequenceWithAnnotation::append(), bpp::SequenceTools::areSequencesIdentical(), bpp::SymbolListTools::areSymbolListsIdentical(), bpp::SequenceTools::bowkerTest(), bpp::SymbolListTools::changeGapsToUnknownCharacters(), bpp::SymbolListTools::changeUnresolvedCharactersToGaps(), bpp::SequenceTools::combineSequences(), bpp::SequenceTools::complement(), bpp::SiteContainerTools::computeSimilarity(), bpp::SequenceTools::concatenate(), bpp::SequenceWithAnnotationTools::createMaskAnnotation(), bpp::SequenceTools::findFirstOf(), bpp::CodonSiteTools::fixedDifferences(), bpp::CodonSiteTools::generateCodonSiteWithoutRareVariant(), bpp::SequenceTools::getCDS(), bpp::GeneticCode::getCodingSequence(), bpp::SequenceTools::getComplement(), bpp::SymbolListTools::getCounts(), bpp::SymbolListTools::getGCContent(), bpp::SequenceTools::getNumberOfCompleteSites(), bpp::SymbolListTools::getNumberOfDistinctPositions(), bpp::SymbolListTools::getNumberOfPositionsWithoutGap(), bpp::SequenceTools::getNumberOfSites(), bpp::SequenceTools::getNumberOfUnresolvedSites(), bpp::SequenceTools::getPercentIdentity(), bpp::SequenceTools::getPutativeHaplotypes(), bpp::SequenceTools::getSequenceWithCompleteSites(), bpp::SequenceTools::getSequenceWithoutGaps(), bpp::SequenceTools::getSequenceWithoutStops(), bpp::SymbolListTools::hasGap(), bpp::CodonSiteTools::hasGapOrStop(), bpp::CodonSiteTools::hasStop(), bpp::SymbolListTools::hasUnknown(), bpp::SymbolListTools::hasUnresolved(), bpp::SequenceTools::invertComplement(), bpp::SymbolListTools::isComplete(), bpp::SymbolListTools::isConstant(), bpp::SymbolListTools::isGapOnly(), bpp::SymbolListTools::isGapOrUnresolvedOnly(), bpp::CodonSiteTools::isMonoSitePolymorphic(), bpp::CodonSiteTools::isSynonymousPolymorphic(), bpp::SymbolListTools::jointEntropy(), bpp::CodonSiteTools::meanNumberOfSynonymousPositions(), bpp::SymbolListTools::mutualInformation(), bpp::Pasta::nextSequence(), bpp::PhredPoly::nextSequence(), bpp::SymbolListTools::numberOfGaps(), bpp::CodonSiteTools::numberOfNonSynonymousSubstitutions(), bpp::CodonSiteTools::numberOfSubstitutions(), bpp::SymbolListTools::numberOfUnresolved(), bpp::SymbolList< T >::operator=(), bpp::BasicProbabilisticSymbolList::operator=(), bpp::CodonSiteTools::piNonSynonymous(), bpp::CodonSiteTools::piSynonymous(), bpp::SequenceTools::removeGaps(), bpp::SequenceTools::removeStops(), bpp::SequenceTools::replaceStopsWithGaps(), bpp::WordAlphabet::reverse(), bpp::NucleicAcidsReplication::reverse(), bpp::AbstractReverseTransliterator::reverse(), bpp::SequenceTools::reverseTranscript(), bpp::SequenceTools::RNYslice(), bpp::VectorProbabilisticSiteContainer::setSequence(), bpp::VectorProbabilisticSequenceContainer::setSequence(), bpp::VectorSiteContainer::setSequence(), bpp::VectorSequenceContainer::setSequence(), bpp::AlignedSequenceContainer::setSite(), bpp::CompressedVectorSiteContainer::setSite(), bpp::VectorSiteContainer::setSite(), bpp::SequenceTools::subseq(), bpp::SequenceTools::subtractHaplotype(), bpp::SequenceTools::transcript(), bpp::NucleicAcidsReplication::translate(), bpp::AbstractTransliterator::translate(), bpp::WordAlphabet::translate(), bpp::SiteContainerTools::translateAlignment(), bpp::SymbolListTools::variabilityShannon(), and bpp::Pasta::writeSequence().

◆ getComments() [1/2]

const Comments& bpp::AbstractCoreSequence::getComments ( ) const
inlinevirtualinherited

Get the comments.

Returns
The comments.

Implements bpp::CoreSequence.

Reimplemented in bpp::SequenceWithQuality, and bpp::SequenceWithAnnotation.

Definition at line 235 of file CoreSequence.h.

References bpp::Commentable::getComments().

◆ getComments() [2/2]

◆ getContent()

const std::vector<std::vector<double> >& bpp::BasicProbabilisticSequence::getContent ( ) const
inlinevirtual

◆ getElement() [1/2]

const std::vector<double>& bpp::BasicProbabilisticSymbolList::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< std::vector< double > >.

Definition at line 208 of file ProbabilisticSymbolList.h.

References bpp::BasicProbabilisticSymbolList::content_, and bpp::Table< class >::getColumn().

Referenced by bpp::BasicProbabilisticSymbolList::getValue().

◆ getElement() [2/2]

template<class T >
virtual const T& bpp::CoreSymbolList< T >::getElement ( size_t  pos) const
pure virtualinherited

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

Parameters
posThe position of the character to retrieve.

Implemented in bpp::SymbolList< T >, bpp::SymbolList< int >, and bpp::BasicProbabilisticSymbolList.

◆ getName() [1/2]

const std::string& bpp::AbstractCoreSequence::getName ( ) const
inlinevirtualinherited

Get the name of this sequence.

Returns
This sequence name.

Implements bpp::CoreSequence.

Reimplemented in bpp::SequenceWithAnnotation.

Definition at line 231 of file CoreSequence.h.

References bpp::AbstractCoreSequence::name_.

Referenced by bpp::SequenceWithAnnotation::getName().

◆ getName() [2/2]

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() [1/2]

◆ getStateValueAt() [2/2]

double bpp::BasicProbabilisticSymbolList::getStateValueAt ( size_t  siteIndex,
int  state 
) const
inlinevirtualinherited

◆ getTable()

const DataTable& bpp::BasicProbabilisticSequence::getTable ( ) const
inlinevirtual

Get contents with alphabet states as column names.

Implements bpp::ProbabilisticSequence.

Definition at line 180 of file ProbabilisticSequence.h.

References bpp::BasicProbabilisticSymbolList::getTable().

Referenced by bpp::AllelicAlphabet::convertFromStateAlphabet().

◆ getValue() [1/2]

const std::vector<double>& bpp::BasicProbabilisticSymbolList::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< std::vector< double > >.

Definition at line 224 of file ProbabilisticSymbolList.h.

References bpp::BasicProbabilisticSymbolList::getElement().

◆ getValue() [2/2]

◆ operator()() [1/2]

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

◆ operator()() [2/2]

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

◆ operator=()

BasicProbabilisticSequence & BasicProbabilisticSequence::operator= ( const BasicProbabilisticSequence s)

The assignment operator. This does not perform a hard cop of the alphabet object.

Returns
A reference to the assigned BasicProbabilisticSequence.

Definition at line 65 of file ProbabilisticSequence.cpp.

References bpp::AbstractCoreSequence::operator=(), and bpp::BasicProbabilisticSymbolList::operator=().

◆ operator[]() [1/4]

std::vector<double>& bpp::BasicProbabilisticSymbolList::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< std::vector< double > >.

Definition at line 234 of file ProbabilisticSymbolList.h.

References bpp::BasicProbabilisticSymbolList::content_, and bpp::Table< class >::getColumn().

◆ operator[]() [2/4]

const std::vector<double>& bpp::BasicProbabilisticSymbolList::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< std::vector< double > >.

Definition at line 229 of file ProbabilisticSymbolList.h.

References bpp::BasicProbabilisticSymbolList::content_, and bpp::Table< class >::getColumn().

◆ operator[]() [3/4]

template<class T >
virtual const T& bpp::CoreSymbolList< T >::operator[] ( size_t  pos) const
pure virtualinherited

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

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

Implemented in bpp::SymbolList< T >, bpp::SymbolList< int >, and bpp::BasicProbabilisticSymbolList.

◆ operator[]() [4/4]

template<class T >
virtual T& bpp::CoreSymbolList< T >::operator[] ( size_t  pos)
pure virtualinherited

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

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

Implemented in bpp::SymbolList< T >, bpp::SymbolList< int >, and bpp::BasicProbabilisticSymbolList.

◆ setComments() [1/2]

void bpp::AbstractCoreSequence::setComments ( const Comments comments)
inlinevirtualinherited

Set the comments.

Parameters
commentsThe new comments.

Implements bpp::CoreSequence.

Reimplemented in bpp::SequenceWithQuality, and bpp::SequenceWithAnnotation.

Definition at line 240 of file CoreSequence.h.

References bpp::Commentable::setComments().

Referenced by bpp::AllelicAlphabet::convertFromStateAlphabet().

◆ setComments() [2/2]

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

◆ setContent() [1/3]

void BasicProbabilisticSymbolList::setContent ( const std::vector< std::vector< double > > &  list)
virtualinherited

◆ setContent() [2/3]

template<class T >
virtual void bpp::CoreSymbolList< T >::setContent ( const std::vector< T > &  list)
pure virtualinherited

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.

Implemented in bpp::EdSymbolList< T >, bpp::SymbolList< T >, and bpp::BasicProbabilisticSymbolList.

Referenced by bpp::Pasta::nextSequence().

◆ setContent() [3/3]

void bpp::BasicProbabilisticSequence::setContent ( const Table< double > &  content)
inline

◆ setElement() [1/2]

void BasicProbabilisticSymbolList::setElement ( size_t  pos,
const std::vector< double > &  c 
)
virtualinherited

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< std::vector< double > >.

Definition at line 216 of file ProbabilisticSymbolList.cpp.

References bpp::BasicProbabilisticSymbolList::content_, bpp::Table< class >::getNumberOfRows(), and bpp::Table< class >::setColumn().

◆ setElement() [2/2]

template<class T >
virtual void bpp::CoreSymbolList< T >::setElement ( size_t  pos,
const T &  c 
)
pure virtualinherited

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

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

Implemented in bpp::EdSymbolList< T >, bpp::SymbolList< T >, and bpp::BasicProbabilisticSymbolList.

Referenced by bpp::SequenceTools::complement(), bpp::SequenceTools::invert(), bpp::SequenceTools::invertComplement(), bpp::SequenceTools::replaceStopsWithGaps(), and bpp::AlignedSequenceContainer::setSite().

◆ setName() [1/2]

void bpp::AbstractCoreSequence::setName ( const std::string &  name)
inlinevirtualinherited

Set the name of this sequence.

Parameters
nameThe new name of the sequence.

Implements bpp::CoreSequence.

Reimplemented in bpp::SequenceWithAnnotation.

Definition at line 233 of file CoreSequence.h.

References bpp::AbstractCoreSequence::name_.

Referenced by bpp::AllelicAlphabet::convertFromStateAlphabet(), and bpp::SequenceWithAnnotation::setName().

◆ setName() [2/2]

◆ setToSizeL()

void bpp::BasicProbabilisticSequence::setToSizeL ( size_t  newSize)
inlinevirtual

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.

Implements bpp::CoreSequence.

Definition at line 187 of file ProbabilisticSequence.h.

◆ setToSizeR()

void bpp::BasicProbabilisticSequence::setToSizeR ( size_t  newSize)
inlinevirtual

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.

Implements bpp::CoreSequence.

Definition at line 185 of file ProbabilisticSequence.h.

◆ shuffle() [1/2]

void bpp::BasicProbabilisticSymbolList::shuffle ( )
inlinevirtualinherited

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

Implements bpp::CruxSymbolList.

Definition at line 251 of file ProbabilisticSymbolList.h.

◆ shuffle() [2/2]

virtual void bpp::CruxSymbolList::shuffle ( )
pure virtualinherited

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

Implemented in bpp::SymbolList< T >, bpp::SymbolList< int >, and bpp::BasicProbabilisticSymbolList.

◆ size() [1/2]

size_t bpp::BasicProbabilisticSymbolList::size ( ) const
inlinevirtualinherited

Get the number of elements in the list.

Returns
The number of sites in the list.

Implements bpp::CruxSymbolList.

Definition at line 185 of file ProbabilisticSymbolList.h.

References bpp::BasicProbabilisticSymbolList::content_, and bpp::Table< class >::getNumberOfColumns().

Referenced by bpp::BasicProbabilisticSymbolList::BasicProbabilisticSymbolList(), and bpp::BasicProbabilisticSymbolList::setContent().

◆ size() [2/2]

virtual size_t bpp::CruxSymbolList::size ( ) const
pure virtualinherited

Get the number of elements in the list.

Returns
The number of sites in the list.

Implemented in bpp::SymbolList< T >, bpp::SymbolList< int >, and bpp::BasicProbabilisticSymbolList.

Referenced by bpp::VectorProbabilisticSiteContainer::addSequence(), bpp::AlignedSequenceContainer::addSequence(), bpp::VectorSiteContainer::addSequence(), bpp::CompressedVectorSiteContainer::addSite(), bpp::AlignedSequenceContainer::addSite(), bpp::VectorSiteContainer::addSite(), bpp::AlignedSequenceContainer::AlignedSequenceContainer(), bpp::BasicSequence::append(), bpp::SequenceWithAnnotation::append(), bpp::SequenceTools::areSequencesIdentical(), bpp::SymbolListTools::areSymbolListsIdentical(), bpp::SequenceTools::bowkerTest(), bpp::SymbolListTools::changeGapsToUnknownCharacters(), bpp::SymbolListTools::changeUnresolvedCharactersToGaps(), bpp::AlignedSequenceContainer::checkSize_(), bpp::SequenceTools::combineSequences(), bpp::SequenceTools::complement(), bpp::SiteContainerTools::computeSimilarity(), bpp::SequenceTools::concatenate(), bpp::SequenceWithAnnotationTools::createMaskAnnotation(), bpp::SequenceTools::findFirstOf(), bpp::CodonSiteTools::fixedDifferences(), bpp::CodonSiteTools::generateCodonSiteWithoutRareVariant(), bpp::SiteContainerTools::getAlignmentPositions(), bpp::SequenceTools::getCDS(), bpp::GeneticCode::getCodingSequence(), bpp::SequenceContainerTools::getCodonPosition(), bpp::SymbolListTools::getCounts(), bpp::SequenceContainerTools::getCounts(), bpp::SymbolListTools::getFrequencies(), bpp::SequenceContainerTools::getFrequencies(), bpp::SymbolListTools::getGCContent(), bpp::SymbolListTools::getMajorAllele(), bpp::SymbolListTools::getMajorAlleleFrequency(), bpp::SymbolListTools::getMinorAllele(), bpp::SymbolListTools::getMinorAlleleFrequency(), bpp::SequenceTools::getNumberOfCompleteSites(), bpp::SymbolListTools::getNumberOfDistinctCharacters(), bpp::SymbolListTools::getNumberOfDistinctPositions(), bpp::SymbolListTools::getNumberOfPositionsWithoutGap(), bpp::SequenceTools::getNumberOfSites(), bpp::SequenceTools::getNumberOfUnresolvedSites(), bpp::SequenceTools::getPercentIdentity(), bpp::SequenceTools::getPutativeHaplotypes(), bpp::SiteContainerTools::getSequencePositions(), bpp::SequenceTools::getSequenceWithCompleteSites(), bpp::SequenceTools::getSequenceWithoutGaps(), bpp::SequenceTools::getSequenceWithoutStops(), bpp::CompressedVectorSiteContainer::getSiteIndex_(), bpp::VectorProbabilisticSequenceContainer::getStateValueAt(), bpp::VectorSequenceContainer::getStateValueAt(), bpp::CodonAlphabet::getWord(), bpp::WordAlphabet::getWord(), bpp::SymbolListTools::hasGap(), bpp::CodonSiteTools::hasGapOrStop(), bpp::SimpleSequencePositionIterator::hasMorePositions(), bpp::SymbolListTools::hasSingleton(), bpp::CodonSiteTools::hasStop(), bpp::SymbolListTools::hasUnknown(), bpp::SymbolListTools::hasUnresolved(), bpp::SymbolListTools::heterozygosity(), bpp::SequenceMask::init(), bpp::SequenceQuality::init(), bpp::SequenceTools::invert(), bpp::SequenceTools::invertComplement(), bpp::SymbolListTools::isComplete(), bpp::SymbolListTools::isConstant(), bpp::SymbolListTools::isDoubleton(), bpp::CodonSiteTools::isFourFoldDegenerated(), bpp::SymbolListTools::isGapOnly(), bpp::SymbolListTools::isGapOrUnresolvedOnly(), bpp::CodonSiteTools::isMonoSitePolymorphic(), bpp::SymbolListTools::isParsimonyInformativeSite(), bpp::CodonSiteTools::isSynonymousPolymorphic(), bpp::SymbolListTools::isTriplet(), bpp::SymbolListTools::jointEntropy(), bpp::CodonSiteTools::meanNumberOfSynonymousPositions(), bpp::SymbolListTools::mutualInformation(), bpp::SymbolListTools::numberOfGaps(), bpp::CodonSiteTools::numberOfNonSynonymousSubstitutions(), bpp::CodonSiteTools::numberOfSubstitutions(), bpp::SymbolListTools::numberOfUnresolved(), bpp::SymbolList< T >::operator=(), operator==(), bpp::CodonSiteTools::piNonSynonymous(), bpp::CodonSiteTools::piSynonymous(), bpp::SequenceTools::removeGaps(), bpp::SequenceTools::removeStops(), bpp::SequenceTools::replaceStopsWithGaps(), bpp::SiteContainerTools::resolveDottedAlignment(), bpp::CodonAlphabet::reverse(), bpp::WordAlphabet::reverse(), bpp::NucleicAcidsReplication::reverse(), bpp::AbstractReverseTransliterator::reverse(), bpp::SequenceTools::RNYslice(), bpp::SequenceContainerTools::sequencesHaveTheSameLength(), bpp::SequenceWalker::SequenceWalker(), bpp::VectorProbabilisticSiteContainer::setSequence(), bpp::VectorSiteContainer::setSequence(), bpp::AlignedSequenceContainer::setSequence(), bpp::AlignedSequenceContainer::setSite(), bpp::CompressedVectorSiteContainer::setSite(), bpp::VectorSiteContainer::setSite(), bpp::SequenceTools::subseq(), bpp::SequenceTools::subtractHaplotype(), bpp::SymbolList< T >::SymbolList(), bpp::NucleicAcidsReplication::translate(), bpp::AbstractTransliterator::translate(), bpp::CodonAlphabet::translate(), bpp::WordAlphabet::translate(), bpp::SiteContainerTools::translateAlignment(), bpp::SymbolListTools::variabilityFactorial(), bpp::SymbolListTools::variabilityShannon(), bpp::Phylip::writeInterleaved(), bpp::Fasta::writeSequence(), bpp::Pasta::writeSequence(), and bpp::Phylip::writeSequential().

◆ toString() [1/2]

string BasicProbabilisticSymbolList::toString ( ) const
virtualinherited

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.

Definition at line 136 of file ProbabilisticSymbolList.cpp.

References bpp::BasicProbabilisticSymbolList::content_, bpp::Table< class >::getNumberOfColumns(), bpp::Table< class >::getNumberOfRows(), and bpp::Table< class >::getRowName().

◆ toString() [2/2]

virtual std::string bpp::CruxSymbolList::toString ( ) const
pure virtualinherited

Member Data Documentation

◆ alphabet_

const Alphabet* bpp::BasicProbabilisticSymbolList::alphabet_
privateinherited

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

To apply another alphabet to the list requires creating another list.

Definition at line 119 of file ProbabilisticSymbolList.h.

Referenced by bpp::BasicProbabilisticSymbolList::BasicProbabilisticSymbolList(), bpp::BasicProbabilisticSymbolList::getAlphabet(), bpp::BasicProbabilisticSymbolList::operator=(), and bpp::BasicProbabilisticSymbolList::setContent().

◆ comments_

Comments bpp::Commentable::comments_
protectedinherited

◆ content_

◆ name_

std::string bpp::AbstractCoreSequence::name_
privateinherited

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