40 #ifndef _SEQUENCEWITHANNOTATION_H_ 41 #define _SEQUENCEWITHANNOTATION_H_ 52 class SequenceWithAnnotation;
73 virtual const std::string&
getType()
const = 0;
382 anno->isValidWith(*
this);
391 if (anno && anno->
getType() == type)
return true;
402 if (anno && anno->
getType() == type)
return *anno;
404 throw Exception(
"SequenceWithAnnotation::getAnnotation. No annotation found with type '" + type +
"'.");
412 if (anno && anno->
getType() == type)
return *anno;
414 throw Exception(
"SequenceWithAnnotation::getAnnotation. No annotation found with type '" + type +
"'.");
442 #endif // _SEQUENCEWITHANNOTATION_H_
An alphabet exception thrown when trying to specify a bad char to the alphabet.
std::vector< std::string > Comments
Declaration of Comments type.
virtual void setContent(const std::string &sequence)
Set the whole content of the sequence.
virtual SequenceAnnotation * clone() const =0
void setContent(const std::vector< std::string > &list)
Set the whole content of the list.
const Comments & getComments() const
Get the comments associated to this sequence.
virtual void setToSizeR(size_t newSize)
Set up the size of a sequence from the right side.
void setName(const std::string &name)
Set the name of this sequence.
virtual std::vector< std::string > getAnnotationTypes() const
virtual size_t getNumberOfListeners() const
This alphabet is used to deal NumericAlphabet.
virtual void setContent(const std::vector< int > &list)
Set the whole content of the list.
SequenceWithAnnotation(const Alphabet *alpha)
Empty constructor: build a void Sequence with just an Alphabet.
std::string name_
The sequence name.
void setComments(const Comments &comments)
Set the comments associated to this sequence.
virtual const std::string & getType() const =0
virtual void addAnnotation(SequenceAnnotation *anno)
Add a new annotation to the sequence.
virtual bool hasAnnotation(const std::string &type) const
virtual SequenceAnnotation * getPartAnnotation(size_t pos, size_t len) const =0
virtual void merge(const SequenceWithAnnotation &swa)
Merge a sequence with the current one.
void setContent(const std::vector< int > &list)
Set the whole content of the list.
virtual ~SequenceWithAnnotation()
virtual bool isValidWith(const SequenceWithAnnotation &sequence, bool throwException=true) const =0
Test is the annotation is valid for a given sequence.
virtual bool merge(const SequenceAnnotation &anno)=0
Merge the input annotation with the current one.
virtual void addSymbolListListener(SymbolListListener *listener)
virtual const SequenceAnnotation & getAnnotation(const std::string &type) const
Interface for sequence annotations.
virtual SequenceAnnotation & getAnnotation(const std::string &type)
An implementation of the Sequence interface that supports annotation.
SequenceWithAnnotation * clone() const
virtual void setToSizeL(size_t newSize)
Set up the size of a sequence from the left side.
SequenceWithAnnotation & operator=(const Sequence &s)
The Sequence generic assignment operator. This does not perform a hard copy of the alphabet object...
Comments comments_
The sequence comments.
An alphabet exception thrown when trying to specify a bad int to the alphabet.
A event-driven SymbolList object.
virtual const SymbolListListener & getListener(size_t i) const
const std::string & getName() const
Get the name of this sequence.
Exception thrown when two alphabets do not match.
virtual void init(const Sequence &seq)=0
void append(const std::vector< int > &content)
Append the specified content to the sequence.