Commit bcd97f00 authored by Sander Bollen's avatar Sander Bollen
Browse files

Merge branch 'fix-sample_flag_summary_report' into 'develop'

Fix summary when --sample flag is used in multisample pipelines

Fixes #206 

See merge request !237
parents 6300d051 fc2af339
......@@ -86,7 +86,11 @@ trait BiopetQScript extends Configurable with GatkLogging {
globalConfig.writeReport(qSettings.runName, new File(outputDir, ".log/" + qSettings.runName))
else Logging.addError("Parent of output dir: '" + outputDir.getParent + "' is not writeable, outputdir can not be created")
reportClass.foreach(add(_))
this match {
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")
case _ => reportClass.foreach(add(_))
}
Logging.checkErrors()
}
......
......@@ -26,7 +26,7 @@ trait MultiSampleQScript extends SummaryQScript {
qscript =>
@Argument(doc = "Only Sample", shortName = "s", required = false, fullName = "sample")
private val onlySamples: List[String] = Nil
private[core] val onlySamples: List[String] = Nil
require(globalConfig.map.contains("samples"), "No Samples found in config")
......@@ -131,7 +131,7 @@ trait MultiSampleQScript extends SummaryQScript {
/** Runs addAndTrackJobs method for each sample */
final def addSamplesJobs() {
if (onlySamples.isEmpty) {
if (onlySamples.isEmpty || samples.forall(x => onlySamples.contains(x._1))) {
samples.foreach { case (sampleId, sample) => sample.addAndTrackJobs() }
addMultiSampleJobs()
} else onlySamples.foreach(sampleId => samples.get(sampleId) match {
......
......@@ -135,7 +135,11 @@ trait SummaryQScript extends BiopetQScript {
for ((_, file) <- this.summaryFiles)
addChecksum(file)
add(writeSummary)
this match {
case q: MultiSampleQScript if q.onlySamples.nonEmpty && !q.samples.forall(x => q.onlySamples.contains(x._1)) =>
logger.info("Write summary is skipped because sample flag is used")
case _ => add(writeSummary)
}
}
}
......
Supports Markdown
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