40 #ifndef _MAFSEQUENCE_H_
41 #define _MAFSEQUENCE_H_
43 #include "../../Feature/SequenceFeature.h"
118 else throw Exception(
"MafSequence::start(). Sequence " +
getName() +
" does not have coordinates.");
123 else throw Exception(
"MafSequence::stop(). Sequence " +
getName() +
" does not have coordinates.");
133 if (origin &&
strand_ ==
'-') {
139 else throw Exception(
"MafSequence::getRange(). Sequence " +
getName() +
" does not have coordinates.");
153 size_t pos = name.find(
".");
154 if (pos != std::string::npos) {
155 chr = name.substr(pos + 1);
156 species = name.substr(0, pos);
158 throw Exception(
"MafSequence::splitNameIntospeciesAndChromosome(). Invalid sequence name: " + name);
A sequence class which is used to store data from MAF files.
std::string getDescription() const
void setChromosome(const std::string &chr)
void setName(const std::string &name)
MafSequence * clone() const
void afterSequenceChanged(const IntSymbolListEditionEvent &event)
void afterSequenceDeleted(const IntSymbolListDeletionEvent &event)
const std::string & getChromosome() const
const std::string & getSpecies() const
void setSrcSize(size_t srcSize)
void setStart(size_t begin)
void beforeSequenceDeleted(const IntSymbolListDeletionEvent &event)
bool hasCoordinates() const
static void splitNameIntoSpeciesAndChromosome(const std::string &name, std::string &species, std::string &chr)
size_t getSrcSize() const
MafSequence(const std::string &name, const std::string &sequence, size_t begin, char strand, size_t srcSize, bool parseName=true, const Alphabet *alphabet=&AlphabetTools::DNA_ALPHABET)
Range< size_t > getRange(bool origin=true) const
MafSequence * subSequence(size_t startAt, size_t length) const
Extract a sub-sequence.
void afterSequenceInserted(const IntSymbolListInsertionEvent &event)
void beforeSequenceSubstituted(const IntSymbolListSubstitutionEvent &event)
MafSequence(const Alphabet *alphabet=&AlphabetTools::DNA_ALPHABET)
MafSequence * cloneMeta() const
void setSpecies(const std::string &species)
size_t getGenomicSize() const
MafSequence(const std::string &name, const std::string &sequence, bool parseName=true, const Alphabet *alphabet=&AlphabetTools::DNA_ALPHABET)
void beforeSequenceInserted(const IntSymbolListInsertionEvent &event)
void afterSequenceSubstituted(const IntSymbolListSubstitutionEvent &event)
void beforeSequenceChanged(const IntSymbolListEditionEvent &event)
void setName(const std::string &name)
const std::string & getName() const
std::string toString(T t)