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

Invert option, true is default now

parent f602182e
...@@ -36,7 +36,7 @@ trait BiopetCommandLineFunction extends CommandLineResources { biopetFunction => ...@@ -36,7 +36,7 @@ trait BiopetCommandLineFunction extends CommandLineResources { biopetFunction =>
var executable: String = _ var executable: String = _
var mainFunction = false var mainFunction = true
/** This is the default shell for drmaa jobs */ /** This is the default shell for drmaa jobs */
def defaultRemoteCommand = "bash" def defaultRemoteCommand = "bash"
......
...@@ -88,7 +88,6 @@ trait BiopetQScript extends Configurable with GatkLogging { qscript: QScript => ...@@ -88,7 +88,6 @@ trait BiopetQScript extends Configurable with GatkLogging { qscript: QScript =>
case q: MultiSampleQScript if q.onlySamples.nonEmpty && !q.samples.forall(x => q.onlySamples.contains(x._1)) => case q: MultiSampleQScript if q.onlySamples.nonEmpty && !q.samples.forall(x => q.onlySamples.contains(x._1)) =>
logger.info("Write report is skipped because sample flag is used") logger.info("Write report is skipped because sample flag is used")
case _ => reportClass.foreach { report => case _ => reportClass.foreach { report =>
report.mainFunction = true
add(report) add(report)
} }
} }
......
...@@ -22,6 +22,8 @@ import org.broadinstitute.gatk.utils.commandline.{ Input, Output } ...@@ -22,6 +22,8 @@ import org.broadinstitute.gatk.utils.commandline.{ Input, Output }
/** Extension for md5sum */ /** Extension for md5sum */
class Md5sum(val root: Configurable) extends BiopetCommandLineFunction with Version { class Md5sum(val root: Configurable) extends BiopetCommandLineFunction with Version {
mainFunction = false
@Input(doc = "Input") @Input(doc = "Input")
var input: File = _ var input: File = _
......
...@@ -30,6 +30,8 @@ import org.broadinstitute.gatk.utils.commandline.{ Output, Input } ...@@ -30,6 +30,8 @@ import org.broadinstitute.gatk.utils.commandline.{ Output, Input }
class SeqStat(val root: Configurable) extends ToolCommandFunction with Summarizable { class SeqStat(val root: Configurable) extends ToolCommandFunction with Summarizable {
def toolObject = nl.lumc.sasc.biopet.tools.SeqStat def toolObject = nl.lumc.sasc.biopet.tools.SeqStat
mainFunction = false
@Input(doc = "Input FASTQ", shortName = "input", required = true) @Input(doc = "Input FASTQ", shortName = "input", required = true)
var input: File = null var input: File = null
......
...@@ -32,6 +32,8 @@ import scala.io.Source ...@@ -32,6 +32,8 @@ import scala.io.Source
class VcfStats(val root: Configurable) extends ToolCommandFunction with Summarizable with Reference { class VcfStats(val root: Configurable) extends ToolCommandFunction with Summarizable with Reference {
def toolObject = nl.lumc.sasc.biopet.tools.VcfStats def toolObject = nl.lumc.sasc.biopet.tools.VcfStats
mainFunction = false
@Input(doc = "Input fastq", shortName = "I", required = true) @Input(doc = "Input fastq", shortName = "I", required = true)
var input: File = _ var input: File = _
......
...@@ -75,7 +75,6 @@ class Carp(val root: Configurable) extends QScript with MultisampleMappingTrait ...@@ -75,7 +75,6 @@ class Carp(val root: Configurable) extends QScript with MultisampleMappingTrait
samtoolsView.output = preProcessBam.get samtoolsView.output = preProcessBam.get
samtoolsView.b = true samtoolsView.b = true
samtoolsView.h = true samtoolsView.h = true
samtoolsView.mainFunction = true
add(samtoolsView) add(samtoolsView)
val bamMetricsFilter = BamMetrics(qscript, preProcessBam.get, new File(sampleDir, "metrics-filter"), sampleId = Some(sampleId)) val bamMetricsFilter = BamMetrics(qscript, preProcessBam.get, new File(sampleDir, "metrics-filter"), sampleId = Some(sampleId))
...@@ -95,7 +94,6 @@ class Carp(val root: Configurable) extends QScript with MultisampleMappingTrait ...@@ -95,7 +94,6 @@ class Carp(val root: Configurable) extends QScript with MultisampleMappingTrait
macs2.name = Some(sampleId) macs2.name = Some(sampleId)
macs2.outputdir = sampleDir + File.separator + "macs2" + File.separator + sampleId + File.separator macs2.outputdir = sampleDir + File.separator + "macs2" + File.separator + sampleId + File.separator
macs2.fileformat = if (paired) Some("BAMPE") else Some("BAM") macs2.fileformat = if (paired) Some("BAMPE") else Some("BAM")
macs2.mainFunction = true
add(macs2) add(macs2)
} }
} }
...@@ -133,7 +131,6 @@ class Carp(val root: Configurable) extends QScript with MultisampleMappingTrait ...@@ -133,7 +131,6 @@ class Carp(val root: Configurable) extends QScript with MultisampleMappingTrait
macs2.name = Some(sampleId + "_VS_" + controlId) macs2.name = Some(sampleId + "_VS_" + controlId)
macs2.fileformat = if (paired) Some("BAMPE") else Some("BAM") macs2.fileformat = if (paired) Some("BAMPE") else Some("BAM")
macs2.outputdir = sample.sampleDir + File.separator + "macs2" + File.separator + macs2.name.get + File.separator macs2.outputdir = sample.sampleDir + File.separator + "macs2" + File.separator + macs2.name.get + File.separator
macs2.mainFunction = true
add(macs2) add(macs2)
} }
} }
......
...@@ -113,7 +113,6 @@ class Flexiprep(val root: Configurable) extends QScript with SummaryQScript with ...@@ -113,7 +113,6 @@ class Flexiprep(val root: Configurable) extends QScript with SummaryQScript with
if (paired) outputFiles += ("fastq_input_R2" -> inputR2.get) if (paired) outputFiles += ("fastq_input_R2" -> inputR2.get)
fastqcR1 = Fastqc(this, inputR1, new File(outputDir, R1Name + ".fastqc/")) fastqcR1 = Fastqc(this, inputR1, new File(outputDir, R1Name + ".fastqc/"))
fastqcR1.mainFunction = true
add(fastqcR1) add(fastqcR1)
addSummarizable(fastqcR1, "fastqc_R1") addSummarizable(fastqcR1, "fastqc_R1")
outputFiles += ("fastqc_R1" -> fastqcR1.output) outputFiles += ("fastqc_R1" -> fastqcR1.output)
...@@ -133,7 +132,6 @@ class Flexiprep(val root: Configurable) extends QScript with SummaryQScript with ...@@ -133,7 +132,6 @@ class Flexiprep(val root: Configurable) extends QScript with SummaryQScript with
if (paired) { if (paired) {
fastqcR2 = Fastqc(this, inputR2.get, new File(outputDir, R2Name + ".fastqc/")) fastqcR2 = Fastqc(this, inputR2.get, new File(outputDir, R2Name + ".fastqc/"))
fastqcR2.mainFunction = true
add(fastqcR2) add(fastqcR2)
addSummarizable(fastqcR2, "fastqc_R2") addSummarizable(fastqcR2, "fastqc_R2")
outputFiles += ("fastqc_R2" -> fastqcR2.output) outputFiles += ("fastqc_R2" -> fastqcR2.output)
...@@ -230,7 +228,6 @@ class Flexiprep(val root: Configurable) extends QScript with SummaryQScript with ...@@ -230,7 +228,6 @@ class Flexiprep(val root: Configurable) extends QScript with SummaryQScript with
pipe.deps ::= fastqcR1.output pipe.deps ::= fastqcR1.output
pipe.deps ::= fastqcR2.output pipe.deps ::= fastqcR2.output
pipe.isIntermediate = !keepQcFastqFiles pipe.isIntermediate = !keepQcFastqFiles
pipe.mainFunction = true
add(pipe) add(pipe)
addSummarizable(fqSync, "fastq_sync") addSummarizable(fqSync, "fastq_sync")
......
...@@ -60,7 +60,6 @@ class CombineReads(val root: Configurable) extends QScript with SummaryQScript w ...@@ -60,7 +60,6 @@ class CombineReads(val root: Configurable) extends QScript with SummaryQScript w
flash.fastqR1 = fastqR1 flash.fastqR1 = fastqR1
flash.fastqR2 = fastqR2 flash.fastqR2 = fastqR2
flash.isIntermediate = (forwardPrimers ::: reversePrimers).nonEmpty flash.isIntermediate = (forwardPrimers ::: reversePrimers).nonEmpty
flash.mainFunction = true
add(flash) add(flash)
if ((forwardPrimers ::: reversePrimers).nonEmpty) { if ((forwardPrimers ::: reversePrimers).nonEmpty) {
...@@ -69,7 +68,6 @@ class CombineReads(val root: Configurable) extends QScript with SummaryQScript w ...@@ -69,7 +68,6 @@ class CombineReads(val root: Configurable) extends QScript with SummaryQScript w
cutadapt.fastqOutput = this.combinedFastq cutadapt.fastqOutput = this.combinedFastq
cutadapt.statsOutput = swapExt(outputDir, cutadapt.fastqOutput, ".fastq.gz", ".stats") cutadapt.statsOutput = swapExt(outputDir, cutadapt.fastqOutput, ".fastq.gz", ".stats")
(forwardPrimers ::: reversePrimers).foreach(cutadapt.anywhere += _) (forwardPrimers ::: reversePrimers).foreach(cutadapt.anywhere += _)
cutadapt.mainFunction = true
add(cutadapt) add(cutadapt)
addSummarizable(cutadapt, "cutadapt") addSummarizable(cutadapt, "cutadapt")
} }
......
...@@ -56,7 +56,6 @@ class ExtractUnmappedReads(val root: Configurable) extends QScript with BiopetQS ...@@ -56,7 +56,6 @@ class ExtractUnmappedReads(val root: Configurable) extends QScript with BiopetQS
if (paired) samtoolsViewSelectUnmapped.f = List("12") if (paired) samtoolsViewSelectUnmapped.f = List("12")
else samtoolsViewSelectUnmapped.f = List("4") else samtoolsViewSelectUnmapped.f = List("4")
samtoolsViewSelectUnmapped.isIntermediate = true samtoolsViewSelectUnmapped.isIntermediate = true
samtoolsViewSelectUnmapped.mainFunction = true
add(samtoolsViewSelectUnmapped) add(samtoolsViewSelectUnmapped)
// start bam to fastq (only on unaligned reads) also extract the matesam // start bam to fastq (only on unaligned reads) also extract the matesam
...@@ -68,7 +67,6 @@ class ExtractUnmappedReads(val root: Configurable) extends QScript with BiopetQS ...@@ -68,7 +67,6 @@ class ExtractUnmappedReads(val root: Configurable) extends QScript with BiopetQS
samToFastq.fastqUnpaired = fastqUnmappedSingletons samToFastq.fastqUnpaired = fastqUnmappedSingletons
} }
samToFastq.isIntermediate = !config("keep_unmapped_fastq", default = false).asBoolean samToFastq.isIntermediate = !config("keep_unmapped_fastq", default = false).asBoolean
samToFastq.mainFunction = true
add(samToFastq) add(samToFastq)
} }
} }
...@@ -37,7 +37,6 @@ class GearsCentrifuge(val root: Configurable) extends QScript with SummaryQScrip ...@@ -37,7 +37,6 @@ class GearsCentrifuge(val root: Configurable) extends QScript with SummaryQScrip
centrifuge.metFile = Some(centrifugeMetOutput) centrifuge.metFile = Some(centrifugeMetOutput)
val centrifugeCmd = centrifuge | new Gzip(this) > centrifugeOutput val centrifugeCmd = centrifuge | new Gzip(this) > centrifugeOutput
centrifugeCmd.threadsCorrection = -1 centrifugeCmd.threadsCorrection = -1
centrifugeCmd.mainFunction = true
add(centrifugeCmd) add(centrifugeCmd)
makeKreport("centrifuge", unique = false) makeKreport("centrifuge", unique = false)
...@@ -53,14 +52,12 @@ class GearsCentrifuge(val root: Configurable) extends QScript with SummaryQScrip ...@@ -53,14 +52,12 @@ class GearsCentrifuge(val root: Configurable) extends QScript with SummaryQScrip
centrifugeKreport.output = new File(outputDir, s"$outputName.$name.kreport") centrifugeKreport.output = new File(outputDir, s"$outputName.$name.kreport")
centrifugeKreport.onlyUnique = unique centrifugeKreport.onlyUnique = unique
val pipe = new BiopetFifoPipe(this, List(centrifugeKreport, Zcat(this, centrifugeOutput, fifo))) val pipe = new BiopetFifoPipe(this, List(centrifugeKreport, Zcat(this, centrifugeOutput, fifo)))
pipe.mainFunction = true
add(pipe) add(pipe)
val krakenReportJSON = new KrakenReportToJson(this) val krakenReportJSON = new KrakenReportToJson(this)
krakenReportJSON.inputReport = centrifugeKreport.output krakenReportJSON.inputReport = centrifugeKreport.output
krakenReportJSON.output = new File(outputDir, s"$outputName.$name.krkn.json") krakenReportJSON.output = new File(outputDir, s"$outputName.$name.krkn.json")
krakenReportJSON.skipNames = config("skipNames", default = false) krakenReportJSON.skipNames = config("skipNames", default = false)
krakenReportJSON.mainFunction = true
add(krakenReportJSON) add(krakenReportJSON)
addSummarizable(krakenReportJSON, s"${name}_report") addSummarizable(krakenReportJSON, s"${name}_report")
} }
......
...@@ -52,7 +52,6 @@ class GearsKraken(val root: Configurable) extends QScript with SummaryQScript wi ...@@ -52,7 +52,6 @@ class GearsKraken(val root: Configurable) extends QScript with SummaryQScript wi
seqtk.output = new File(outputDir, input.getName + ".fasta") seqtk.output = new File(outputDir, input.getName + ".fasta")
seqtk.A = true seqtk.A = true
seqtk.isIntermediate = true seqtk.isIntermediate = true
seqtk.mainFunction = true
add(seqtk) add(seqtk)
seqtk.output seqtk.output
} }
...@@ -72,7 +71,6 @@ class GearsKraken(val root: Configurable) extends QScript with SummaryQScript wi ...@@ -72,7 +71,6 @@ class GearsKraken(val root: Configurable) extends QScript with SummaryQScript wi
krakenAnalysis.classifiedOut = Some(new File(outputDir, s"$outputName.krkn.classified.fastq")) krakenAnalysis.classifiedOut = Some(new File(outputDir, s"$outputName.krkn.classified.fastq"))
krakenAnalysis.unclassifiedOut = Some(new File(outputDir, s"$outputName.krkn.unclassified.fastq")) krakenAnalysis.unclassifiedOut = Some(new File(outputDir, s"$outputName.krkn.unclassified.fastq"))
krakenAnalysis.mainFunction = true
add(krakenAnalysis) add(krakenAnalysis)
outputFiles += ("kraken_output_raw" -> krakenAnalysis.output) outputFiles += ("kraken_output_raw" -> krakenAnalysis.output)
...@@ -84,7 +82,6 @@ class GearsKraken(val root: Configurable) extends QScript with SummaryQScript wi ...@@ -84,7 +82,6 @@ class GearsKraken(val root: Configurable) extends QScript with SummaryQScript wi
krakenReport.input = krakenAnalysis.output krakenReport.input = krakenAnalysis.output
krakenReport.showZeros = true krakenReport.showZeros = true
krakenReport.output = new File(outputDir, s"$outputName.krkn.full") krakenReport.output = new File(outputDir, s"$outputName.krkn.full")
krakenReport.mainFunction = true
add(krakenReport) add(krakenReport)
outputFiles += ("kraken_report_input" -> krakenReport.input) outputFiles += ("kraken_report_input" -> krakenReport.input)
...@@ -94,7 +91,6 @@ class GearsKraken(val root: Configurable) extends QScript with SummaryQScript wi ...@@ -94,7 +91,6 @@ class GearsKraken(val root: Configurable) extends QScript with SummaryQScript wi
krakenReportJSON.inputReport = krakenReport.output krakenReportJSON.inputReport = krakenReport.output
krakenReportJSON.output = new File(outputDir, s"$outputName.krkn.json") krakenReportJSON.output = new File(outputDir, s"$outputName.krkn.json")
krakenReportJSON.skipNames = config("skipNames", default = false) krakenReportJSON.skipNames = config("skipNames", default = false)
krakenReportJSON.mainFunction = true
add(krakenReportJSON) add(krakenReportJSON)
addSummarizable(krakenReportJSON, "krakenreport") addSummarizable(krakenReportJSON, "krakenreport")
......
...@@ -51,13 +51,11 @@ class GearsQiimeOpen(val root: Configurable) extends QScript with SummaryQScript ...@@ -51,13 +51,11 @@ class GearsQiimeOpen(val root: Configurable) extends QScript with SummaryQScript
splitLib.input :+= fastqInput splitLib.input :+= fastqInput
splitLib.outputDir = new File(outputDir, "split_libraries_fastq") splitLib.outputDir = new File(outputDir, "split_libraries_fastq")
sampleId.foreach(splitLib.sampleIds :+= _.replaceAll("_", "-")) sampleId.foreach(splitLib.sampleIds :+= _.replaceAll("_", "-"))
splitLib.mainFunction = true
add(splitLib) add(splitLib)
val openReference = new PickOpenReferenceOtus(this) val openReference = new PickOpenReferenceOtus(this)
openReference.inputFasta = addDownsample(splitLib.outputSeqs, new File(splitLib.outputDir, s"${sampleId.get}.downsample.fna")) openReference.inputFasta = addDownsample(splitLib.outputSeqs, new File(splitLib.outputDir, s"${sampleId.get}.downsample.fna"))
openReference.outputDir = new File(outputDir, "pick_open_reference_otus") openReference.outputDir = new File(outputDir, "pick_open_reference_otus")
openReference.mainFunction = true
add(openReference) add(openReference)
_otuMap = openReference.otuMap _otuMap = openReference.otuMap
_otuTable = openReference.otuTable _otuTable = openReference.otuTable
......
...@@ -60,7 +60,6 @@ class GearsQiimeRtax(val root: Configurable) extends QScript with BiopetQScript ...@@ -60,7 +60,6 @@ class GearsQiimeRtax(val root: Configurable) extends QScript with BiopetQScript
slfR1.input :+= fastqR1 slfR1.input :+= fastqR1
slfR1.outputDir = new File(outputDir, "split_libraries_fastq_R1") slfR1.outputDir = new File(outputDir, "split_libraries_fastq_R1")
sampleId.foreach(slfR1.sampleIds :+= _) sampleId.foreach(slfR1.sampleIds :+= _)
slfR1.mainFunction = true
add(slfR1) add(slfR1)
lazy val slfR2 = fastqR2.map { file => lazy val slfR2 = fastqR2.map { file =>
...@@ -75,7 +74,6 @@ class GearsQiimeRtax(val root: Configurable) extends QScript with BiopetQScript ...@@ -75,7 +74,6 @@ class GearsQiimeRtax(val root: Configurable) extends QScript with BiopetQScript
val pickOtus = new PickOtus(this) val pickOtus = new PickOtus(this)
pickOtus.inputFasta = slfR1.outputSeqs pickOtus.inputFasta = slfR1.outputSeqs
pickOtus.outputDir = new File(outputDir, "pick_otus") pickOtus.outputDir = new File(outputDir, "pick_otus")
pickOtus.mainFunction = true
add(pickOtus) add(pickOtus)
val pickRepSet = new PickRepSet(this) val pickRepSet = new PickRepSet(this)
...@@ -85,7 +83,6 @@ class GearsQiimeRtax(val root: Configurable) extends QScript with BiopetQScript ...@@ -85,7 +83,6 @@ class GearsQiimeRtax(val root: Configurable) extends QScript with BiopetQScript
pickRepSet.outputFasta = Some(new File(repSetOutputDir, slfR1.outputSeqs.getName)) pickRepSet.outputFasta = Some(new File(repSetOutputDir, slfR1.outputSeqs.getName))
pickRepSet.logFile = Some(new File(repSetOutputDir, slfR1.outputSeqs.getName pickRepSet.logFile = Some(new File(repSetOutputDir, slfR1.outputSeqs.getName
.stripSuffix(".fasta").stripSuffix(".fa").stripSuffix(".fna") + ".log")) .stripSuffix(".fasta").stripSuffix(".fa").stripSuffix(".fna") + ".log"))
pickRepSet.mainFunction = true
add(pickRepSet) add(pickRepSet)
val assignTaxonomy = new AssignTaxonomy(this) val assignTaxonomy = new AssignTaxonomy(this)
...@@ -94,7 +91,6 @@ class GearsQiimeRtax(val root: Configurable) extends QScript with BiopetQScript ...@@ -94,7 +91,6 @@ class GearsQiimeRtax(val root: Configurable) extends QScript with BiopetQScript
assignTaxonomy.inputFasta = pickRepSet.outputFasta.get assignTaxonomy.inputFasta = pickRepSet.outputFasta.get
assignTaxonomy.read1SeqsFp = Some(slfR1.outputSeqs) assignTaxonomy.read1SeqsFp = Some(slfR1.outputSeqs)
assignTaxonomy.read2SeqsFp = slfR2.map(_.outputSeqs) assignTaxonomy.read2SeqsFp = slfR2.map(_.outputSeqs)
assignTaxonomy.mainFunction = true
add(assignTaxonomy) add(assignTaxonomy)
} }
} }
...@@ -38,7 +38,6 @@ class GearsSeqCount(val root: Configurable) extends QScript with BiopetQScript w ...@@ -38,7 +38,6 @@ class GearsSeqCount(val root: Configurable) extends QScript with BiopetQScript w
val seqCount = new SageCountFastq(this) val seqCount = new SageCountFastq(this)
seqCount.input = fastqInput seqCount.input = fastqInput
seqCount.output = countFile seqCount.output = countFile
seqCount.mainFunction = true
add(seqCount) add(seqCount)
} }
} }
...@@ -211,7 +211,6 @@ class Gentrap(val root: Configurable) extends QScript ...@@ -211,7 +211,6 @@ class Gentrap(val root: Configurable) extends QScript
ribosomalRefFlat().foreach(job.intervalFile = _) ribosomalRefFlat().foreach(job.intervalFile = _)
job.outputBam = createFile("cleaned.bam") job.outputBam = createFile("cleaned.bam")
job.discardedBam = Some(createFile("rrna.bam")) job.discardedBam = Some(createFile("rrna.bam"))
job.mainFunction = true
add(job) add(job)
Some(job.outputBam) Some(job.outputBam)
} else bamFile } else bamFile
......
...@@ -35,7 +35,6 @@ class BaseCounts(val root: Configurable) extends QScript with Measurement with A ...@@ -35,7 +35,6 @@ class BaseCounts(val root: Configurable) extends QScript with Measurement with A
baseCounter.outputDir = new File(outputDir, id) baseCounter.outputDir = new File(outputDir, id)
baseCounter.prefix = id baseCounter.prefix = id
baseCounter.refFlat = annotationRefFlat() baseCounter.refFlat = annotationRefFlat()
baseCounter.mainFunction = true
add(baseCounter) add(baseCounter)
id -> baseCounter id -> baseCounter
} }
......
...@@ -33,7 +33,6 @@ trait CufflinksMeasurement extends QScript with Measurement { ...@@ -33,7 +33,6 @@ trait CufflinksMeasurement extends QScript with Measurement {
val jobs = bamFiles.map { val jobs = bamFiles.map {
case (id, file) => case (id, file) =>
val cufflinks = makeCufflinksJob(id, file) val cufflinks = makeCufflinksJob(id, file)
cufflinks.mainFunction = true
add(cufflinks) add(cufflinks)
id -> cufflinks id -> cufflinks
} }
......
...@@ -41,7 +41,6 @@ class FragmentsPerGene(val root: Configurable) extends QScript with Measurement ...@@ -41,7 +41,6 @@ class FragmentsPerGene(val root: Configurable) extends QScript with Measurement
sortSam.output = swapExt(outputDir, file, ".bam", ".idsorted.bam") sortSam.output = swapExt(outputDir, file, ".bam", ".idsorted.bam")
sortSam.sortOrder = "queryname" sortSam.sortOrder = "queryname"
sortSam.isIntermediate = true sortSam.isIntermediate = true
sortSam.mainFunction = true
add(sortSam) add(sortSam)
sortSam.output sortSam.output
} else file } else file
...@@ -52,7 +51,6 @@ class FragmentsPerGene(val root: Configurable) extends QScript with Measurement ...@@ -52,7 +51,6 @@ class FragmentsPerGene(val root: Configurable) extends QScript with Measurement
job.output = new File(outputDir, s"$id.$name.counts") job.output = new File(outputDir, s"$id.$name.counts")
job.format = Option("bam") job.format = Option("bam")
job.order = if (sortOnId) Some("name") else Some("pos") job.order = if (sortOnId) Some("name") else Some("pos")
job.mainFunction = true
add(job) add(job)
id -> job id -> job
} }
......
...@@ -200,7 +200,6 @@ class Mapping(val root: Configurable) extends QScript with SummaryQScript with S ...@@ -200,7 +200,6 @@ class Mapping(val root: Configurable) extends QScript with SummaryQScript with S
if (chunking) { if (chunking) {
val fastSplitterR1 = new FastqSplitter(this) val fastSplitterR1 = new FastqSplitter(this)
fastSplitterR1.mainFunction = true
fastSplitterR1.input = inputR1 fastSplitterR1.input = inputR1
for ((chunkDir, fastqfile) <- chunks) fastSplitterR1.output :+= fastqfile._1 for ((chunkDir, fastqfile) <- chunks) fastSplitterR1.output :+= fastqfile._1
fastSplitterR1.isIntermediate = true fastSplitterR1.isIntermediate = true
...@@ -208,7 +207,6 @@ class Mapping(val root: Configurable) extends QScript with SummaryQScript with S ...@@ -208,7 +207,6 @@ class Mapping(val root: Configurable) extends QScript with SummaryQScript with S
if (paired) { if (paired) {
val fastSplitterR2 = new FastqSplitter(this) val fastSplitterR2 = new FastqSplitter(this)
fastSplitterR2.mainFunction = true
fastSplitterR2.input = inputR2.get fastSplitterR2.input = inputR2.get
for ((chunkDir, fastqfile) <- chunks) fastSplitterR2.output :+= fastqfile._2.get for ((chunkDir, fastqfile) <- chunks) fastSplitterR2.output :+= fastqfile._2.get
fastSplitterR2.isIntermediate = true fastSplitterR2.isIntermediate = true
...@@ -257,12 +255,10 @@ class Mapping(val root: Configurable) extends QScript with SummaryQScript with S ...@@ -257,12 +255,10 @@ class Mapping(val root: Configurable) extends QScript with SummaryQScript with S
if (!skipMarkduplicates) { if (!skipMarkduplicates) {
bamFile = new File(outputDir, outputName + ".dedup.bam") bamFile = new File(outputDir, outputName + ".dedup.bam")
val md = MarkDuplicates(this, bamFiles, bamFile) val md = MarkDuplicates(this, bamFiles, bamFile)
md.mainFunction = true
add(md) add(md)
addSummarizable(md, "mark_duplicates") addSummarizable(md, "mark_duplicates")
} else if (skipMarkduplicates && chunking) { } else if (skipMarkduplicates && chunking) {
val mergeSamFile = MergeSamFiles(this, bamFiles, new File(outputDir, outputName + ".merge.bam")) val mergeSamFile = MergeSamFiles(this, bamFiles, new File(outputDir, outputName + ".merge.bam"))
mergeSamFile.mainFunction = true
add(mergeSamFile) add(mergeSamFile)
bamFile = mergeSamFile.output bamFile = mergeSamFile.output
} }
...@@ -301,7 +297,6 @@ class Mapping(val root: Configurable) extends QScript with SummaryQScript with S ...@@ -301,7 +297,6 @@ class Mapping(val root: Configurable) extends QScript with SummaryQScript with S
bwaAlnR1.fastq = R1 bwaAlnR1.fastq = R1
bwaAlnR1.output = swapExt(output.getParent, output, ".bam", ".R1.sai") bwaAlnR1.output = swapExt(output.getParent, output, ".bam", ".R1.sai")
bwaAlnR1.isIntermediate = true bwaAlnR1.isIntermediate = true
bwaAlnR1.mainFunction = true
add(bwaAlnR1) add(bwaAlnR1)
val samFile: File = if (paired) { val samFile: File = if (paired) {
...@@ -309,7 +304,6 @@ class Mapping(val root: Configurable) extends QScript with SummaryQScript with S ...@@ -309,7 +304,6 @@ class Mapping(val root: Configurable) extends QScript with SummaryQScript with S
bwaAlnR2.fastq = R2.get bwaAlnR2.fastq = R2.get
bwaAlnR2.output = swapExt(output.getParent, output, ".bam", ".R2.sai") bwaAlnR2.output = swapExt(output.getParent, output, ".bam", ".R2.sai")
bwaAlnR2.isIntermediate = true bwaAlnR2.isIntermediate = true
bwaAlnR2.mainFunction = true
add(bwaAlnR2) add(bwaAlnR2)
val bwaSampe = new BwaSampe(this) val bwaSampe = new BwaSampe(this)
...@@ -320,7 +314,6 @@ class Mapping(val root: Configurable) extends QScript with SummaryQScript with S ...@@ -320,7 +314,6 @@ class Mapping(val root: Configurable) extends QScript with SummaryQScript with S
bwaSampe.r = getReadGroupBwa bwaSampe.r = getReadGroupBwa
bwaSampe.output = swapExt(output.getParent, output, ".bam", ".sam") bwaSampe.output = swapExt(output.getParent, output, ".bam", ".sam")
bwaSampe.isIntermediate = true bwaSampe.isIntermediate = true
bwaSampe.mainFunction = true
add(bwaSampe) add(bwaSampe)
bwaSampe.output bwaSampe.output
...@@ -331,7 +324,6 @@ class Mapping(val root: Configurable) extends QScript with SummaryQScript with S ...@@ -331,7 +324,6 @@ class Mapping(val root: Configurable) extends QScript with SummaryQScript with S
bwaSamse.r = getReadGroupBwa bwaSamse.r = getReadGroupBwa
bwaSamse.output = swapExt(output.getParent, output, ".bam", ".sam") bwaSamse.output = swapExt(output.getParent, output, ".bam", ".sam")
bwaSamse.isIntermediate = true bwaSamse.isIntermediate = true
bwaSamse.mainFunction = true
add(bwaSamse) add(bwaSamse)
bwaSamse.output bwaSamse.output
...@@ -339,7 +331,6 @@ class Mapping(val root: Configurable) extends QScript with SummaryQScript with S ...@@ -339,7 +331,6 @@ class Mapping(val root: Configurable) extends QScript with SummaryQScript with S
val sortSam = SortSam(this, samFile, output) val sortSam = SortSam(this, samFile, output)
if (chunking || !skipMarkduplicates) sortSam.isIntermediate = true if (chunking || !skipMarkduplicates) sortSam.isIntermediate = true
sortSam.mainFunction = true
add(sortSam) add(sortSam)