40 #ifndef _VECTORSEQUENCECONTAINER_H_ 41 #define _VECTORSEQUENCECONTAINER_H_ 43 #include "../Alphabet/Alphabet.h" 44 #include "../Sequence.h" 46 #include <Bpp/Exceptions.h> 86 const std::vector<const Sequence*>& vs,
const Alphabet* alpha)
170 void setSequence(
const std::string& name,
const Sequence& sequence,
bool checkName =
true) throw (Exception)
188 void setSequencesNames(
const std::vector<std::string>& names,
bool checkNames =
true) throw (Exception);
202 int&
operator()(
const std::string& sequenceName,
size_t elementIndex)
207 const int&
operator()(
const std::string& sequenceName,
size_t elementIndex)
const 212 int&
valueAt(
size_t sequenceIndex,
size_t elementIndex)
throw (IndexOutOfBoundsException)
217 const int&
valueAt(
size_t sequenceIndex,
size_t elementIndex)
const throw (IndexOutOfBoundsException)
226 const int &
operator()(
size_t sequenceIndex,
size_t elementIndex)
const 243 void setComments(
size_t sequenceIndex,
const Comments& comments)
throw (IndexOutOfBoundsException);
246 void setSequence(
size_t sequenceIndex,
const Sequence& sequence,
bool checkName =
true) throw (Exception);
248 void deleteSequence(
size_t sequenceIndex) throw (IndexOutOfBoundsException);
271 virtual
void addSequence(const
Sequence& sequence,
bool checkName = true) throw (Exception);
289 virtual
void addSequence(const
Sequence& sequence,
size_t sequenceIndex,
bool checkName = true) throw (Exception);
305 #endif // _VECTORSEQUENCECONTAINER_H_ size_t getNumberOfSequences() const
Get the number of sequences in the container.
Exception thrown when a sequence is not found The sequence not found exception base class...
bool hasSequence(const std::string &name) const
Check if a sequence with a given name is present in the container.
VectorSequenceContainer & operator=(const VectorSequenceContainer &vsc)
Assign from a VectorSequenceContainer.
int & operator()(size_t sequenceIndex, size_t elementIndex)
Element access operator.
void setComments(const std::string &name, const Comments &comments)
Set the comments of a particular sequence.
std::vector< std::string > Comments
Declaration of Comments type.
void setComments(const std::string &name, const Comments &comments)
Set the comments of a particular sequence.
int & valueAt(const std::string &sequenceName, size_t elementIndex)
Element access function.
VectorSequenceContainer(const Alphabet *alpha)
Build an empty container that will contain sequences of a particular alphabet.
void deleteSequence(const std::string &name)
Delete a sequence of the container.
The OrderedSequenceContainer interface.
This alphabet is used to deal NumericAlphabet.
std::vector< Sequence * > sequences_
A std::vector of pointers toward the sequences stored in the container.
The VectorSequenceContainer class.
const int & valueAt(size_t sequenceIndex, size_t elementIndex) const
Element access operator.
Partial implementation of the OrderedSequenceContainer interface.
virtual void addSequence(const Sequence &sequence, bool checkName=true)
Add a sequence at the end of the container.
void setSequence(const std::string &name, const Sequence &sequence, bool checkName=true)
Replace a sequence in the container.
const int & operator()(size_t sequenceIndex, size_t elementIndex) const
Element access operator.
const int & operator()(const std::string &sequenceName, size_t elementIndex) const
Element access operator.
void setSequencesNames(const std::vector< std::string > &names, bool checkNames=true)
Set all sequence names.
const Sequence & getSequence(const std::string &name) const
Retrieve a sequence object from the container.
int & operator()(const std::string &sequenceName, size_t elementIndex)
Element access operator.
const int & valueAt(const std::string &sequenceName, size_t elementIndex) const
Element access function.
Sequence * removeSequence(const std::string &name)
Extract (and remove) a sequence from the container.
size_t getSequencePosition(const std::string &name) const
Get the position of a sequence in sequence container from its name.
int & valueAt(size_t sequenceIndex, size_t elementIndex)
Element access operator.
virtual ~VectorSequenceContainer()
Container destructor: delete all sequences in the container.
void clear()
Delete all sequences in the container.
std::vector< std::string > getSequencesNames() const
Get all the names of the sequences in the container.
Exception thrown when two alphabets do not match.
Sequence & getSequence_(size_t i)
VectorSequenceContainer(const std::vector< const Sequence *> &vs, const Alphabet *alpha)
Build a new container from a std::vector of pointers toward sequence objects.
VectorSequenceContainer * createEmptyContainer() const
Return a copy of this container, but with no sequence inside.
The SequenceContainer interface.