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

Pattern match refactor in ExtractAlignedFastq

parent 10518502
No related branches found
No related tags found
No related merge requests found
......@@ -55,14 +55,13 @@ object ExtractAlignedFastq extends ToolCommand {
// by the Interval constructor only accepting ints
def intFromCoord(s: String): Int = s.replaceAll(",", "").replaceAll("\\.", "").toInt
inStrings.map(x => x match {
inStrings.map {
case ptn1(chr, start, end) => new Interval(chr, intFromCoord(start), intFromCoord(end))
case ptn2(chr, start) =>
val startCoord = intFromCoord(start)
new Interval(chr, startCoord, startCoord)
case _ => throw new IllegalArgumentException("Invalid interval string: " + x)
})
.toIterator
}.toIterator
}
/**
......
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