40 #ifndef _MAFSEQUENCE_H_ 41 #define _MAFSEQUENCE_H_ 43 #include "../../Feature/SequenceFeature.h" 45 #include <Bpp/Seq/SequenceWithAnnotation.h> 46 #include <Bpp/Seq/Alphabet/AlphabetTools.h> 47 #include <Bpp/Seq/SequenceTools.h> 63 public SequenceWithAnnotation
81 MafSequence(
const std::string& name,
const std::string& sequence,
bool parseName =
true):
84 size_ = SequenceTools::getNumberOfSites(*
this);
89 MafSequence(
const std::string& name,
const std::string& sequence,
size_t begin,
char strand,
size_t srcSize,
bool parseName =
true) :
92 size_ = SequenceTools::getNumberOfSites(*
this);
106 size_t start()
const throw (Exception) {
108 else throw Exception(
"MafSequence::start(). Sequence " + getName() +
" does not have coordinates.");
113 else throw Exception(
"MafSequence::stop(). Sequence " + getName() +
" does not have coordinates.");
123 if (origin &&
strand_ ==
'-') {
129 else throw Exception(
"MafSequence::getRange(). Sequence " + getName() +
" does not have coordinates.");
135 }
catch (Exception& e) {
139 SequenceWithAnnotation::setName(name);
143 size_t pos = name.find(
".");
144 if (pos != std::string::npos) {
145 chr = name.substr(pos + 1);
146 species = name.substr(0, pos);
148 throw Exception(
"MafSequence::splitNameIntospeciesAndChromosome(). Invalid sequence name: " + name);
202 #endif //_MAFSEQUENCE_H_ void afterSequenceChanged(const SymbolListEditionEvent &event)
void setName(const std::string &name)
MafSequence(const std::string &name, const std::string &sequence, size_t begin, char strand, size_t srcSize, bool parseName=true)
void beforeSequenceChanged(const SymbolListEditionEvent &event)
void afterSequenceDeleted(const SymbolListDeletionEvent &event)
bool hasCoordinates() const
const std::string & getSpecies() const
MafSequence(const std::string &name, const std::string &sequence, bool parseName=true)
void setChromosome(const std::string &chr)
void setStart(size_t begin)
static void splitNameIntoSpeciesAndChromosome(const std::string &name, std::string &species, std::string &chr)
size_t getGenomicSize() const
MafSequence * subSequence(size_t startAt, size_t length) const
Extract a sub-sequence.
size_t getSrcSize() const
void afterSequenceInserted(const SymbolListInsertionEvent &event)
void setSpecies(const std::string &species)
const std::string & getChromosome() const
MafSequence * clone() const
void beforeSequenceDeleted(const SymbolListDeletionEvent &event)
void setSrcSize(size_t srcSize)
void beforeSequenceInserted(const SymbolListInsertionEvent &event)
Range< size_t > getRange(bool origin=true) const
void afterSequenceSubstituted(const SymbolListSubstitutionEvent &event)
void beforeSequenceSubstituted(const SymbolListSubstitutionEvent &event)
A sequence class which is used to store data from MAF files.
std::string getDescription() const