Skip to content
Snippets Groups Projects
Commit 96d99632 authored by bow's avatar bow
Browse files

Update refFlat parser to account for 0-based coordinate

parent 92dd97f7
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment