Commit e5bbde4d authored by Ruben Vorderman's avatar Ruben Vorderman
Browse files

Formatted scala files with scalafmt

parent 1e95dc46
/** /**
* Biopet is built on top of GATK Queue for building bioinformatic * Biopet is built on top of GATK Queue for building bioinformatic
* pipelines. It is mainly intended to support LUMC SHARK cluster which is running * pipelines. It is mainly intended to support LUMC SHARK cluster which is running
* SGE. But other types of HPC that are supported by GATK Queue (such as PBS) * SGE. But other types of HPC that are supported by GATK Queue (such as PBS)
* should also be able to execute Biopet tools and pipelines. * should also be able to execute Biopet tools and pipelines.
* *
* Copyright 2014 Sequencing Analysis Support Core - Leiden University Medical Center * Copyright 2014 Sequencing Analysis Support Core - Leiden University Medical Center
* *
* Contact us at: sasc@lumc.nl * Contact us at: sasc@lumc.nl
* *
* A dual licensing mode is applied. The source code within this project is freely available for non-commercial use under an AGPL * A dual licensing mode is applied. The source code within this project is freely available for non-commercial use under an AGPL
* license; For commercial users or users who do not want to follow the AGPL * license; For commercial users or users who do not want to follow the AGPL
* license, please contact us to obtain a separate license. * license, please contact us to obtain a separate license.
*/ */
package nl.lumc.sasc.biopet.pipelines.bamtobigwig package nl.lumc.sasc.biopet.pipelines.bamtobigwig
import java.io.File import java.io.File
import nl.lumc.sasc.biopet.utils.config.Configurable import nl.lumc.sasc.biopet.utils.config.Configurable
import nl.lumc.sasc.biopet.core.{ BiopetQScript, PipelineCommand } import nl.lumc.sasc.biopet.core.{BiopetQScript, PipelineCommand}
import nl.lumc.sasc.biopet.extensions.WigToBigWig import nl.lumc.sasc.biopet.extensions.WigToBigWig
import nl.lumc.sasc.biopet.extensions.igvtools.IGVToolsCount import nl.lumc.sasc.biopet.extensions.igvtools.IGVToolsCount
import org.broadinstitute.gatk.queue.QScript import org.broadinstitute.gatk.queue.QScript
/** /**
* Pipeline to create BigWigle files from a bam file * Pipeline to create BigWigle files from a bam file
* *
* Created by pjvan_thof on 1/29/15. * Created by pjvan_thof on 1/29/15.
*/ */
class Bam2Wig(val parent: Configurable) extends QScript with BiopetQScript { class Bam2Wig(val parent: Configurable) extends QScript with BiopetQScript {
def this() = this(null) def this() = this(null)
...@@ -70,4 +70,4 @@ object Bam2Wig extends PipelineCommand { ...@@ -70,4 +70,4 @@ object Bam2Wig extends PipelineCommand {
bamToBigWig.bamFile = bamFile bamToBigWig.bamFile = bamFile
bamToBigWig bamToBigWig
} }
} }
\ No newline at end of file
/** /**
* Biopet is built on top of GATK Queue for building bioinformatic * Biopet is built on top of GATK Queue for building bioinformatic
* pipelines. It is mainly intended to support LUMC SHARK cluster which is running * pipelines. It is mainly intended to support LUMC SHARK cluster which is running
* SGE. But other types of HPC that are supported by GATK Queue (such as PBS) * SGE. But other types of HPC that are supported by GATK Queue (such as PBS)
* should also be able to execute Biopet tools and pipelines. * should also be able to execute Biopet tools and pipelines.
* *
* Copyright 2014 Sequencing Analysis Support Core - Leiden University Medical Center * Copyright 2014 Sequencing Analysis Support Core - Leiden University Medical Center
* *
* Contact us at: sasc@lumc.nl * Contact us at: sasc@lumc.nl
* *
* A dual licensing mode is applied. The source code within this project is freely available for non-commercial use under an AGPL * A dual licensing mode is applied. The source code within this project is freely available for non-commercial use under an AGPL
* license; For commercial users or users who do not want to follow the AGPL * license; For commercial users or users who do not want to follow the AGPL
* license, please contact us to obtain a separate license. * license, please contact us to obtain a separate license.
*/ */
package nl.lumc.sasc.biopet.pipelines.bamtobigwig package nl.lumc.sasc.biopet.pipelines.bamtobigwig
import java.io.{ File, PrintWriter } import java.io.{File, PrintWriter}
import htsjdk.samtools.SamReaderFactory import htsjdk.samtools.SamReaderFactory
import nl.lumc.sasc.biopet.utils.config.Configurable import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.queue.function.InProcessFunction import org.broadinstitute.gatk.queue.function.InProcessFunction
import org.broadinstitute.gatk.utils.commandline.{ Input, Output } import org.broadinstitute.gatk.utils.commandline.{Input, Output}
import scala.collection.JavaConversions._ import scala.collection.JavaConversions._
/** /**
* Class to extract chrom.sizes files from a bam file * Class to extract chrom.sizes files from a bam file
* *
* Created by pjvan_thof on 1/29/15. * Created by pjvan_thof on 1/29/15.
*/ */
class BamToChromSizes(val parent: Configurable) extends InProcessFunction with Configurable { class BamToChromSizes(val parent: Configurable) extends InProcessFunction with Configurable {
@Input @Input
var bamFile: File = _ var bamFile: File = _
......
/** /**
* Biopet is built on top of GATK Queue for building bioinformatic * Biopet is built on top of GATK Queue for building bioinformatic
* pipelines. It is mainly intended to support LUMC SHARK cluster which is running * pipelines. It is mainly intended to support LUMC SHARK cluster which is running
* SGE. But other types of HPC that are supported by GATK Queue (such as PBS) * SGE. But other types of HPC that are supported by GATK Queue (such as PBS)
* should also be able to execute Biopet tools and pipelines. * should also be able to execute Biopet tools and pipelines.
* *
* Copyright 2014 Sequencing Analysis Support Core - Leiden University Medical Center * Copyright 2014 Sequencing Analysis Support Core - Leiden University Medical Center
* *
* Contact us at: sasc@lumc.nl * Contact us at: sasc@lumc.nl
* *
* A dual licensing mode is applied. The source code within this project is freely available for non-commercial use under an AGPL * A dual licensing mode is applied. The source code within this project is freely available for non-commercial use under an AGPL
* license; For commercial users or users who do not want to follow the AGPL * license; For commercial users or users who do not want to follow the AGPL
* license, please contact us to obtain a separate license. * license, please contact us to obtain a separate license.
*/ */
package nl.lumc.sasc.biopet.pipelines.bamtobigwig package nl.lumc.sasc.biopet.pipelines.bamtobigwig
import java.io.File import java.io.File
...@@ -24,8 +24,8 @@ import org.testng.annotations.Test ...@@ -24,8 +24,8 @@ import org.testng.annotations.Test
import scala.io.Source import scala.io.Source
/** /**
* Created by pjvanthof on 09/05/16. * Created by pjvanthof on 09/05/16.
*/ */
class BamToChromSizesTest extends TestNGSuite with Matchers { class BamToChromSizesTest extends TestNGSuite with Matchers {
private def resourcePath(p: String): String = { private def resourcePath(p: String): String = {
Paths.get(getClass.getResource(p).toURI).toString Paths.get(getClass.getResource(p).toURI).toString
...@@ -39,6 +39,7 @@ class BamToChromSizesTest extends TestNGSuite with Matchers { ...@@ -39,6 +39,7 @@ class BamToChromSizesTest extends TestNGSuite with Matchers {
bamToChromSizes.chromSizesFile = File.createTempFile("chrom.", ".sizes") bamToChromSizes.chromSizesFile = File.createTempFile("chrom.", ".sizes")
bamToChromSizes.chromSizesFile.deleteOnExit() bamToChromSizes.chromSizesFile.deleteOnExit()
bamToChromSizes.run() bamToChromSizes.run()
Source.fromFile(bamToChromSizes.chromSizesFile).getLines().toList shouldBe List("chrQ\t10000", "chrR\t10000") Source.fromFile(bamToChromSizes.chromSizesFile).getLines().toList shouldBe List("chrQ\t10000",
"chrR\t10000")
} }
} }
/** /**
* Biopet is built on top of GATK Queue for building bioinformatic * Biopet is built on top of GATK Queue for building bioinformatic
* pipelines. It is mainly intended to support LUMC SHARK cluster which is running * pipelines. It is mainly intended to support LUMC SHARK cluster which is running
* SGE. But other types of HPC that are supported by GATK Queue (such as PBS) * SGE. But other types of HPC that are supported by GATK Queue (such as PBS)
* should also be able to execute Biopet tools and pipelines. * should also be able to execute Biopet tools and pipelines.
* *
* Copyright 2014 Sequencing Analysis Support Core - Leiden University Medical Center * Copyright 2014 Sequencing Analysis Support Core - Leiden University Medical Center
* *
* Contact us at: sasc@lumc.nl * Contact us at: sasc@lumc.nl
* *
* A dual licensing mode is applied. The source code within this project is freely available for non-commercial use under an AGPL * A dual licensing mode is applied. The source code within this project is freely available for non-commercial use under an AGPL
* license; For commercial users or users who do not want to follow the AGPL * license; For commercial users or users who do not want to follow the AGPL
* license, please contact us to obtain a separate license. * license, please contact us to obtain a separate license.
*/ */
package nl.lumc.sasc.biopet.pipelines.bammetrics package nl.lumc.sasc.biopet.pipelines.bammetrics
import java.io.File import java.io.File
import nl.lumc.sasc.biopet.core.annotations.{ AnnotationRefFlat, RibosomalRefFlat } import nl.lumc.sasc.biopet.core.annotations.{AnnotationRefFlat, RibosomalRefFlat}
import nl.lumc.sasc.biopet.core.summary.SummaryQScript import nl.lumc.sasc.biopet.core.summary.SummaryQScript
import nl.lumc.sasc.biopet.core.{ BiopetFifoPipe, PipelineCommand, Reference, SampleLibraryTag } import nl.lumc.sasc.biopet.core.{BiopetFifoPipe, PipelineCommand, Reference, SampleLibraryTag}
import nl.lumc.sasc.biopet.extensions.bedtools.{ BedtoolsCoverage, BedtoolsIntersect, BedtoolsSort } import nl.lumc.sasc.biopet.extensions.bedtools.{BedtoolsCoverage, BedtoolsIntersect, BedtoolsSort}
import nl.lumc.sasc.biopet.extensions.picard._ import nl.lumc.sasc.biopet.extensions.picard._
import nl.lumc.sasc.biopet.extensions.samtools.SamtoolsFlagstat import nl.lumc.sasc.biopet.extensions.samtools.SamtoolsFlagstat
import nl.lumc.sasc.biopet.extensions.tools.{ BamStats, BiopetFlagstat } import nl.lumc.sasc.biopet.extensions.tools.{BamStats, BiopetFlagstat}
import nl.lumc.sasc.biopet.pipelines.bammetrics.scripts.CoverageStats import nl.lumc.sasc.biopet.pipelines.bammetrics.scripts.CoverageStats
import nl.lumc.sasc.biopet.utils.config.Configurable import nl.lumc.sasc.biopet.utils.config.Configurable
import nl.lumc.sasc.biopet.utils.intervals.BedCheck import nl.lumc.sasc.biopet.utils.intervals.BedCheck
import org.broadinstitute.gatk.queue.QScript import org.broadinstitute.gatk.queue.QScript
class BamMetrics(val parent: Configurable) extends QScript class BamMetrics(val parent: Configurable)
with SummaryQScript extends QScript
with SampleLibraryTag with SummaryQScript
with Reference with SampleLibraryTag
with TargetRegions with Reference
with AnnotationRefFlat with TargetRegions
with RibosomalRefFlat { with AnnotationRefFlat
with RibosomalRefFlat {
def this() = this(null) def this() = this(null)
...@@ -44,30 +45,32 @@ class BamMetrics(val parent: Configurable) extends QScript ...@@ -44,30 +45,32 @@ class BamMetrics(val parent: Configurable) extends QScript
override def defaults = Map("bedtoolscoverage" -> Map("sorted" -> true)) override def defaults = Map("bedtoolscoverage" -> Map("sorted" -> true))
/** returns files to store in summary */ /** returns files to store in summary */
def summaryFiles = Map("reference" -> referenceFasta(), def summaryFiles =
"input_bam" -> inputBam) ++ Map("reference" -> referenceFasta(), "input_bam" -> inputBam) ++
ampliconBedFile.map("amplicon" -> _).toMap ++ ampliconBedFile.map("amplicon" -> _).toMap ++
ampliconBedFile.map(x => "roi_" + x.getName.stripSuffix(".bed") -> x).toMap ampliconBedFile.map(x => "roi_" + x.getName.stripSuffix(".bed") -> x).toMap
/** return settings */ /** return settings */
def summarySettings = Map("amplicon_name" -> ampliconBedFile.collect { case x => x.getName.stripSuffix(".bed") }, def summarySettings =
"roi_name" -> roiBedFiles.map(_.getName.stripSuffix(".bed"))) Map("amplicon_name" -> ampliconBedFile.collect { case x => x.getName.stripSuffix(".bed") },
"roi_name" -> roiBedFiles.map(_.getName.stripSuffix(".bed")))
override def reportClass = { override def reportClass = {
val bammetricsReport = new BammetricsReport(this) val bammetricsReport = new BammetricsReport(this)
bammetricsReport.outputDir = new File(outputDir, "report") bammetricsReport.outputDir = new File(outputDir, "report")
bammetricsReport.summaryDbFile = summaryDbFile bammetricsReport.summaryDbFile = summaryDbFile
bammetricsReport.args = if (libId.isDefined) Map( bammetricsReport.args =
"sampleId" -> sampleId.getOrElse("."), if (libId.isDefined)
"libId" -> libId.getOrElse(".")) Map("sampleId" -> sampleId.getOrElse("."), "libId" -> libId.getOrElse("."))
else Map("sampleId" -> sampleId.getOrElse(".")) else Map("sampleId" -> sampleId.getOrElse("."))
Some(bammetricsReport) Some(bammetricsReport)
} }
/** executed before script */ /** executed before script */
def init(): Unit = { def init(): Unit = {
inputFiles :+= new InputFile(inputBam) inputFiles :+= new InputFile(inputBam)
ampliconBedFile.foreach(BedCheck.checkBedFileToReference(_, referenceFasta(), biopetError = true)) ampliconBedFile.foreach(
BedCheck.checkBedFileToReference(_, referenceFasta(), biopetError = true))
roiBedFiles.foreach(BedCheck.checkBedFileToReference(_, referenceFasta(), biopetError = true)) roiBedFiles.foreach(BedCheck.checkBedFileToReference(_, referenceFasta(), biopetError = true))
} }
...@@ -129,13 +132,19 @@ class BamMetrics(val parent: Configurable) extends QScript ...@@ -129,13 +132,19 @@ class BamMetrics(val parent: Configurable) extends QScript
ampBedToInterval.isIntermediate = true ampBedToInterval.isIntermediate = true
add(ampBedToInterval) add(ampBedToInterval)
val chsMetrics = CollectHsMetrics(this, inputBam, val chsMetrics = CollectHsMetrics(this,
List(ampIntervals), ampIntervals :: roiIntervals.map(_.intervals), outputDir) inputBam,
List(ampIntervals),
ampIntervals :: roiIntervals.map(_.intervals),
outputDir)
add(chsMetrics) add(chsMetrics)
addSummarizable(chsMetrics, "hs_metrics") addSummarizable(chsMetrics, "hs_metrics")
val pcrMetrics = CollectTargetedPcrMetrics(this, inputBam, val pcrMetrics = CollectTargetedPcrMetrics(this,
ampIntervals, ampIntervals :: roiIntervals.map(_.intervals), outputDir) inputBam,
ampIntervals,
ampIntervals :: roiIntervals.map(_.intervals),
outputDir)
add(pcrMetrics) add(pcrMetrics)
addSummarizable(pcrMetrics, "targeted_pcr_metrics") addSummarizable(pcrMetrics, "targeted_pcr_metrics")
...@@ -145,36 +154,48 @@ class BamMetrics(val parent: Configurable) extends QScript ...@@ -145,36 +154,48 @@ class BamMetrics(val parent: Configurable) extends QScript
// Create stats and coverage plot for each bed/interval file // Create stats and coverage plot for each bed/interval file
val allIntervalNames = (roiIntervals ++ ampIntervals).map(_.bed.getName) val allIntervalNames = (roiIntervals ++ ampIntervals).map(_.bed.getName)
if (allIntervalNames.size != allIntervalNames.toSet.size) { if (allIntervalNames.size != allIntervalNames.toSet.size) {
logger.warn("There are multiple region files with the same name. Metric values might get overwritten") logger.warn(
"There are multiple region files with the same name. Metric values might get overwritten")
} }
for (intervals <- roiIntervals ++ ampIntervals) { for (intervals <- roiIntervals ++ ampIntervals) {
val targetName = intervals.bed.getName.stripSuffix(".bed") val targetName = intervals.bed.getName.stripSuffix(".bed")
val targetDir = new File(outputDir, targetName) val targetDir = new File(outputDir, targetName)
val biStrict = BedtoolsIntersect(this, inputBam, intervals.bed, val biStrict = BedtoolsIntersect(
this,
inputBam,
intervals.bed,
output = new File(targetDir, inputBam.getName.stripSuffix(".bam") + ".overlap.strict.sam"), output = new File(targetDir, inputBam.getName.stripSuffix(".bam") + ".overlap.strict.sam"),
minOverlap = config("strict_intersect_overlap", default = 1.0)) minOverlap = config("strict_intersect_overlap", default = 1.0)
)
val biopetFlagstatStrict = BiopetFlagstat(this, biStrict.output, targetDir) val biopetFlagstatStrict = BiopetFlagstat(this, biStrict.output, targetDir)
addSummarizable(biopetFlagstatStrict, targetName + "_flagstats_strict") addSummarizable(biopetFlagstatStrict, targetName + "_flagstats_strict")
add(new BiopetFifoPipe(this, List(biStrict, biopetFlagstatStrict))) add(new BiopetFifoPipe(this, List(biStrict, biopetFlagstatStrict)))
val biLoose = BedtoolsIntersect(this, inputBam, intervals.bed, val biLoose = BedtoolsIntersect(
this,
inputBam,
intervals.bed,
output = new File(targetDir, inputBam.getName.stripSuffix(".bam") + ".overlap.loose.sam"), output = new File(targetDir, inputBam.getName.stripSuffix(".bam") + ".overlap.loose.sam"),
minOverlap = config("loose_intersect_overlap", default = 0.01)) minOverlap = config("loose_intersect_overlap", default = 0.01)
)
val biopetFlagstatLoose = BiopetFlagstat(this, biLoose.output, targetDir) val biopetFlagstatLoose = BiopetFlagstat(this, biLoose.output, targetDir)
addSummarizable(biopetFlagstatLoose, targetName + "_flagstats_loose") addSummarizable(biopetFlagstatLoose, targetName + "_flagstats_loose")
add(new BiopetFifoPipe(this, List(biLoose, biopetFlagstatLoose))) add(new BiopetFifoPipe(this, List(biLoose, biopetFlagstatLoose)))
val sortedBed = BamMetrics.sortedbedCache.getOrElse(intervals.bed, { val sortedBed = BamMetrics.sortedbedCache.getOrElse(
val sorter = new BedtoolsSort(this) intervals.bed, {
sorter.input = intervals.bed val sorter = new BedtoolsSort(this)
sorter.output = swapExt(targetDir, intervals.bed, ".bed", ".sorted.bed") sorter.input = intervals.bed
add(sorter) sorter.output = swapExt(targetDir, intervals.bed, ".bed", ".sorted.bed")
BamMetrics.sortedbedCache += intervals.bed -> sorter.output add(sorter)
sorter.output BamMetrics.sortedbedCache += intervals.bed -> sorter.output
}) sorter.output
}
)
val bedCov = BedtoolsCoverage(this, sortedBed, inputBam, depth = true) val bedCov = BedtoolsCoverage(this, sortedBed, inputBam, depth = true)
val covStats = CoverageStats(this, targetDir, inputBam.getName.stripSuffix(".bam") + ".coverage") val covStats =
CoverageStats(this, targetDir, inputBam.getName.stripSuffix(".bam") + ".coverage")
covStats.title = Some("Coverage Plot") covStats.title = Some("Coverage Plot")
covStats.subTitle = Some(s"for file '$targetName.bed'") covStats.subTitle = Some(s"for file '$targetName.bed'")
add(bedCov | covStats) add(bedCov | covStats)
...@@ -186,9 +207,11 @@ class BamMetrics(val parent: Configurable) extends QScript ...@@ -186,9 +207,11 @@ class BamMetrics(val parent: Configurable) extends QScript
} }
object BamMetrics extends PipelineCommand { object BamMetrics extends PipelineCommand {
/** Make default implementation of BamMetrics and runs script already */ /** Make default implementation of BamMetrics and runs script already */
def apply(root: Configurable, def apply(root: Configurable,
bamFile: File, outputDir: File, bamFile: File,
outputDir: File,
sampleId: Option[String] = None, sampleId: Option[String] = None,
libId: Option[String] = None): BamMetrics = { libId: Option[String] = None): BamMetrics = {
val bamMetrics = new BamMetrics(root) val bamMetrics = new BamMetrics(root)
......
/** /**
* Biopet is built on top of GATK Queue for building bioinformatic * Biopet is built on top of GATK Queue for building bioinformatic
* pipelines. It is mainly intended to support LUMC SHARK cluster which is running * pipelines. It is mainly intended to support LUMC SHARK cluster which is running
* SGE. But other types of HPC that are supported by GATK Queue (such as PBS) * SGE. But other types of HPC that are supported by GATK Queue (such as PBS)
* should also be able to execute Biopet tools and pipelines. * should also be able to execute Biopet tools and pipelines.
* *
* Copyright 2014 Sequencing Analysis Support Core - Leiden University Medical Center * Copyright 2014 Sequencing Analysis Support Core - Leiden University Medical Center
* *
* Contact us at: sasc@lumc.nl * Contact us at: sasc@lumc.nl
* *
* A dual licensing mode is applied. The source code within this project is freely available for non-commercial use under an AGPL * A dual licensing mode is applied. The source code within this project is freely available for non-commercial use under an AGPL
* license; For commercial users or users who do not want to follow the AGPL * license; For commercial users or users who do not want to follow the AGPL
* license, please contact us to obtain a separate license. * license, please contact us to obtain a separate license.
*/ */
package nl.lumc.sasc.biopet.pipelines.bammetrics package nl.lumc.sasc.biopet.pipelines.bammetrics
import java.io.File import java.io.File
...@@ -19,9 +19,10 @@ import java.io.File ...@@ -19,9 +19,10 @@ import java.io.File
import nl.lumc.sasc.biopet.utils.config.Configurable import nl.lumc.sasc.biopet.utils.config.Configurable
/** /**
* Created by pjvan_thof on 11/20/15. * Created by pjvan_thof on 11/20/15.
*/ */
trait TargetRegions extends Configurable { trait TargetRegions extends Configurable {
/** Bed files for region of interests */ /** Bed files for region of interests */
var roiBedFiles: List[File] = config("regions_of_interest", Nil) var roiBedFiles: List[File] = config("regions_of_interest", Nil)
......
/** /**
* Biopet is built on top of GATK Queue for building bioinformatic * Biopet is built on top of GATK Queue for building bioinformatic
* pipelines. It is mainly intended to support LUMC SHARK cluster which is running * pipelines. It is mainly intended to support LUMC SHARK cluster which is running
* SGE. But other types of HPC that are supported by GATK Queue (such as PBS) * SGE. But other types of HPC that are supported by GATK Queue (such as PBS)
* should also be able to execute Biopet tools and pipelines. * should also be able to execute Biopet tools and pipelines.
* *
* Copyright 2014 Sequencing Analysis Support Core - Leiden University Medical Center * Copyright 2014 Sequencing Analysis Support Core - Leiden University Medical Center
* *
* Contact us at: sasc@lumc.nl * Contact us at: sasc@lumc.nl
* *
* A dual licensing mode is applied. The source code within this project is freely available for non-commercial use under an AGPL * A dual licensing mode is applied. The source code within this project is freely available for non-commercial use under an AGPL
* license; For commercial users or users who do not want to follow the AGPL * license; For commercial users or users who do not want to follow the AGPL
* license, please contact us to obtain a separate license. * license, please contact us to obtain a separate license.
*/ */
package nl.lumc.sasc.biopet.pipelines.bammetrics.scripts package nl.lumc.sasc.biopet.pipelines.bammetrics.scripts
import java.io.File import java.io.File
...@@ -20,7 +20,7 @@ import nl.lumc.sasc.biopet.core.extensions.PythonCommandLineFunction ...@@ -20,7 +20,7 @@ import nl.lumc.sasc.biopet.core.extensions.PythonCommandLineFunction
import nl.lumc.sasc.biopet.utils.config.Configurable import nl.lumc.sasc.biopet.utils.config.Configurable
import nl.lumc.sasc.biopet.core.summary.Summarizable import nl.lumc.sasc.biopet.core.summary.Summarizable
import nl.lumc.sasc.biopet.utils.ConfigUtils import nl.lumc.sasc.biopet.utils.ConfigUtils
import org.broadinstitute.gatk.utils.commandline.{ Input, Output } import org.broadinstitute.gatk.utils.commandline.{Input, Output}
class CoverageStats(val parent: Configurable) extends PythonCommandLineFunction with Summarizable { class CoverageStats(val parent: Configurable) extends PythonCommandLineFunction with Summarizable {
setPythonScript("bedtools_cov_stats.py") setPythonScript("bedtools_cov_stats.py")
...@@ -39,12 +39,13 @@ class CoverageStats(val parent: Configurable) extends PythonCommandLineFunction ...@@ -39,12 +39,13 @@ class CoverageStats(val parent: Configurable) extends PythonCommandLineFunction
override def defaultCoreMemory = 9.0 override def defaultCoreMemory = 9.0
def cmdLine = getPythonCommand + def cmdLine =
(if (inputAsStdin) " - " else required(input)) + getPythonCommand +
required("--plot", plot) + (if (inputAsStdin) " - " else required(input)) +
optional("--title", title) + required("--plot", plot) +
optional("--subtitle", subTitle) + optional("--title", title) +
" > " + required(output) optional("--subtitle", subTitle) +