Commit 48b7822f authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Added wigle and tdf files to summary

parent 18184194
......@@ -38,6 +38,10 @@ class Bam2Wig(val root: Configurable) extends QScript with BiopetQScript {
inputFiles :+= new InputFile(bamFile)
}
def outputWigleFile = new File(outputDir, bamFile.getName + ".wig")
def outputTdfFile = new File(outputDir, bamFile.getName + ".tdf")
def outputBwFile = new File(outputDir, bamFile.getName + ".bw")
def biopetScript(): Unit = {
val bs = new BamToChromSizes(this)
bs.bamFile = bamFile
......@@ -48,14 +52,14 @@ class Bam2Wig(val root: Configurable) extends QScript with BiopetQScript {
val igvCount = new IGVToolsCount(this)
igvCount.input = bamFile
igvCount.genomeChromSizes = bs.chromSizesFile
igvCount.wig = Some(new File(outputDir, bamFile.getName + ".wig"))
igvCount.tdf = Some(new File(outputDir, bamFile.getName + ".tdf"))
igvCount.wig = Some(outputWigleFile)
igvCount.tdf = Some(outputTdfFile)
add(igvCount)
val wigToBigWig = new WigToBigWig(this)
wigToBigWig.inputWigFile = igvCount.wig.get
wigToBigWig.inputChromSizesFile = bs.chromSizesFile
wigToBigWig.outputBigWig = new File(outputDir, bamFile.getName + ".bw")
wigToBigWig.outputBigWig = outputBwFile
add(wigToBigWig)
}
}
......
......@@ -109,7 +109,14 @@ class Mapping(val root: Configurable) extends QScript with SummaryQScript with S
/** File to add to the summary */
def summaryFiles: Map[String, File] = Map("output_bam" -> finalBamFile, "input_R1" -> inputR1,
"reference" -> referenceFasta()) ++
(if (inputR2.isDefined) Map("input_R2" -> inputR2.get) else Map())
(if (inputR2.isDefined) Map("input_R2" -> inputR2.get) else Map()) ++
(bam2wig match {
case Some(b) => Map(
"output_wigle" -> b.outputWigleFile,
"output_tdf" -> b.outputTdfFile,
"output_bigwig" -> b.outputBwFile)
case _ => Map()
})
/** Settings to add to summary */
def summarySettings = Map(
......@@ -270,12 +277,15 @@ class Mapping(val root: Configurable) extends QScript with SummaryQScript with S
add(gears)
}
if (config("generate_wig", default = false).asBoolean)
addAll(Bam2Wig(this, finalBamFile).functions)
bam2wig.foreach(add(_))
addSummaryJobs()
}
protected lazy val bam2wig = if (config("generate_wig", default = false)) {
Some(Bam2Wig(this, finalBamFile))
} else None
/** Add bwa aln jobs */
def addBwaAln(R1: File, R2: Option[File], output: File): File = {
val bwaAlnR1 = new BwaAln(this)
......
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