42 #ifndef _MAPSEQUENCECONTAINER_H_ 43 #define _MAPSEQUENCECONTAINER_H_ 45 #include "../Alphabet/Alphabet.h" 46 #include "../Sequence.h" 123 void addSequence(const
std::
string& key, const
Sequence& sequence,
bool checkNames = true) throw (Exception);
135 std::
string getKey(
size_t pos) const throw (IndexOutOfBoundsException);
185 int&
operator()(
const std::string& sequenceName,
size_t elementIndex)
189 const int&
operator()(
const std::string & sequenceName,
size_t elementIndex)
const 194 int&
valueAt(
size_t sequenceIndex,
size_t elementIndex)
throw (IndexOutOfBoundsException)
198 const int&
valueAt(
size_t sequenceIndex,
size_t elementIndex)
const throw (IndexOutOfBoundsException)
206 const int&
operator()(
size_t sequenceIndex,
size_t elementIndex)
const 219 void setSequence(
size_t sequenceIndex,
const Sequence& sequence,
bool checkName =
true) throw (IndexOutOfBoundsException);
221 void deleteSequence(
size_t sequenceIndex) throw (IndexOutOfBoundsException);
222 void setComments(
size_t sequenceIndex, const
Comments& comments) throw (IndexOutOfBoundsException);
239 #endif // _MAPSEQUENCECONTAINER_H_ const int & valueAt(size_t sequenceIndex, size_t elementIndex) const
Element access operator.
Exception thrown when a sequence is not found The sequence not found exception base class...
size_t getNumberOfSequences() const
Get the number of sequences in the container.
std::vector< std::string > Comments
Declaration of Comments type.
size_t getSequencePosition(const std::string &name) const
Get the position of a sequence in sequence container from its name.
Sequence & getSequence_(size_t i)
int & operator()(size_t sequenceIndex, size_t elementIndex)
Element access operator.
void addSequence(const std::string &key, const Sequence &sequence, bool checkNames=true)
Add a sequence and key.
void clear()
Delete all sequences in the container.
const int & operator()(const std::string &sequenceName, size_t elementIndex) const
Element access operator.
int & valueAt(const std::string &sequenceName, size_t elementIndex)
Element access function.
std::string getKey(size_t pos) const
This alphabet is used to deal NumericAlphabet.
MapSequenceContainer(const Alphabet *alpha)
int & operator()(const std::string &sequenceName, size_t elementIndex)
Element access operator.
void deleteSequenceByKey(const std::string &key)
Delete a sequence.
Partial implementation of the OrderedSequenceContainer interface.
virtual const std::string & getName() const =0
Get the name of this sequence.
virtual ~MapSequenceContainer()
MapSequenceContainer class.
const Sequence & getSequenceByKey(const std::string &key) const
Get a sequence.
MapSequenceContainer(const std::map< std::string, Sequence *> &ms, const Alphabet *alpha)
const int & operator()(size_t sequenceIndex, size_t elementIndex) const
Element access operator.
const Sequence & getSequence(const std::string &name) const
Retrieve a sequence object from the container.
std::map< std::string, Sequence * > sequences_
void setComments(size_t sequenceIndex, const Comments &comments)
Set the comments of a particular sequence.
void addSequence(const Sequence &sequence, bool checkNames=true)
The SequenceContainer method. Calls the addSeqeucne(key, Sequence) method while using the resut of se...
std::vector< std::string > getSequencesNames() const
Get all the names of the sequences in the container.
const int & valueAt(const std::string &sequenceName, size_t elementIndex) const
Element access function.
int & valueAt(size_t sequenceIndex, size_t elementIndex)
Element access operator.
void setSequenceByKey(const std::string &key, const Sequence &sequence, bool checkNames=true)
Set a sequence.
MapSequenceContainer * clone() const
Sequence * removeSequence(const std::string &name)
Extract (and remove) a sequence from the container.
MapSequenceContainer & operator=(const MapSequenceContainer &msc)
void setSequence(const std::string &name, const Sequence &sequence, bool checkName=true)
Replace a sequence in the container.
void setSequencesNames(const std::vector< std::string > &names, bool checkNames)
Set all sequence names.
std::vector< std::string > getKeys() const
void deleteSequence(const std::string &name)
Delete a sequence of the container.
Sequence * removeSequenceByKey(const std::string &key)
Remove a sequence.
MapSequenceContainer * createEmptyContainer() const
Return a copy of this container, but with no sequence inside.
bool hasSequence(const std::string &name) const
Check if a sequence with a given name is present in the container.