84 unsigned int orfCpt = 0;
86 std::vector< std::vector<size_t> > starts(3), stops(3);
88 for (
size_t p = 0 ; p < seq.
size() - 2 ; p++) {
91 starts[phase].push_back(p);
94 stops[phase].push_back(p);
98 for (
size_t i = 0 ; i < 3 ; ++i) {
99 std::vector< size_t >::iterator start(starts[i].begin()), stop(stops[i].begin());
100 while (stop != stops[i].end() && start != starts[i].end()) {
101 if (*stop < *start) {
A very simple implementation of the SequenceFeature class.
int getCodon(int pos1, int pos2, int pos3) const
virtual const T & getValue(size_t pos) const=0
virtual const Alphabet * getAlphabet() const=0
virtual size_t size() const=0
const CodonAlphabet * getSourceAlphabet() const
virtual bool isStart(int state) const
virtual bool isStop(int state) const=0
a coordinate range on a sequence. Stores coordinates as a Range<size_t> object, but also keep the str...
virtual bool isNegativeStrand() const
A simple ensemble of sequence features.
void addFeature(const SequenceFeature &feature)
Add a feature to the container. The feature will be copied and the copy owned by the container.
virtual const std::string & getName() const=0