[Seqan-dev] changing intervals within IntervalTree
Hi everyone,
I am using an interval tree structure to work with genomic regions.
However, I am not sure what is the correct way to change or remove an
existing interval in the tree.
Here is the code example:
IntervalTree<int,long> intervals;
for (int i = 0, sz = candidates.size(); i < sz; ++i ) {
const BreakpointCandidate& c = candidates.at(i);
int queryStart = c.pos1;
int queryEnd = c.pos1 + c.length1 - 1;
String<long> res;
findIntervals(intervals, queryStart, queryEnd, res);
if (length(res) > 0) {
// TODO:
// replace the found interval with its union with query interval
} else {
addInterval(intervals, queryStart, queryEnd);
}
}
Should I directly modify the underlying graph structure in order to
implement the TODO comment? If yes, how can I access the corresponding
interval?
Or would it be better to change the behavior of addInterval() function?
Thanks in advance,
Konstantin