Commit e5d886e4 authored by bow's avatar bow
Browse files

Wrap Picard dependency list fetch in Option

parent f78ea918
......@@ -82,8 +82,10 @@ abstract class Picard extends BiopetJavaCommandLineFunction {
object Picard extends Logging {
lazy val getBiopetPicardVersion: Option[String] = {
val reader = Source.fromInputStream(getClass.getResourceAsStream("/dependency_list.txt"))
val dependencies = reader.getLines().map(_.trim.split(":")).filter(_.size == 5).map(line => Map(
Option(getClass.getResourceAsStream("/dependency_list.txt")) match {
case Some(src) =>
val dependencies = Source.fromInputStream(src)
.getLines().map(_.trim.split(":")).filter(_.size == 5).map(line => Map(
"groupId" -> line(0),
"artifactId" -> line(1),
"type" -> line(2),
......@@ -102,6 +104,8 @@ object Picard extends Logging {
case dep =>
"Picard " + dep("version") + " using " + htsjdk.getOrElse("unknown htsjdk")
}
case otherwise => None
}
}
def getMetrics(file: File, tag: String = "METRICS CLASS",
......
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