Commit 7a2b2219 authored by bow's avatar bow
Browse files

Merge branch 'fix-CollectMultipleMetrics' into 'develop'

Added reference to extension

fix for #178

See merge request !200
parents 09a67e50 29a4b554
...@@ -2,7 +2,7 @@ package nl.lumc.sasc.biopet.extensions.picard ...@@ -2,7 +2,7 @@ package nl.lumc.sasc.biopet.extensions.picard
import java.io.File import java.io.File
import nl.lumc.sasc.biopet.core.BiopetQScript import nl.lumc.sasc.biopet.core.{ Reference, BiopetQScript }
import nl.lumc.sasc.biopet.core.config.Configurable import nl.lumc.sasc.biopet.core.config.Configurable
import nl.lumc.sasc.biopet.core.summary.{ Summarizable, SummaryQScript } import nl.lumc.sasc.biopet.core.summary.{ Summarizable, SummaryQScript }
import org.broadinstitute.gatk.utils.commandline.{ Argument, Input, Output } import org.broadinstitute.gatk.utils.commandline.{ Argument, Input, Output }
...@@ -12,7 +12,7 @@ import org.broadinstitute.gatk.utils.commandline.{ Argument, Input, Output } ...@@ -12,7 +12,7 @@ import org.broadinstitute.gatk.utils.commandline.{ Argument, Input, Output }
* *
* Created by pjvan_thof on 4/16/15. * Created by pjvan_thof on 4/16/15.
*/ */
class CollectMultipleMetrics(val root: Configurable) extends Picard with Summarizable { class CollectMultipleMetrics(val root: Configurable) extends Picard with Summarizable with Reference {
import CollectMultipleMetrics._ import CollectMultipleMetrics._
javaMainClass = new picard.analysis.CollectMultipleMetrics().getClass.getName javaMainClass = new picard.analysis.CollectMultipleMetrics().getClass.getName
...@@ -22,6 +22,9 @@ class CollectMultipleMetrics(val root: Configurable) extends Picard with Summari ...@@ -22,6 +22,9 @@ class CollectMultipleMetrics(val root: Configurable) extends Picard with Summari
@Input(doc = "The input SAM or BAM files to analyze", required = true) @Input(doc = "The input SAM or BAM files to analyze", required = true)
var input: File = null var input: File = null
@Input(doc = "The reference file for the bam files.", shortName = "R")
var reference: File = null
@Output(doc = "Base name of output files", required = true) @Output(doc = "Base name of output files", required = true)
var outputName: File = null var outputName: File = null
...@@ -39,6 +42,8 @@ class CollectMultipleMetrics(val root: Configurable) extends Picard with Summari ...@@ -39,6 +42,8 @@ class CollectMultipleMetrics(val root: Configurable) extends Picard with Summari
protected var outputFiles: List[File] = Nil protected var outputFiles: List[File] = Nil
override def beforeGraph(): Unit = { override def beforeGraph(): Unit = {
super.beforeGraph()
if (reference == null) reference = referenceFasta()
program.foreach { program.foreach {
case p if p == Programs.CollectAlignmentSummaryMetrics.toString => case p if p == Programs.CollectAlignmentSummaryMetrics.toString =>
outputFiles :+= new File(outputName + ".alignment_summary_metrics") outputFiles :+= new File(outputName + ".alignment_summary_metrics")
...@@ -63,6 +68,7 @@ class CollectMultipleMetrics(val root: Configurable) extends Picard with Summari ...@@ -63,6 +68,7 @@ class CollectMultipleMetrics(val root: Configurable) extends Picard with Summari
required("OUTPUT=", outputName, spaceSeparated = false) + required("OUTPUT=", outputName, spaceSeparated = false) +
conditional(assumeSorted, "ASSUME_SORTED=true") + conditional(assumeSorted, "ASSUME_SORTED=true") +
optional("STOP_AFTER=", stopAfter, spaceSeparated = false) + optional("STOP_AFTER=", stopAfter, spaceSeparated = false) +
optional("REFERENCE_SEQUENCE=", reference, spaceSeparated = false) +
repeat("PROGRAM=", program, spaceSeparated = false) repeat("PROGRAM=", program, spaceSeparated = false)
override def addToQscriptSummary(qscript: SummaryQScript, name: String): Unit = { override def addToQscriptSummary(qscript: SummaryQScript, name: String): Unit = {
......
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