Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimizeIntervals fails to merge abutting intervals #971

Closed
jean-philippe-martin opened this issue Aug 18, 2017 · 1 comment
Closed

optimizeIntervals fails to merge abutting intervals #971

jean-philippe-martin opened this issue Aug 18, 2017 · 1 comment

Comments

@jean-philippe-martin
Copy link
Contributor

Subject of the issue

QueryInterval.optimizeIntervals does not merge adjacent intervals as I would have expected.

Here is test code to demonstrate the issue:

  @Test
  public void testOptimizeIntervals() throws Exception {
    QueryInterval[] intervals = new QueryInterval[] {
        new QueryInterval(0, 1519, 1520),
        new QueryInterval(0, 1521, 1525)
    };
    QueryInterval[] expected = new QueryInterval[] {
        new QueryInterval(0, 1519, 1525),
    };
    final QueryInterval[] got = QueryInterval.optimizeIntervals(intervals);
    Assert.assertEquals(expected, got);
  }

It fails because got still contains the two initial intervals, even though they touch.

Your environment

I tried using htsjdk 2.10.1, java 8 and Linux.

Steps to reproduce

Compile and run the test code above. Observe it fail.

Expected behaviour

I expect abutting intervals to be merged.

Actual behaviour

Overlapping intervals are merged, but abutting ones are not.

@yfarjoun
Copy link
Contributor

fixed by #979

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants