interval indexes: error with start=0, end=0

Issue #22 resolved
Former user created an issue

This results in an error:

{{{
from bx import interval_index_file
indexes = interval_index_file.Indexes()
indexes.add("troll.chr1", 0, 0, 123, 100)
}}}

These don't:

{{{
indexes.add("troll.chr1", 1, 1, 123, 100)
indexes.add("troll.chr1", 0, 1, 123, 100)
}}}

Marc

Comments (2)

  1. Bob Harris

    In that fix, Exceptionn seems to be misspeltt.

    While the test for an empty interval resolves this issue, I couldn't figure out why an interval of (1,1) was working (or, wasn't causing a failure) while (0,0) wasn't. I don't know if that difference is important or unimportant. But if (1,1) was legit, then so should be (0,0). So, I am wondering if this fix could introduce a problem if the empty interval was right at a bin boundary. The fix treats any empty interval as a interval with length 1. E.g. previously the interval with start=end=262144 went through the now-altered line as (start_bin,end_bin) = (262144,262143), now it goes through it as (start_bin,end_bin) = (262144,262144), and I think 262144 is at a boundary. Are we convinced this isn't going to cause problems?

  2. Log in to comment