Commit 64134d46 authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

wgs and rna metrics now got config value to enable/disable them

parent 69009dc0
......@@ -17,6 +17,7 @@ package nl.lumc.sasc.biopet.pipelines.bammetrics
import java.io.File
import nl.lumc.sasc.biopet.core.annotations.{ RibosomalRefFlat, AnnotationRefFlat }
import nl.lumc.sasc.biopet.utils.config.Configurable
import nl.lumc.sasc.biopet.core.summary.SummaryQScript
import nl.lumc.sasc.biopet.core.{ Reference, BiopetFifoPipe, PipelineCommand, SampleLibraryTag }
......@@ -31,16 +32,15 @@ class BamMetrics(val root: Configurable) extends QScript
with SummaryQScript
with SampleLibraryTag
with Reference
with TargetRegions {
with TargetRegions
with AnnotationRefFlat
with RibosomalRefFlat {
def this() = this(null)
@Input(doc = "Bam File", shortName = "BAM", required = true)
var inputBam: File = _
/** Settings for CollectRnaSeqMetrics */
var transcriptRefFlatFile: Option[File] = config("transcript_refflat")
/** return location of summary file */
def summaryFile = (sampleId, libId) match {
case (Some(s), Some(l)) => new File(outputDir, s + "-" + l + ".BamMetrics.summary.json")
......@@ -92,7 +92,7 @@ class BamMetrics(val root: Configurable) extends QScript
add(gcBiasMetrics)
addSummarizable(gcBiasMetrics, "gc_bias")
if (transcriptRefFlatFile.isEmpty) {
if (config("wgs_metrics", default = true)) {
val wgsMetrics = new CollectWgsMetrics(this)
wgsMetrics.input = inputBam
wgsMetrics.output = swapExt(outputDir, inputBam, ".bam", ".wgs.metrics")
......@@ -100,12 +100,13 @@ class BamMetrics(val root: Configurable) extends QScript
addSummarizable(wgsMetrics, "wgs")
}
if (transcriptRefFlatFile.isDefined) {
if (config("rna_metrics", default = false)) {
val rnaMetrics = new CollectRnaSeqMetrics(this)
rnaMetrics.input = inputBam
rnaMetrics.output = swapExt(outputDir, inputBam, ".bam", ".rna.metrics")
rnaMetrics.chartOutput = Some(swapExt(outputDir, inputBam, ".bam", ".rna.metrics.pdf"))
rnaMetrics.refFlat = transcriptRefFlatFile.get
rnaMetrics.refFlat = annotationRefFlat()
rnaMetrics.ribosomalIntervals = ribosomalRefFlat()
add(rnaMetrics)
addSummarizable(rnaMetrics, "rna")
}
......
......@@ -36,7 +36,7 @@ class CollectRnaSeqMetrics(val root: Configurable) extends Picard with Summariza
var refFlat: File = null
@Input(doc = "Location of rRNA sequences in interval list format", required = false)
var ribosomalIntervals: Option[File] = config("ribosomal_intervals")
var ribosomalIntervals: Option[File] = None
@Output(doc = "Output metrics file", required = true)
var output: File = null
......
......@@ -93,12 +93,12 @@ class Gentrap(val root: Configurable) extends QScript
"merge_strategy" -> "preprocessmergesam",
"gsnap" -> Map(
"novelsplicing" -> 1,
"batch" -> 4,
"format" -> "sam"
"batch" -> 4
),
"shivavariantcalling" -> Map("variantcallers" -> List("varscan_cns_singlesample")),
"bammetrics" -> Map(
"transcript_refflat" -> annotationRefFlat,
"wgs_metrics" -> false,
"rna_metrics" -> true,
"collectrnaseqmetrics" -> ((if (strandProtocol.isSet) Map(
"strand_specificity" -> (strandProtocol() match {
case StrandProtocol.NonSpecific => StrandSpecificity.NONE.toString
......@@ -106,7 +106,7 @@ class Gentrap(val root: Configurable) extends QScript
case otherwise => throw new IllegalStateException(otherwise.toString)
})
)
else Map()) ++ (if (ribosomalRefFlat.isSet) ribosomalRefFlat().map("ribosomal_intervals" -> _.getAbsolutePath).toList else Nil))
else Map()))
),
"cutadapt" -> Map("minimum_length" -> 20),
// avoid conflicts when merging since the MarkDuplicate tags often cause merges to fail
......
......@@ -43,7 +43,7 @@ class PlotHeatmap(val root: Configurable) extends RscriptCommandLineFunction {
(if (useLog) Seq("-L") else Seq()) ++
(countType match {
case Some(t) => Seq("-C", t)
case _ => Seq()
case _ => Seq()
}) ++
Seq("-I", input.getAbsolutePath, "-O", output.getAbsolutePath)
}
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