static const char* iupac_alphabet = "AaCcGgTtUuRrYyMmKkSsWwBbDdHhVvNn\012\015";
annot::annot()
- : start(0),
+ : begin(0),
end(0),
type(""),
name("")
{
}
-annot::annot(int start, int end, std::string type, std::string name)
- : start(start),
+annot::annot(int begin, int end, std::string type, std::string name)
+ : begin(begin),
end(end),
type(type),
name(name)
bool operator==(const annot& left, const annot& right)
{
- return ((left.start == right.start) and
+ return ((left.begin== right.begin) and
(left.end == right.end) and
(left.type == right.type) and
(left.name == right.name));
}
-motif::motif(int start, std::string motif)
- : annot(start, start+motif.size(), "motif", motif),
+motif::motif(int begin, std::string motif)
+ : annot(begin, begin+motif.size(), "motif", motif),
sequence(motif)
{
}
annot_i != annots.end();
++annot_i)
{
- int annot_start = annot_i->start;
+ int annot_begin= annot_i->begin;
int annot_end = annot_i->end;
- if (annot_start < end) {
- if (annot_start >=start) {
- annot_start -= start;
+ if (annot_begin < end) {
+ if (annot_begin >= start) {
+ annot_begin -= start;
} else {
- annot_start = 0;
+ annot_begin = 0;
}
if (annot_end < end) {
annot_end = count;
}
- annot new_annot(annot_start, annot_end, annot_i->type, annot_i->name);
+ annot new_annot(annot_begin, annot_end, annot_i->type, annot_i->name);
new_seq.annots.push_back(new_annot);
}
}
save_file << species << std::endl;
for (annots_i = annots.begin(); annots_i != annots.end(); ++annots_i)
{
- save_file << annots_i->start << " " << annots_i->end << " " ;
+ save_file << annots_i->begin << " " << annots_i->end << " " ;
save_file << annots_i->name << " " << annots_i->type << std::endl;
}
save_file << "</Annotations>" << std::endl;
// get annot start index
space_split_i = file_data_line.find(" ");
annot_value = file_data_line.substr(0,space_split_i);
- an_annot.start = atoi (annot_value.c_str());
+ an_annot.begin = atoi (annot_value.c_str());
file_data_line = file_data_line.substr(space_split_i+1);
// get annot end index
space_split_i = file_data_line.find(" ");