bpp-seq3
3.0.0
|
MapSequenceContainer class. More...
#include <Bpp/Seq/Container/MapSequenceContainer.h>
Public Member Functions | |
MapSequenceContainer (const std::map< std::string, Sequence * > &ms, const Alphabet *alpha) | |
MapSequenceContainer (const Alphabet *alpha) | |
MapSequenceContainer (const MapSequenceContainer &msc) | |
MapSequenceContainer & | operator= (const MapSequenceContainer &msc) |
virtual | ~MapSequenceContainer () |
const Sequence & | getSequenceByKey (const std::string &key) const |
Get a sequence. More... | |
void | setSequenceByKey (const std::string &key, const Sequence &sequence, bool checkNames=true) |
Set a sequence. More... | |
Sequence * | removeSequenceByKey (const std::string &key) |
Remove a sequence. More... | |
void | deleteSequenceByKey (const std::string &key) |
Delete a sequence. More... | |
void | addSequence (const std::string &key, const Sequence &sequence, bool checkNames=true) |
Add a sequence and key. More... | |
std::vector< std::string > | getKeys () const |
std::string | getKey (size_t pos) const |
std::string | getKey (const std::string &name) const |
std::string | toString (const std::string &name) const |
Convert a particular sequence to a string. More... | |
const Comments & | getComments (const std::string &name) const |
Get comments of a particular sequence. More... | |
const Comments & | getComments () const |
Get the comments. More... | |
void | setComments (const std::string &name, const Comments &comments) |
Set the comments of a particular sequence. More... | |
void | setComments (const Comments &comments) |
Set the comments. More... | |
virtual const Alphabet * | getAlphabet () const =0 |
Get container's alphabet. More... | |
virtual double | getStateValueAt (size_t siteIndex, const std::string &sequenceName, int state) const=0 |
get value of a state in a position More... | |
virtual const Comments & | getGeneralComments () const =0 |
Get the comments of this container. More... | |
virtual void | setGeneralComments (const Comments &comments)=0 |
Set the comments of this container. More... | |
virtual void | deleteGeneralComments ()=0 |
Delete the comments associated to this container. More... | |
void | clearComments () |
The clonable interface | |
MapSequenceContainer * | clone () const |
The SequenceContainer interface implementation: | |
const Sequence & | getSequence (const std::string &name) const |
Retrieve a sequence object from the container. More... | |
bool | hasSequence (const std::string &name) const |
Check if a sequence with a given name is present in the container. More... | |
void | addSequence (const Sequence &sequence, bool checkNames=true) |
The SequenceContainer method. Calls the addSeqeucne(key, Sequence) method while using the resut of sequence.getName() as a key. More... | |
void | setSequence (const std::string &name, const Sequence &sequence, bool checkName=true) |
Replace a sequence in the container. More... | |
Sequence * | removeSequence (const std::string &name) |
Extract (and remove) a sequence from the container. More... | |
void | deleteSequence (const std::string &name) |
size_t | getNumberOfSequences () const |
Get the number of sequences in the container. More... | |
void | clear () |
Delete all data in the container. More... | |
MapSequenceContainer * | createEmptyContainer () const |
Return a copy of this container, but with no data inside. More... | |
int & | valueAt (const std::string &sequenceName, size_t elementIndex) |
Element access function. More... | |
const int & | valueAt (const std::string &sequenceName, size_t elementIndex) const |
Element access function. More... | |
int & | operator() (const std::string &sequenceName, size_t elementIndex) |
Element access operator. More... | |
const int & | operator() (const std::string &sequenceName, size_t elementIndex) const |
Element access operator. More... | |
int & | valueAt (size_t sequenceIndex, size_t elementIndex) |
Element access operator. More... | |
const int & | valueAt (size_t sequenceIndex, size_t elementIndex) const |
Element access operator. More... | |
int & | operator() (size_t sequenceIndex, size_t elementIndex) |
Element access operator. More... | |
const int & | operator() (size_t sequenceIndex, size_t elementIndex) const |
Element access operator. More... | |
The OrderedSequenceContainer interface implementation: | |
const Sequence & | getSequence (size_t sequenceIndex) const |
Retrieve a sequence object from the container. More... | |
size_t | getSequencePosition (const std::string &name) const |
Get the position of a sequence in sequence container from its name. More... | |
void | setSequence (size_t sequenceIndex, const Sequence &sequence, bool checkName=true) |
Replace a sequence in the container. More... | |
Sequence * | removeSequence (size_t sequenceIndex) |
Extract (and remove) a sequence from the container. More... | |
void | deleteSequence (size_t sequenceIndex) |
void | setComments (size_t sequenceIndex, const Comments &comments) |
std::vector< std::string > | getSequencesNames () const |
Get all the names of the sequences in the container. More... | |
void | setSequencesNames (const std::vector< std::string > &names, bool checkNames) |
Set all sequence names. More... | |
AbstractSequenceContainer methods. | |
Sequence & | getSequence_ (size_t i) |
Sequence & | getSequence_ (const std::string &name) |
SequencedValuesContainer methods. | |
double | getStateValueAt (size_t siteIndex, const std::string &sequenceName, int state) const |
get value of a state in a position More... | |
double | operator() (size_t siteIndex, const std::string &sequenceName, int state) const |
OrderedValuesContainer methods. | |
double | getStateValueAt (size_t siteIndex, size_t sequenceIndex, int state) const |
double | operator() (size_t siteIndex, size_t sequenceIndex, int state) const |
From the OrderedSequenceContainer interface | |
virtual std::string | toString (size_t sequenceIndex) const |
virtual const Comments & | getComments (size_t sequenceIndex) const |
virtual const std::string & | getName (size_t sequenceIndex) const |
Get the name of a particular row of the alignement (aka sequence). More... | |
SequenceContainer methods. | |
virtual std::string | toString (size_t sequenceIndex) const=0 |
virtual const Comments & | getComments (size_t sequenceIndex) const=0 |
virtual void | setComments (size_t sequenceIndex, const Comments &comments)=0 |
From the SequencedValuesContainer interface | |
const Alphabet * | getAlphabet () const |
Get container's alphabet. More... | |
const Comments & | getGeneralComments () const |
Get the comments of this container. More... | |
void | setGeneralComments (const Comments &comments) |
Set the comments of this container. More... | |
void | deleteGeneralComments () |
Delete the comments associated to this container. More... | |
Protected Attributes | |
const Alphabet * | alphabet_ |
The container's alphabet. More... | |
Comments | comments_ |
Private Attributes | |
std::map< std::string, Sequence * > | sequences_ |
MapSequenceContainer class.
Sequences are stored using a key std::string, in a map object. Sequences are ordered according to the key order (defined by the < operator).
Definition at line 63 of file MapSequenceContainer.h.
MapSequenceContainer::MapSequenceContainer | ( | const std::map< std::string, Sequence * > & | ms, |
const Alphabet * | alpha | ||
) |
Definition at line 52 of file MapSequenceContainer.cpp.
References addSequence().
Referenced by clone(), and createEmptyContainer().
|
inline |
Definition at line 71 of file MapSequenceContainer.h.
MapSequenceContainer::MapSequenceContainer | ( | const MapSequenceContainer & | msc | ) |
Definition at line 63 of file MapSequenceContainer.cpp.
References addSequence(), getKey(), getNumberOfSequences(), and getSequence().
|
virtual |
Definition at line 91 of file MapSequenceContainer.cpp.
References clear().
|
inlinevirtual |
The SequenceContainer method. Calls the addSeqeucne(key, Sequence) method while using the resut of sequence.getName() as a key.
Implements bpp::SequencedValuesContainer.
Definition at line 160 of file MapSequenceContainer.h.
References addSequence(), and bpp::Sequence::getName().
void MapSequenceContainer::addSequence | ( | const std::string & | key, |
const Sequence & | sequence, | ||
bool | checkNames = true |
||
) |
Add a sequence and key.
key | The key of the new sequence. |
sequence | The new sequence that will be associated to the key. |
checkNames | Tell is the sequence name must be checked. |
Definition at line 367 of file MapSequenceContainer.cpp.
References bpp::Sequence::clone(), bpp::AbstractValuesContainer::getAlphabet(), bpp::CruxSymbolList::getAlphabet(), bpp::Alphabet::getAlphabetType(), bpp::Sequence::getName(), and sequences_.
Referenced by addSequence(), MapSequenceContainer(), and operator=().
|
virtual |
Delete all data in the container.
Implements bpp::SequencedValuesContainer.
Definition at line 488 of file MapSequenceContainer.cpp.
References sequences_.
Referenced by operator=(), and ~MapSequenceContainer().
|
inlineinherited |
Definition at line 100 of file Commentable.h.
References bpp::Commentable::comments_.
Referenced by bpp::BasicSequence::clearComments(), bpp::SequenceWithAnnotation::clearComments(), bpp::SequenceWithQuality::clearComments(), bpp::AbstractProbabilisticSequenceContainer::deleteGeneralComments(), and bpp::AbstractValuesContainer::deleteGeneralComments().
|
inlinevirtual |
Implements bpp::OrderedValuesContainer.
Definition at line 143 of file MapSequenceContainer.h.
References MapSequenceContainer().
|
virtual |
Return a copy of this container, but with no data inside.
This method creates a new SequencedValuesContainer objet. The class of this container depends on the derivative class.
Implements bpp::SequencedValuesContainer.
Definition at line 501 of file MapSequenceContainer.cpp.
References bpp::AbstractValuesContainer::getAlphabet(), and MapSequenceContainer().
|
inlinevirtualinherited |
Delete the comments associated to this container.
Implements bpp::SequencedValuesContainer.
Definition at line 115 of file AbstractValuesContainer.h.
References bpp::Commentable::clearComments().
|
pure virtualinherited |
Delete the comments associated to this container.
Implemented in bpp::AbstractValuesContainer, and bpp::AbstractProbabilisticSequenceContainer.
void MapSequenceContainer::deleteSequence | ( | const std::string & | name | ) |
Definition at line 340 of file MapSequenceContainer.cpp.
References sequences_.
void MapSequenceContainer::deleteSequence | ( | size_t | sequenceIndex | ) |
Definition at line 325 of file MapSequenceContainer.cpp.
References sequences_.
void MapSequenceContainer::deleteSequenceByKey | ( | const std::string & | key | ) |
Delete a sequence.
key | The key of the sequence. |
Definition at line 356 of file MapSequenceContainer.cpp.
References sequences_.
|
inlinevirtualinherited |
Get container's alphabet.
Implements bpp::SequencedValuesContainer.
Definition at line 99 of file AbstractValuesContainer.h.
References bpp::AbstractValuesContainer::alphabet_.
Referenced by bpp::VectorSequenceContainer::addSequence(), bpp::VectorSiteContainer::addSequence(), addSequence(), bpp::VectorProbabilisticSiteContainer::addSequence(), bpp::CompressedVectorSiteContainer::addSite(), bpp::AlignedSequenceContainer::addSite(), bpp::VectorSiteContainer::addSite(), bpp::Pasta::appendSequencesFromStream(), bpp::VectorProbabilisticSiteContainer::appendSite(), bpp::CompressedVectorSiteContainer::CompressedVectorSiteContainer(), bpp::AlignedSequenceContainer::createEmptyContainer(), bpp::CompressedVectorSiteContainer::createEmptyContainer(), createEmptyContainer(), bpp::VectorProbabilisticSiteContainer::createEmptyContainer(), bpp::VectorSequenceContainer::createEmptyContainer(), bpp::VectorSiteContainer::createEmptyContainer(), bpp::CompressedVectorSiteContainer::getSequence(), bpp::VectorSiteContainer::getSequence(), bpp::VectorProbabilisticSiteContainer::getSequence(), bpp::AlignedSequenceContainer::getSite(), bpp::CompressedVectorSiteContainer::getStateValueAt(), bpp::VectorSiteContainer::getStateValueAt(), getStateValueAt(), bpp::VectorSequenceContainer::getStateValueAt(), bpp::CompressedVectorSiteContainer::operator()(), bpp::VectorSiteContainer::operator()(), operator()(), bpp::VectorSequenceContainer::operator()(), bpp::CompressedVectorSiteContainer::operator=(), bpp::VectorSiteContainer::realloc(), bpp::VectorSiteContainer::setSequence(), setSequence(), bpp::VectorSequenceContainer::setSequence(), setSequenceByKey(), bpp::AlignedSequenceContainer::setSite(), bpp::CompressedVectorSiteContainer::setSite(), and bpp::VectorSiteContainer::setSite().
|
pure virtualinherited |
Get container's alphabet.
Implemented in bpp::AbstractValuesContainer.
Referenced by bpp::Clustal::appendAlignmentFromStream(), bpp::DCSE::appendAlignmentFromStream(), bpp::NexusIOSequence::appendAlignmentFromStream(), bpp::Fasta::appendSequencesFromStream(), bpp::GenBank::appendSequencesFromStream(), bpp::Mase::appendSequencesFromStream(), bpp::SiteContainerTools::changeGapsToUnknownCharacters(), bpp::SiteContainerTools::changeUnresolvedCharactersToGaps(), bpp::SequenceContainerTools::convertAlphabet(), bpp::SequenceContainerTools::getCodonPosition(), bpp::SiteContainerTools::getCompleteSites(), bpp::SiteContainerTools::getConsensus(), bpp::SequenceContainerTools::getFrequencies(), bpp::SiteContainerTools::getSelectedPositions(), bpp::MaseTools::getSelectedSequences(), bpp::SiteContainerTools::getSelectedSites(), bpp::SiteContainerTools::getSequencePositions(), bpp::SequenceApplicationTools::getSitesToAnalyse(), bpp::SiteContainerTools::getSitesWithoutGaps(), bpp::SequenceContainerTools::merge(), bpp::SiteContainerTools::merge(), bpp::AbstractSequenceContainer::operator=(), bpp::Phylip::readInterleaved(), bpp::Phylip::readSequential(), bpp::SiteContainerTools::removeGapOnlySites(), bpp::SiteContainerTools::removeGapOrUnresolvedOnlySites(), bpp::SiteContainerTools::removeGapSites(), bpp::SiteContainerTools::removeStopCodonSites(), bpp::SiteContainerTools::resolveDottedAlignment(), bpp::SiteContainerTools::sampleSites(), bpp::VectorProbabilisticSiteContainer::VectorProbabilisticSiteContainer(), bpp::VectorSiteContainer::VectorSiteContainer(), bpp::Pasta::writeAlignedValues(), bpp::Phylip::writeInterleaved(), and bpp::Phylip::writeSequential().
|
inlineinherited |
Get the comments.
Definition at line 91 of file Commentable.h.
References bpp::Commentable::comments_.
Referenced by bpp::AbstractCoreSequence::getComments(), bpp::BasicSequence::getComments(), bpp::SequenceWithAnnotation::getComments(), bpp::SequenceWithQuality::getComments(), bpp::AbstractProbabilisticSequenceContainer::getGeneralComments(), bpp::AbstractValuesContainer::getGeneralComments(), and bpp::VectorProbabilisticSiteContainer::getSequence().
|
inlinevirtualinherited |
Get comments of a particular sequence.
name | The name of the sequence. |
SequenceNotFoundException | If the name does not match any sequence in the container. |
Implements bpp::OrderedSequenceContainer.
Definition at line 111 of file AbstractSequenceContainer.h.
References bpp::Sequence::getComments(), and bpp::OrderedSequenceContainer::getSequence().
|
inlinevirtualinherited |
Implements bpp::AbstractValuesContainer.
Definition at line 137 of file AbstractSequenceContainer.h.
References bpp::Sequence::getComments(), and bpp::OrderedSequenceContainer::getSequence().
|
inherited |
|
inlinevirtualinherited |
Get the comments of this container.
Implements bpp::SequencedValuesContainer.
Definition at line 101 of file AbstractValuesContainer.h.
References bpp::Commentable::getComments().
Referenced by bpp::AlignedSequenceContainer::createEmptyContainer(), bpp::CompressedVectorSiteContainer::createEmptyContainer(), bpp::VectorSequenceContainer::createEmptyContainer(), and bpp::VectorSiteContainer::createEmptyContainer().
|
pure virtualinherited |
Get the comments of this container.
Implemented in bpp::AbstractValuesContainer, and bpp::AbstractProbabilisticSequenceContainer.
Referenced by bpp::AlignedSequenceContainer::AlignedSequenceContainer(), bpp::Mase::appendSequencesFromStream(), bpp::MaseTools::getSelectedSequences(), bpp::SiteContainerTools::getSelectedSites(), bpp::MaseTools::getSelectedSites(), bpp::AbstractSequenceContainer::operator=(), bpp::VectorSequenceContainer::VectorSequenceContainer(), bpp::Stockholm::writeAlignment(), bpp::Fasta::writeSequences(), and bpp::Mase::writeSequences().
string MapSequenceContainer::getKey | ( | const std::string & | name | ) | const |
name | The name of the sequence. |
Definition at line 422 of file MapSequenceContainer.cpp.
References getKey(), bpp::SequenceNotFoundException::getSequenceId(), and getSequencePosition().
string MapSequenceContainer::getKey | ( | size_t | pos | ) | const |
pos | The index of the sequence. |
Definition at line 408 of file MapSequenceContainer.cpp.
References getNumberOfSequences(), and sequences_.
Referenced by getKey(), MapSequenceContainer(), and setSequence().
vector< string > MapSequenceContainer::getKeys | ( | ) | const |
Definition at line 396 of file MapSequenceContainer.cpp.
References sequences_.
Referenced by operator=().
|
inlinevirtualinherited |
Get the name of a particular row of the alignement (aka sequence).
sequenceIndex | The position of the sequence. |
IndexOutOfBoundsException | If the position does not match any sequence in the container. |
Implements bpp::OrderedValuesContainer.
Definition at line 127 of file AbstractSequenceContainer.h.
References bpp::Sequence::getName(), and bpp::OrderedSequenceContainer::getSequence().
Referenced by bpp::CompressedVectorSiteContainer::getSequence().
|
inlinevirtual |
Get the number of sequences in the container.
Implements bpp::OrderedSequenceContainer.
Definition at line 167 of file MapSequenceContainer.h.
References sequences_.
Referenced by getKey(), getStateValueAt(), MapSequenceContainer(), operator=(), setComments(), and setSequencesNames().
|
virtual |
Retrieve a sequence object from the container.
name | The name of the sequence. |
Implements bpp::OrderedSequenceContainer.
Definition at line 115 of file MapSequenceContainer.cpp.
References sequences_.
Referenced by getStateValueAt(), MapSequenceContainer(), operator()(), operator=(), and valueAt().
|
virtual |
Retrieve a sequence object from the container.
sequenceIndex | The position of the sequence. |
Implements bpp::OrderedSequenceContainer.
Definition at line 98 of file MapSequenceContainer.cpp.
References sequences_.
Sequence & MapSequenceContainer::getSequence_ | ( | const std::string & | name | ) |
Definition at line 155 of file MapSequenceContainer.cpp.
References sequences_.
Sequence & MapSequenceContainer::getSequence_ | ( | size_t | i | ) |
Definition at line 141 of file MapSequenceContainer.cpp.
References sequences_.
Referenced by operator()(), and valueAt().
const Sequence & MapSequenceContainer::getSequenceByKey | ( | const std::string & | key | ) | const |
Get a sequence.
key | The key of the sequence to retrieve. |
Definition at line 168 of file MapSequenceContainer.cpp.
References sequences_.
|
virtual |
Get the position of a sequence in sequence container from its name.
name | The name of the sequence. |
SequenceNotFoundException | If no sequence with name 'name' could be found. |
Implements bpp::OrderedValuesContainer.
Definition at line 178 of file MapSequenceContainer.cpp.
References sequences_.
Referenced by getKey().
|
virtual |
Get all the names of the sequences in the container.
Implements bpp::OrderedSequenceContainer.
Definition at line 450 of file MapSequenceContainer.cpp.
References sequences_.
|
inlinevirtual |
get value of a state in a position
siteIndex | index of the site |
sequenceName | name of the sequence in the container |
state | state in the alphabet |
Implements bpp::SequencedValuesContainer.
Definition at line 235 of file MapSequenceContainer.h.
References getSequence(), and bpp::CruxSymbolList::getStateValueAt().
|
inherited |
get value of a state in a position
siteIndex | index of the site |
sequenceName | name of the sequence in the container |
state | state in the alphabet |
|
inlinevirtual |
Implements bpp::OrderedValuesContainer.
Definition at line 256 of file MapSequenceContainer.h.
References bpp::AbstractValuesContainer::getAlphabet(), getNumberOfSequences(), getSequence(), bpp::Alphabet::isResolvedIn(), and bpp::CruxSymbolList::size().
|
virtual |
Check if a sequence with a given name is present in the container.
name | The name of the sequence. |
Implements bpp::SequencedValuesContainer.
Definition at line 128 of file MapSequenceContainer.cpp.
References sequences_.
|
inlinevirtual |
Element access operator.
Allows direct access to the data stored in the container. This method is faster then the valueAt function, but input parameters are not checked!
sequenceName | The sequence name. |
elementIndex | The element position within the sequence. |
Implements bpp::SequenceContainer.
Definition at line 179 of file MapSequenceContainer.h.
References getSequence_().
|
inlinevirtual |
Element access operator.
Allows direct access to the data stored in the container. This method is faster then the valueAt function, but input parameters are not checked!
sequenceName | The sequence name. |
elementIndex | The element position within the sequence. |
Implements bpp::SequenceContainer.
Definition at line 183 of file MapSequenceContainer.h.
References getSequence().
|
inlinevirtual |
Element access operator.
Allows direct access to the data stored in the container. This method is faster then the valueAt function, but input parameters are not checked!
sequenceIndex | The sequence position. |
elementIndex | The element position within the sequence. |
Implements bpp::OrderedSequenceContainer.
Definition at line 196 of file MapSequenceContainer.h.
References getSequence_().
|
inlinevirtual |
Element access operator.
Allows direct access to the data stored in the container. This method is faster then the valueAt function, but input parameters are not checked!
sequenceIndex | The sequence position. |
elementIndex | The element position within the sequence. |
Implements bpp::OrderedSequenceContainer.
Definition at line 200 of file MapSequenceContainer.h.
References getSequence().
|
inlinevirtual |
Implements bpp::SequencedValuesContainer.
Definition at line 240 of file MapSequenceContainer.h.
References getSequence().
|
inlinevirtual |
Implements bpp::OrderedValuesContainer.
Definition at line 267 of file MapSequenceContainer.h.
References bpp::AbstractValuesContainer::getAlphabet(), getSequence(), and bpp::Alphabet::isResolvedIn().
MapSequenceContainer & MapSequenceContainer::operator= | ( | const MapSequenceContainer & | msc | ) |
Definition at line 74 of file MapSequenceContainer.cpp.
References addSequence(), clear(), getKeys(), getNumberOfSequences(), getSequence(), and bpp::AbstractSequenceContainer::operator=().
|
virtual |
Extract (and remove) a sequence from the container.
name | The name of the sequence. |
Implements bpp::OrderedSequenceContainer.
Definition at line 296 of file MapSequenceContainer.cpp.
References sequences_.
|
virtual |
Extract (and remove) a sequence from the container.
sequenceIndex | The position of the sequence. |
Implements bpp::OrderedSequenceContainer.
Definition at line 280 of file MapSequenceContainer.cpp.
References sequences_.
Sequence * MapSequenceContainer::removeSequenceByKey | ( | const std::string & | key | ) |
Remove a sequence.
key | The key of the sequence. |
Definition at line 312 of file MapSequenceContainer.cpp.
References sequences_.
|
inlineinherited |
Set the comments.
comments | The new comments. |
Definition at line 98 of file Commentable.h.
References bpp::Commentable::comments_.
Referenced by bpp::AbstractCoreSequence::operator=(), bpp::AbstractCoreSequence::setComments(), bpp::BasicSequence::setComments(), bpp::SequenceWithAnnotation::setComments(), bpp::SequenceWithQuality::setComments(), bpp::AbstractProbabilisticSequenceContainer::setGeneralComments(), and bpp::AbstractValuesContainer::setGeneralComments().
|
inlinevirtualinherited |
Set the comments of a particular sequence.
name | The name of the sequence. |
comments | The comments to set to sequence with name 'name'. |
SequenceNotFoundException | If the name does not match any sequence in the container. |
Implements bpp::OrderedSequenceContainer.
Definition at line 116 of file AbstractSequenceContainer.h.
References bpp::OrderedValuesContainer::getSequencePosition(), and bpp::OrderedSequenceContainer::setComments().
|
virtual |
Implements bpp::AbstractSequenceContainer.
Definition at line 436 of file MapSequenceContainer.cpp.
References getNumberOfSequences(), and sequences_.
|
inherited |
Referenced by bpp::AbstractSequenceContainer::setComments().
|
inlinevirtualinherited |
Set the comments of this container.
comments | The comments to be associated to this container. |
Implements bpp::SequencedValuesContainer.
Definition at line 106 of file AbstractValuesContainer.h.
References bpp::Commentable::setComments().
Referenced by bpp::AlignedSequenceContainer::AlignedSequenceContainer(), bpp::AlignedSequenceContainer::createEmptyContainer(), bpp::CompressedVectorSiteContainer::createEmptyContainer(), bpp::VectorSequenceContainer::createEmptyContainer(), bpp::VectorSiteContainer::createEmptyContainer(), bpp::SiteContainerTools::getSelectedSites(), bpp::AbstractSequenceContainer::operator=(), and bpp::VectorSequenceContainer::VectorSequenceContainer().
|
pure virtualinherited |
Set the comments of this container.
comments | The comments to be associated to this container. |
Implemented in bpp::AbstractValuesContainer, and bpp::AbstractProbabilisticSequenceContainer.
Referenced by bpp::Clustal::appendAlignmentFromStream(), bpp::Fasta::appendSequencesFromStream(), and bpp::Mase::appendSequencesFromStream().
|
virtual |
Replace a sequence in the container.
name | The name of the sequence. |
sequence | The sequence to add. |
checkName | Tell if the container must check if the name of the sequence is already used in the container before adding it. |
Implements bpp::OrderedSequenceContainer.
Definition at line 224 of file MapSequenceContainer.cpp.
References bpp::Sequence::clone(), bpp::AbstractValuesContainer::getAlphabet(), bpp::CruxSymbolList::getAlphabet(), bpp::Alphabet::getAlphabetType(), and sequences_.
|
virtual |
Replace a sequence in the container.
sequenceIndex | The position of the sequence. |
sequence | The sequence to add. |
checkName | Tell if the container must check if the name of the sequence is already used in the container before adding it. |
Implements bpp::OrderedSequenceContainer.
Definition at line 194 of file MapSequenceContainer.cpp.
References bpp::Sequence::clone(), bpp::AbstractValuesContainer::getAlphabet(), bpp::CruxSymbolList::getAlphabet(), bpp::Alphabet::getAlphabetType(), getKey(), bpp::Sequence::getName(), and sequences_.
void MapSequenceContainer::setSequenceByKey | ( | const std::string & | key, |
const Sequence & | sequence, | ||
bool | checkNames = true |
||
) |
Set a sequence.
key | The key of the sequence. |
sequence | The new sequence that will be associated to the key. |
checkNames | Tell is the sequence name must be checked. |
Definition at line 252 of file MapSequenceContainer.cpp.
References bpp::Sequence::clone(), bpp::AbstractValuesContainer::getAlphabet(), bpp::CruxSymbolList::getAlphabet(), bpp::Alphabet::getAlphabetType(), bpp::Sequence::getName(), and sequences_.
|
virtual |
Set all sequence names.
names | A vector of strings with all sequence names. Its size must be strictly equal to the the size of the container (the number of sequences). |
checkNames | Tell if the container must check if the name of the sequence is already used in the container before adding it. |
Exception | If there are redundant names in the input vector. |
Implements bpp::OrderedSequenceContainer.
Definition at line 462 of file MapSequenceContainer.cpp.
References getNumberOfSequences(), and sequences_.
|
inlinevirtualinherited |
Convert a particular sequence to a string.
name | The name of the sequence. |
SequenceNotFoundException | If the name does not match any sequence in the container. |
Implements bpp::OrderedSequenceContainer.
Definition at line 106 of file AbstractSequenceContainer.h.
References bpp::OrderedSequenceContainer::getSequence(), and bpp::CruxSymbolList::toString().
|
inlinevirtualinherited |
Implements bpp::OrderedValuesContainer.
Definition at line 132 of file AbstractSequenceContainer.h.
References bpp::OrderedSequenceContainer::getSequence(), and bpp::CruxSymbolList::toString().
|
inherited |
|
inlinevirtual |
Element access function.
Allows direct access to the data stored in the container.
sequenceName | The sequence name. |
elementIndex | The element position within the sequence. |
Implements bpp::OrderedSequenceContainer.
Definition at line 171 of file MapSequenceContainer.h.
References getSequence_().
|
inlinevirtual |
Element access function.
Allows direct access to the data stored in the container.
sequenceName | The sequence name. |
elementIndex | The element position within the sequence. |
Implements bpp::OrderedSequenceContainer.
Definition at line 175 of file MapSequenceContainer.h.
References getSequence().
|
inlinevirtual |
Element access operator.
Allows direct access to the data stored in the container.
sequenceIndex | The sequence position. |
elementIndex | The element position within the sequence. |
Implements bpp::OrderedSequenceContainer.
Definition at line 188 of file MapSequenceContainer.h.
References getSequence_().
|
inlinevirtual |
Element access operator.
Allows direct access to the data stored in the container.
sequenceIndex | The sequence position. |
elementIndex | The element position within the sequence. |
Implements bpp::OrderedSequenceContainer.
Definition at line 192 of file MapSequenceContainer.h.
References getSequence().
|
protectedinherited |
The container's alphabet.
Definition at line 64 of file AbstractValuesContainer.h.
Referenced by bpp::AbstractValuesContainer::getAlphabet(), bpp::AbstractValuesContainer::operator=(), and bpp::AbstractSequenceContainer::operator=().
|
protectedinherited |
Definition at line 62 of file Commentable.h.
Referenced by bpp::Commentable::clearComments(), bpp::Commentable::getComments(), bpp::Commentable::operator=(), and bpp::Commentable::setComments().
|
private |
Definition at line 67 of file MapSequenceContainer.h.
Referenced by addSequence(), clear(), deleteSequence(), deleteSequenceByKey(), getKey(), getKeys(), getNumberOfSequences(), getSequence(), getSequence_(), getSequenceByKey(), getSequencePosition(), getSequencesNames(), hasSequence(), removeSequence(), removeSequenceByKey(), setComments(), setSequence(), setSequenceByKey(), and setSequencesNames().