Commit a12237bd authored by Peter van 't Hof's avatar Peter van 't Hof Committed by GitHub

Merge branch 'develop' into fix-BIOPET-650

parents 5fb8f2ca 4fb8a7b6
...@@ -126,17 +126,21 @@ trait BiopetQScript extends Configurable with GatkLogging { qscript: QScript => ...@@ -126,17 +126,21 @@ trait BiopetQScript extends Configurable with GatkLogging { qscript: QScript =>
} }
}) })
logger.info("Adding report") val writeHtmlReport: Boolean = config("write_html_report", default = true)
this match {
case q: MultiSampleQScript if q.onlySamples.nonEmpty && !q.samples.forall(x => q.onlySamples.contains(x._1)) => if (writeHtmlReport) {
logger.info("Write report is skipped because sample flag is used") logger.info("Adding report")
case _ => reportClass.foreach { report => this match {
for (f <- functions) f match { case q: MultiSampleQScript if q.onlySamples.nonEmpty && !q.samples.forall(x => q.onlySamples.contains(x._1)) =>
case w: WriteSummary => report.deps :+= w.jobOutputFile logger.info("Write report is skipped because sample flag is used")
case _ => case _ => reportClass.foreach { report =>
for (f <- functions) f match {
case w: WriteSummary => report.deps :+= w.jobOutputFile
case _ =>
}
report.jobOutputFile = new File(report.outputDir, ".report.out")
add(report)
} }
report.jobOutputFile = new File(report.outputDir, ".report.out")
add(report)
} }
} }
......
...@@ -56,12 +56,7 @@ class GearsSingle(val parent: Configurable) extends QScript with SummaryQScript ...@@ -56,12 +56,7 @@ class GearsSingle(val parent: Configurable) extends QScript with SummaryQScript
if (sampleId == null || sampleId == None) Logging.addError("Missing sample ID on GearsSingle module") if (sampleId == null || sampleId == None) Logging.addError("Missing sample ID on GearsSingle module")
if (outputName == null) { if (outputName == null) {
if (fastqR1.nonEmpty) outputName = fastqR1.headOption.map(_.getName outputName = sampleId.getOrElse("noName") + libId.map("-" + _).getOrElse("")
.stripSuffix(".gz")
.stripSuffix(".fastq")
.stripSuffix(".fq"))
.getOrElse("noName")
else outputName = bamFile.map(_.getName.stripSuffix(".bam")).getOrElse("noName")
} }
if (fastqR1.nonEmpty) { if (fastqR1.nonEmpty) {
......
...@@ -108,7 +108,7 @@ abstract class TestGearsSingle extends TestNGSuite with Matchers { ...@@ -108,7 +108,7 @@ abstract class TestGearsSingle extends TestNGSuite with Matchers {
gears.outputName shouldBe "test" gears.outputName shouldBe "test"
} else { } else {
// in the following cases the filename should have been determined by the filename // in the following cases the filename should have been determined by the filename
gears.outputName shouldBe (if (inputMode == Some("bam")) "bamfile" else "R1") gears.outputName shouldBe "sampleName-libName"
} }
val pipesJobs = gears.functions.filter(_.isInstanceOf[BiopetCommandLineFunction]) val pipesJobs = gears.functions.filter(_.isInstanceOf[BiopetCommandLineFunction])
......
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