bpp-seq3
3.0.0
|
A basic implementation of the Sequence interface. More...
#include <Bpp/Seq/Sequence.h>
Public Member Functions | |
BasicSequence (const Alphabet *alpha) | |
Empty constructor: build a void Sequence with just an Alphabet. More... | |
BasicSequence (const std::string &name, const std::string &sequence, const Alphabet *alpha) | |
Direct constructor: build a Sequence object from a std::string You can use it safely for RNA, DNA and protein sequences. More... | |
BasicSequence (const std::string &name, const std::string &sequence, const Comments &comments, const Alphabet *alpha) | |
Direct constructor: build a Sequence object from a std::string. More... | |
BasicSequence (const std::string &name, const std::vector< std::string > &sequence, const Alphabet *alpha) | |
General purpose constructor, can be used with any alphabet. More... | |
BasicSequence (const std::string &name, const std::vector< std::string > &sequence, const Comments &comments, const Alphabet *alpha) | |
General purpose constructor, can be used with any alphabet. More... | |
BasicSequence (const std::string &name, const std::vector< int > &sequence, const Alphabet *alpha) | |
General purpose constructor, can be used with any alphabet. More... | |
BasicSequence (const std::string &name, const std::vector< int > &sequence, const Comments &comments, const Alphabet *alpha) | |
General purpose constructor, can be used with any alphabet. More... | |
BasicSequence (const Sequence &s) | |
The Sequence generic copy constructor. This does not perform a hard copy of the alphabet object. More... | |
BasicSequence (const BasicSequence &s) | |
The Sequence copy constructor. This does not perform a hard copy of the alphabet object. More... | |
BasicSequence & | operator= (const Sequence &s) |
The Sequence generic assignment operator. This does not perform a hard copy of the alphabet object. More... | |
BasicSequence & | operator= (const BasicSequence &s) |
The Sequence assignment operator. This does not perform a hard copy of the alphabet object. More... | |
virtual | ~BasicSequence () |
virtual const Alphabet * | getAlphabet () 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 double | getStateValueAt (size_t siteIndex, int state) const |
virtual double | operator() (size_t siteIndex, int state) const |
virtual const Comments & | getComments () const =0 |
Get the comments. More... | |
virtual void | setComments (const Comments &comments)=0 |
Set the comments. More... | |
virtual void | addElement (const std::string &c) |
virtual void | addElement (size_t pos, const std::string &c) |
Add a character at a certain position in the list. More... | |
void | addElement (const int &v) |
Add a character to the end of the list. More... | |
void | addElement (size_t pos, const int &v) |
Add a character at a certain position in the list. More... | |
virtual void | setElement (size_t pos, const std::string &c) |
void | setElement (size_t pos, const int &v) |
Set the element at position 'pos' to character 'c'. More... | |
virtual double | getStateValueAt (size_t siteIndex, int state) const |
virtual double | operator() (size_t siteIndex, int state) const |
const Alphabet * | getAlphabet () const |
Get the alphabet associated to the list. More... | |
size_t | size () const |
Get the number of elements in the list. More... | |
virtual const std::vector< int > & | getContent () const |
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... | |
virtual const int & | getElement (size_t pos) const |
Get the element at position 'pos' as a character. More... | |
virtual const int & | getValue (size_t pos) const |
checked access to a character in list. More... | |
virtual const int & | operator[] (size_t pos) const |
Operator [] overloaded for quick access to a character in list. More... | |
virtual int & | 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... | |
The Clonable interface | |
BasicSequence * | clone () const |
Adjusting the size of the sequence. | |
void | setContent (const std::string &sequence) |
Set the whole content of the sequence. More... | |
void | setContent (const std::vector< std::string > &list) |
void | setContent (const std::vector< int > &list) |
std::string | toString () const |
Convert the list as a string. More... | |
std::string | getChar (size_t pos) const |
Get the element at position 'pos' as a character. 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 | append (const Sequence &seq) |
Append the content of the sequence. More... | |
void | append (const std::vector< int > &content) |
Append the specified content to the sequence. More... | |
void | append (const std::vector< std::string > &content) |
Append the specified content to the sequence. More... | |
void | append (const std::string &content) |
Append the specified content to the sequence. More... | |
void | clearComments () |
Clear the comments. More... | |
Acting on the content of the list. | |
virtual void | setContent (const std::vector< T > &list)=0 |
Set the whole content of the list. More... | |
virtual const std::vector< T > & | getContent () const =0 |
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. | |
| |
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. | |
| |
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 Comments & | getComments () const |
Get the comments. More... | |
void | setComments (const Comments &comments) |
Set the comments. More... | |
Protected Attributes | |
Comments | comments_ |
std::vector< int > | content_ |
The list content. More... | |
Private Attributes | |
std::string | name_ |
The sequence name. More... | |
const Alphabet * | alphabet_ |
The Alphabet attribute must be initialized in constructor and then can never be changed. More... | |
A basic implementation of the Sequence interface.
This is a general purpose container, containing an ordered list of states. The states that allowed to be present in the sequence are defined by an alphabet object, which is passed to the sequence constructor by a pointer.
For programming convenience, the states are stored as integers, but the translation toward and from a char description is easily performed with the Alphabet classes.
Sequence objets also contain a name attribute and potentially several comment lines.
Definition at line 151 of file Sequence.h.
BasicSequence::BasicSequence | ( | const Alphabet * | alpha | ) |
BasicSequence::BasicSequence | ( | const std::string & | name, |
const std::string & | sequence, | ||
const Alphabet * | alpha | ||
) |
Direct constructor: build a Sequence object from a std::string You can use it safely for RNA, DNA and protein sequences.
It can be used with codon sequences too, the std::string will be cut into parts of size 3. But for more complicated alphabets, you should use one complete constructors.
name | The sequence name. |
sequence | The whole sequence to be parsed as a std::string. |
alpha | A pointer toward the alphabet to be used with this sequence. |
Definition at line 63 of file Sequence.cpp.
References setContent().
BasicSequence::BasicSequence | ( | const std::string & | name, |
const std::string & | sequence, | ||
const Comments & | comments, | ||
const Alphabet * | alpha | ||
) |
Direct constructor: build a Sequence object from a std::string.
You can use it safely for RNA, DNA and protein sequences.
It can be used with codon sequences too, the std::string will be cut into tokens of size 3. But for more complicated alphabets, you should use one complete constructors.
name | The sequence name. |
sequence | The whole sequence to be parsed as a std::string. |
comments | Comments to add to the sequence. |
alpha | A pointer toward the alphabet to be used with this sequence. |
Definition at line 76 of file Sequence.cpp.
References setContent().
BasicSequence::BasicSequence | ( | const std::string & | name, |
const std::vector< std::string > & | sequence, | ||
const Alphabet * | alpha | ||
) |
General purpose constructor, can be used with any alphabet.
You should note that the sequence is stored as a std::vector of int. Hence each std::string in the std::vector will be translated using the alphabet object.
name | The sequence name. |
sequence | The sequence content. |
alpha | A pointer toward the alphabet to be used with this sequence. |
Definition at line 90 of file Sequence.cpp.
BasicSequence::BasicSequence | ( | const std::string & | name, |
const std::vector< std::string > & | sequence, | ||
const Comments & | comments, | ||
const Alphabet * | alpha | ||
) |
General purpose constructor, can be used with any alphabet.
You should note that the sequence is stored as a std::vector of int. Hence each std::string in the std::vector will be translated using the alphabet object.
name | The sequence name. |
sequence | The sequence content. |
comments | Comments to add to the sequence. |
alpha | A pointer toward the alphabet to be used with this sequence. |
Definition at line 100 of file Sequence.cpp.
BasicSequence::BasicSequence | ( | const std::string & | name, |
const std::vector< int > & | sequence, | ||
const Alphabet * | alpha | ||
) |
General purpose constructor, can be used with any alphabet.
name | The sequence name. |
sequence | The sequence content. |
alpha | A pointer toward the alphabet to be used with this sequence. |
Definition at line 111 of file Sequence.cpp.
BasicSequence::BasicSequence | ( | const std::string & | name, |
const std::vector< int > & | sequence, | ||
const Comments & | comments, | ||
const Alphabet * | alpha | ||
) |
General purpose constructor, can be used with any alphabet.
name | The sequence name. |
sequence | The sequence content. |
comments | Comments to add to the sequence. |
alpha | A pointer toward the alphabet to be used with this sequence. |
Definition at line 121 of file Sequence.cpp.
BasicSequence::BasicSequence | ( | const Sequence & | s | ) |
The Sequence generic copy constructor. This does not perform a hard copy of the alphabet object.
Definition at line 134 of file Sequence.cpp.
BasicSequence::BasicSequence | ( | const BasicSequence & | s | ) |
The Sequence copy constructor. This does not perform a hard copy of the alphabet object.
Definition at line 140 of file Sequence.cpp.
|
inlinevirtual |
Definition at line 265 of file Sequence.h.
|
inlineinherited |
Add a character to the end of the list.
c | The character to add. |
Definition at line 199 of file SymbolList.h.
|
virtualinherited |
Implements bpp::IntSymbolList.
Definition at line 135 of file IntSymbolList.cpp.
References bpp::SymbolList< int >::content_, and bpp::SymbolList< int >::getAlphabet().
Referenced by bpp::NucleicAcidsReplication::reverse(), and bpp::NucleicAcidsReplication::translate().
|
pure virtualinherited |
Add a character to the end of the list.
c | The character to add. |
Implemented in bpp::EdSymbolList< T >, bpp::SymbolList< T >, and bpp::BasicProbabilisticSymbolList.
Referenced by bpp::AlignedSequenceContainer::addSite(), bpp::SequenceTools::getPutativeHaplotypes(), bpp::AbstractReverseTransliterator::reverse(), and bpp::AbstractTransliterator::translate().
|
inlineinherited |
Add a character at a certain position in the list.
pos | The postion where to insert the element. |
c | The character to add. |
Definition at line 204 of file SymbolList.h.
|
virtualinherited |
Add a character at a certain position in the list.
pos | The postion where to insert the element. |
c | The character to add, given as a string. |
Implements bpp::IntSymbolList.
Definition at line 142 of file IntSymbolList.cpp.
References bpp::SymbolList< int >::content_, bpp::SymbolList< int >::getAlphabet(), and bpp::SymbolList< int >::size().
|
pure virtualinherited |
Add a character at a certain position in the list.
pos | The postion where to insert the element. |
c | The character to add. |
Implemented in bpp::EdSymbolList< T >, bpp::SymbolList< T >, and bpp::BasicProbabilisticSymbolList.
|
virtual |
Append the content of the sequence.
seq | The sequence to append. |
AlphabetMismatchException | If the alphabet of the specified sequence does not match the current alphabet. |
Implements bpp::Sequence.
Definition at line 217 of file Sequence.cpp.
References bpp::SymbolList< int >::content_, bpp::SymbolList< int >::getAlphabet(), bpp::CruxSymbolList::getAlphabet(), bpp::Alphabet::getAlphabetType(), and bpp::CruxSymbolList::size().
Referenced by append(), and bpp::SequenceContainerTools::merge().
|
virtual |
Append the specified content to the sequence.
content | The content to append to the sequence. |
BadCharException | If the content does not match the current alphabet. |
Implements bpp::Sequence.
Definition at line 259 of file Sequence.cpp.
References append(), bpp::StringSequenceTools::codeSequence(), and bpp::SymbolList< int >::getAlphabet().
|
virtual |
Append the specified content to the sequence.
content | The content to append to the sequence. |
BadIntException | If the content does not match the current alphabet. |
Implements bpp::Sequence.
Definition at line 228 of file Sequence.cpp.
References bpp::SymbolList< int >::content_, and bpp::SymbolList< int >::getAlphabet().
|
virtual |
Append the specified content to the sequence.
content | The content to append to the sequence. |
BadCharException | If the content does not match the current alphabet. |
Implements bpp::Sequence.
Definition at line 243 of file Sequence.cpp.
References bpp::SymbolList< int >::content_, and bpp::SymbolList< int >::getAlphabet().
|
inlinevirtual |
Clear the comments.
Implements bpp::CoreSequence.
Definition at line 318 of file Sequence.h.
References bpp::Commentable::clearComments().
|
inlinevirtual |
Implements bpp::AbstractCoreSequence.
Definition at line 273 of file Sequence.h.
References BasicSequence().
|
inlinevirtualinherited |
Remove the element at position 'pos'.
pos | The position of the element to remove. |
Implements bpp::CruxSymbolList.
Reimplemented in bpp::EdSymbolList< int >.
Definition at line 185 of file SymbolList.h.
|
pure virtualinherited |
Remove the element at position 'pos'.
pos | The position of the element to remove. |
Implemented in bpp::EdSymbolList< T >, bpp::EdSymbolList< int >, bpp::SymbolList< T >, bpp::SymbolList< int >, and bpp::BasicProbabilisticSymbolList.
Referenced by bpp::AlignedSequenceContainer::deleteSite(), bpp::SequenceTools::getCDS(), bpp::SequenceTools::removeGaps(), bpp::VectorSiteContainer::removeSequence(), bpp::AlignedSequenceContainer::removeSite(), and bpp::SequenceTools::removeStops().
|
inlinevirtualinherited |
Remove the elements at position 'pos'.
pos | The position of the first element to remove. |
len | The length of the region to remove. |
Implements bpp::CruxSymbolList.
Reimplemented in bpp::EdSymbolList< int >.
Definition at line 192 of file SymbolList.h.
|
pure virtualinherited |
Remove the elements at position 'pos'.
pos | The position of the first element to remove. |
len | The 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().
|
inlinevirtualinherited |
Get the alphabet associated to the list.
Implements bpp::CruxSymbolList.
Definition at line 169 of file SymbolList.h.
|
pure virtualinherited |
Get the alphabet associated to the list.
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(), 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().
|
inlinevirtual |
Get the element at position 'pos' as a character.
pos | The position of the character to retrieve. |
Reimplemented from bpp::BasicIntSymbolList.
Definition at line 301 of file Sequence.h.
References bpp::BasicIntSymbolList::getChar().
|
inlinevirtualinherited |
Get the comments.
Implements bpp::CoreSequence.
Reimplemented in bpp::SequenceWithQuality, and bpp::SequenceWithAnnotation.
Definition at line 235 of file CoreSequence.h.
References bpp::Commentable::getComments().
|
pure virtualinherited |
Get the comments.
Implemented in bpp::SequenceWithQuality, bpp::SequenceWithAnnotation, and bpp::AbstractCoreSequence.
Referenced by bpp::VectorProbabilisticSiteContainer::addSequence(), bpp::VectorSiteContainer::addSequence(), bpp::AllelicAlphabet::convertFromStateAlphabet(), bpp::SequenceWithAnnotationTools::createMaskAnnotation(), bpp::AbstractProbabilisticSequenceContainer::getComments(), bpp::AbstractSequenceContainer::getComments(), bpp::VectorProbabilisticSequenceContainer::getComments(), bpp::AbstractCoreSequence::operator=(), bpp::SequenceWithAnnotation::operator=(), bpp::NucleicAcidsReplication::reverse(), bpp::AbstractReverseTransliterator::reverse(), bpp::SequenceTools::RNYslice(), bpp::SequenceTools::subseq(), bpp::NucleicAcidsReplication::translate(), bpp::AbstractTransliterator::translate(), bpp::Pasta::writeSequence(), and bpp::Fasta::writeSequence().
|
inlinevirtualinherited |
Implements bpp::CoreSymbolList< T >.
Definition at line 178 of file SymbolList.h.
|
pure virtualinherited |
Implemented in bpp::ProbabilisticSequence, bpp::SymbolList< T >, bpp::SymbolList< int >, bpp::BasicProbabilisticSymbolList, and bpp::BasicProbabilisticSequence.
Referenced by bpp::SequenceWithQualityTools::concatenate(), bpp::SequenceWithQualityTools::invert(), bpp::BasicProbabilisticSymbolList::operator=(), operator=(), and bpp::SequenceWithAnnotation::operator=().
|
inlinevirtualinherited |
Get the element at position 'pos' as a character.
pos | The position of the character to retrieve. |
Implements bpp::CoreSymbolList< T >.
Definition at line 220 of file SymbolList.h.
|
pure virtualinherited |
Get the element at position 'pos' as a character.
pos | The position of the character to retrieve. |
Implemented in bpp::SymbolList< T >, bpp::SymbolList< int >, and bpp::BasicProbabilisticSymbolList.
|
inlinevirtualinherited |
Get the name of this sequence.
Implements bpp::CoreSequence.
Reimplemented in bpp::SequenceWithAnnotation.
Definition at line 231 of file CoreSequence.h.
References bpp::AbstractCoreSequence::name_.
Referenced by bpp::SequenceWithAnnotation::getName().
|
pure virtualinherited |
Get the name of this sequence.
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().
|
inlinevirtualinherited |
Reimplemented in bpp::BasicProbabilisticSymbolList, bpp::BasicIntSymbolList, and bpp::EdCoreSymbolList< T >.
Definition at line 147 of file CoreSymbolList.h.
Referenced by bpp::VectorProbabilisticSiteContainer::addSequence(), bpp::BasicProbabilisticSymbolList::BasicProbabilisticSymbolList(), bpp::VectorProbabilisticSequenceContainer::getStateValueAt(), bpp::VectorSequenceContainer::getStateValueAt(), bpp::EdCoreSymbolList< T >::getStateValueAt(), and bpp::Pasta::writeSequence().
|
inlinevirtualinherited |
Reimplemented from bpp::CruxSymbolList.
Definition at line 217 of file IntSymbolList.h.
References bpp::SymbolList< int >::content_, bpp::SymbolList< int >::getAlphabet(), and bpp::Alphabet::isResolvedIn().
|
inlinevirtualinherited |
checked access to a character in list.
pos | The position to retrieve. |
Implements bpp::CoreSymbolList< T >.
Definition at line 227 of file SymbolList.h.
|
pure virtualinherited |
checked access to a character in list.
pos | The position to retrieve. |
Implemented in bpp::SymbolList< T >, bpp::SymbolList< int >, and bpp::BasicProbabilisticSymbolList.
Referenced by bpp::VectorSiteContainer::addSequence(), bpp::SequenceTools::combineSequences(), bpp::SequenceTools::complement(), bpp::SequenceTools::findFirstOf(), bpp::SymbolListTools::getGCContent(), bpp::SequenceTools::getPercentIdentity(), bpp::SequenceTools::invert(), bpp::SequenceTools::invertComplement(), bpp::NucleicAcidsReplication::reverse(), bpp::AbstractReverseTransliterator::reverse(), bpp::VectorProbabilisticSiteContainer::setSequence(), bpp::VectorSiteContainer::setSequence(), bpp::SequenceTools::subtractHaplotype(), bpp::NucleicAcidsReplication::translate(), and bpp::AbstractTransliterator::translate().
|
inlinevirtualinherited |
Reimplemented in bpp::BasicProbabilisticSymbolList, bpp::BasicIntSymbolList, and bpp::EdCoreSymbolList< T >.
Definition at line 154 of file CoreSymbolList.h.
Referenced by bpp::EdCoreSymbolList< T >::operator()().
|
inlinevirtualinherited |
Reimplemented from bpp::CruxSymbolList.
Definition at line 225 of file IntSymbolList.h.
References bpp::SymbolList< int >::content_, bpp::SymbolList< int >::getAlphabet(), and bpp::Alphabet::isResolvedIn().
BasicSequence & BasicSequence::operator= | ( | const BasicSequence & | s | ) |
The Sequence assignment operator. This does not perform a hard copy of the alphabet object.
Definition at line 156 of file Sequence.cpp.
References bpp::AbstractCoreSequence::operator=(), and bpp::BasicIntSymbolList::operator=().
BasicSequence & BasicSequence::operator= | ( | const Sequence & | s | ) |
The Sequence generic assignment operator. This does not perform a hard copy of the alphabet object.
Definition at line 149 of file Sequence.cpp.
References bpp::CoreSymbolList< T >::getContent(), bpp::AbstractCoreSequence::operator=(), and setContent().
|
inlinevirtualinherited |
Operator [] overloaded for quick access to a character in list.
pos | The position to retrieve. |
Implements bpp::CoreSymbolList< T >.
Definition at line 236 of file SymbolList.h.
|
inlinevirtualinherited |
Operator [] overloaded for quick access to a character in list.
pos | The position to retrieve. |
Implements bpp::CoreSymbolList< T >.
Definition at line 234 of file SymbolList.h.
|
pure virtualinherited |
Operator [] overloaded for quick access to a character in list.
pos | The position to retrieve. |
Implemented in bpp::SymbolList< T >, bpp::SymbolList< int >, and bpp::BasicProbabilisticSymbolList.
|
pure virtualinherited |
Operator [] overloaded for quick access to a character in list.
pos | The position to retrieve. |
Implemented in bpp::SymbolList< T >, bpp::SymbolList< int >, and bpp::BasicProbabilisticSymbolList.
|
inlinevirtualinherited |
Set the comments.
comments | The 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().
|
pure virtualinherited |
Set the comments.
comments | The new comments. |
Implemented in bpp::SequenceWithQuality, bpp::SequenceWithAnnotation, and bpp::AbstractCoreSequence.
Referenced by bpp::Pasta::nextSequence(), bpp::Fasta::nextSequence(), bpp::VectorProbabilisticSequenceContainer::setComments(), bpp::VectorSequenceContainer::setComments(), and bpp::SequenceTools::subseq().
|
virtual |
Set the whole content of the sequence.
sequence | The new content of the sequence. |
Implements bpp::Sequence.
Definition at line 165 of file Sequence.cpp.
References bpp::StringSequenceTools::codeSequence(), bpp::SymbolList< int >::content_, bpp::SymbolList< int >::getAlphabet(), and bpp::TextTools::removeWhiteSpaces().
Referenced by BasicSequence(), and operator=().
|
inlinevirtual |
Reimplemented from bpp::BasicIntSymbolList.
Definition at line 291 of file Sequence.h.
References bpp::BasicIntSymbolList::setContent().
|
inlinevirtual |
Reimplemented from bpp::BasicIntSymbolList.
Definition at line 286 of file Sequence.h.
References bpp::BasicIntSymbolList::setContent().
|
pure virtualinherited |
Set the whole content of the list.
list | The new content of the list. |
Implemented in bpp::EdSymbolList< T >, bpp::SymbolList< T >, and bpp::BasicProbabilisticSymbolList.
Referenced by bpp::Pasta::nextSequence().
|
inlineinherited |
Set the element at position 'pos' to character 'c'.
pos | The position of the character to set. |
c | The value of the element. |
Definition at line 212 of file SymbolList.h.
|
virtualinherited |
Implements bpp::IntSymbolList.
Definition at line 151 of file IntSymbolList.cpp.
References bpp::Alphabet::charToInt(), bpp::SymbolList< int >::content_, bpp::SymbolList< int >::getAlphabet(), and bpp::SymbolList< int >::size().
Referenced by bpp::VectorSiteContainer::setSequence().
|
pure virtualinherited |
Set the element at position 'pos' to character 'c'.
pos | The position of the character to set. |
c | The 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().
|
inlinevirtualinherited |
Set the name of this sequence.
name | The 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().
|
pure virtualinherited |
Set the name of this sequence.
name | The new name of the sequence. |
Implemented in bpp::SequenceWithAnnotation, and bpp::AbstractCoreSequence.
Referenced by bpp::SequenceTools::getPutativeHaplotypes(), bpp::Pasta::nextSequence(), bpp::Fasta::nextSequence(), bpp::PhredPoly::nextSequence(), bpp::PhredPhd::nextSequence(), bpp::VectorProbabilisticSequenceContainer::setSequenceNames(), bpp::VectorSequenceContainer::setSequenceNames(), and bpp::SequenceTools::subseq().
|
virtual |
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.
newSize | The new size of the sequence. |
Implements bpp::CoreSequence.
Definition at line 195 of file Sequence.cpp.
References bpp::SymbolList< int >::content_, bpp::SymbolList< int >::getAlphabet(), and bpp::Alphabet::getGapCharacterCode().
|
virtual |
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.
newSize | The new size of the sequence. |
Implements bpp::CoreSequence.
Definition at line 174 of file Sequence.cpp.
References bpp::SymbolList< int >::content_, bpp::SymbolList< int >::getAlphabet(), and bpp::Alphabet::getGapCharacterCode().
|
inlinevirtualinherited |
Randomly shuffle the content of the list, with linear complexity.
Implements bpp::CruxSymbolList.
Definition at line 238 of file SymbolList.h.
|
pure virtualinherited |
Randomly shuffle the content of the list, with linear complexity.
Implemented in bpp::SymbolList< T >, bpp::SymbolList< int >, and bpp::BasicProbabilisticSymbolList.
|
inlinevirtualinherited |
Get the number of elements in the list.
Implements bpp::CruxSymbolList.
Definition at line 171 of file SymbolList.h.
|
pure virtualinherited |
Get the number of elements 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(), 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().
|
inlinevirtual |
Convert the list as a string.
This method is useful for dumping a list to a file or to the screen for display.
Reimplemented from bpp::BasicIntSymbolList.
Definition at line 296 of file Sequence.h.
References bpp::BasicIntSymbolList::toString().
|
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.
|
protectedinherited |
Definition at line 63 of file Commentable.h.
Referenced by bpp::Commentable::clearComments(), bpp::Commentable::getComments(), bpp::Commentable::operator=(), and bpp::Commentable::setComments().
|
protectedinherited |
The list content.
Definition at line 85 of file SymbolList.h.
|
privateinherited |
The sequence name.
Definition at line 163 of file CoreSequence.h.
Referenced by bpp::AbstractCoreSequence::getName(), bpp::AbstractCoreSequence::operator=(), and bpp::AbstractCoreSequence::setName().