Commit 1ee97e08 authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Added picard version to summary

parent 335cc12f
...@@ -2,7 +2,7 @@ package nl.lumc.sasc.biopet.core.report ...@@ -2,7 +2,7 @@ package nl.lumc.sasc.biopet.core.report
import java.io._ import java.io._
import nl.lumc.sasc.biopet.core.{ BiopetJavaCommandLineFunction, ToolCommand } import nl.lumc.sasc.biopet.core.{ ToolCommandFuntion, BiopetJavaCommandLineFunction, ToolCommand }
import nl.lumc.sasc.biopet.core.summary.Summary import nl.lumc.sasc.biopet.core.summary.Summary
import org.broadinstitute.gatk.utils.commandline.Input import org.broadinstitute.gatk.utils.commandline.Input
import org.fusesource.scalate.{ TemplateSource, TemplateEngine } import org.fusesource.scalate.{ TemplateSource, TemplateEngine }
...@@ -11,7 +11,7 @@ import nl.lumc.sasc.biopet.utils.IoUtils ...@@ -11,7 +11,7 @@ import nl.lumc.sasc.biopet.utils.IoUtils
/** /**
* Created by pjvan_thof on 3/27/15. * Created by pjvan_thof on 3/27/15.
*/ */
trait ReportBuilderExtension extends BiopetJavaCommandLineFunction { trait ReportBuilderExtension extends ToolCommandFuntion {
val builder: ReportBuilder val builder: ReportBuilder
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
*/ */
package nl.lumc.sasc.biopet.extensions.picard package nl.lumc.sasc.biopet.extensions.picard
import java.io.File import java.io.{ FileReader, File }
import scala.io.Source import scala.io.Source
import org.broadinstitute.gatk.utils.commandline.Argument import org.broadinstitute.gatk.utils.commandline.Argument
...@@ -63,6 +63,11 @@ abstract class Picard extends BiopetJavaCommandLineFunction { ...@@ -63,6 +63,11 @@ abstract class Picard extends BiopetJavaCommandLineFunction {
override val defaultCoreMemory = 3.0 override val defaultCoreMemory = 3.0
override def getVersion = {
if (jarFile == null) Picard.getBiopetPicardVersion
else super.getVersion
}
override def commandLine = super.commandLine + override def commandLine = super.commandLine +
required("TMP_DIR=" + jobTempDir) + required("TMP_DIR=" + jobTempDir) +
optional("VERBOSITY=", verbosity, spaceSeparated = false) + optional("VERBOSITY=", verbosity, spaceSeparated = false) +
...@@ -76,6 +81,29 @@ abstract class Picard extends BiopetJavaCommandLineFunction { ...@@ -76,6 +81,29 @@ abstract class Picard extends BiopetJavaCommandLineFunction {
object Picard extends Logging { 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(
"groupId" -> line(0),
"artifactId" -> line(1),
"type" -> line(2),
"version" -> line(3),
"scope" -> line(4)
)).toList
logger.debug("dependencies: " + dependencies)
val htsjdk = dependencies.find(dep => dep("groupId") == "samtools" && dep("artifactId") == "htsjdk").collect {
case dep =>
"samtools htsjdk " + dep("version")
}
dependencies.find(dep => dep("groupId") == "picard" && dep("artifactId") == "picard").collect {
case dep =>
"Picard " + dep("version") + " using " + htsjdk.getOrElse("unknown htsjdk")
}
}
def getMetrics(file: File, tag: String = "METRICS CLASS", def getMetrics(file: File, tag: String = "METRICS CLASS",
groupBy: Option[String] = None): Option[Any] = { groupBy: Option[String] = None): Option[Any] = {
getMetricsContent(file, tag) match { getMetricsContent(file, tag) match {
......
Supports Markdown
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