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 { ...@@ -86,7 +86,11 @@ trait BiopetQScript extends Configurable with GatkLogging {
globalConfig.writeReport(qSettings.runName, new File(outputDir, ".log/" + qSettings.runName)) 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") 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() Logging.checkErrors()
} }
......
...@@ -26,7 +26,7 @@ trait MultiSampleQScript extends SummaryQScript { ...@@ -26,7 +26,7 @@ trait MultiSampleQScript extends SummaryQScript {
qscript => qscript =>
@Argument(doc = "Only Sample", shortName = "s", required = false, fullName = "sample") @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") require(globalConfig.map.contains("samples"), "No Samples found in config")
...@@ -131,7 +131,7 @@ trait MultiSampleQScript extends SummaryQScript { ...@@ -131,7 +131,7 @@ trait MultiSampleQScript extends SummaryQScript {
/** Runs addAndTrackJobs method for each sample */ /** Runs addAndTrackJobs method for each sample */
final def addSamplesJobs() { final def addSamplesJobs() {
if (onlySamples.isEmpty) { if (onlySamples.isEmpty || samples.forall(x => onlySamples.contains(x._1))) {
samples.foreach { case (sampleId, sample) => sample.addAndTrackJobs() } samples.foreach { case (sampleId, sample) => sample.addAndTrackJobs() }
addMultiSampleJobs() addMultiSampleJobs()
} else onlySamples.foreach(sampleId => samples.get(sampleId) match { } else onlySamples.foreach(sampleId => samples.get(sampleId) match {
......
...@@ -135,7 +135,11 @@ trait SummaryQScript extends BiopetQScript { ...@@ -135,7 +135,11 @@ trait SummaryQScript extends BiopetQScript {
for ((_, file) <- this.summaryFiles) for ((_, file) <- this.summaryFiles)
addChecksum(file) 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