diff --git a/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/WipeReads.scala b/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/WipeReads.scala index 3b921db8f2f6f0b08a18f2afb1c4689e44164de5..9bfb15686a0fc82694c94aca0fc91ae7d5df4f95 100644 --- a/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/WipeReads.scala +++ b/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/WipeReads.scala @@ -106,8 +106,8 @@ object WipeReads extends ToolCommand { .map(x => (x._1, x._2.map(y => y.split(",")))) // zip exonStarts and exonEnds, note the index was reversed because we did .reverse above .map(x => (x._1, x._2(1).zip(x._2(0)))) - // make Intervals - .map(x => x._2.map(y => new Interval(x._1, y._1.toInt, y._2.toInt))) + // make Intervals, accounting for the fact that refFlat coordinates are 0-based + .map(x => x._2.map(y => new Interval(x._1, y._1.toInt + 1, y._2.toInt))) // flatten sublist .flatten diff --git a/biopet-framework/src/test/scala/nl/lumc/sasc/biopet/tools/WipeReadsUnitTest.scala b/biopet-framework/src/test/scala/nl/lumc/sasc/biopet/tools/WipeReadsUnitTest.scala index 8c8af38f572d2a6401bb856d1d1e5012e3cdf337..16cfabe816af4fa8deee1b295a88da68f659c3bf 100644 --- a/biopet-framework/src/test/scala/nl/lumc/sasc/biopet/tools/WipeReadsUnitTest.scala +++ b/biopet-framework/src/test/scala/nl/lumc/sasc/biopet/tools/WipeReadsUnitTest.scala @@ -148,13 +148,13 @@ class WipeReadsUnitTest extends TestNGSuite with MockitoSugar with Matchers { val intervals: List[Interval] = makeIntervalFromFile(RefFlatFile1) intervals.length shouldBe 5 intervals.head.getSequence should ===("chrS") - intervals.head.getStart shouldBe 100 + intervals.head.getStart shouldBe 101 intervals.head.getEnd shouldBe 500 intervals(2).getSequence should ===("chrQ") - intervals(2).getStart shouldBe 800 + intervals(2).getStart shouldBe 801 intervals(2).getEnd shouldBe 1000 intervals.last.getSequence should ===("chrQ") - intervals.last.getStart shouldBe 100 + intervals.last.getStart shouldBe 101 intervals.last.getEnd shouldBe 200 }