Commit b83f5736 authored by bow's avatar bow
Browse files

Pattern match refactor in ExtractAlignedFastq

parent 10518502
......@@ -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
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment