From c7b0c4152f5d01c05a7a067fe90202418017ec9b Mon Sep 17 00:00:00 2001 From: Peter van 't Hof <p.j.van_t_hof@lumc.nl> Date: Mon, 9 May 2016 09:32:14 +0200 Subject: [PATCH] Addec config option to disable merging of countfiles --- .../gentrap/measures/Measurement.scala | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/measures/Measurement.scala b/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/measures/Measurement.scala index b07d295a8..8f470ee06 100644 --- a/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/measures/Measurement.scala +++ b/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/measures/Measurement.scala @@ -29,6 +29,7 @@ trait Measurement extends SummaryQScript with Reference { qscript: QScript => /** * Method to add a bamFile to the pipeline + * * @param id Unique id used for this bam file, most likely to be a sampleName * @param file Location of the bam file */ @@ -51,6 +52,8 @@ trait Measurement extends SummaryQScript with Reference { qscript: QScript => require(bamFiles.nonEmpty) } + lazy val mergeCountFiles: Boolean = config("merge_count_files", default = true) + private var extraSummaryFiles: Map[String, File] = Map() def addMergeTableJob(countFiles: List[File], @@ -58,18 +61,22 @@ trait Measurement extends SummaryQScript with Reference { qscript: QScript => name: String, fileExtension: String, args: MergeArgs = mergeArgs): Unit = { - add(MergeTables(this, countFiles, outputFile, - args.idCols, args.valCol, args.numHeaderLines, args.fallback, fileExtension = Some(fileExtension))) - extraSummaryFiles += s"${name}_table" -> outputFile + if (mergeCountFiles) { + add(MergeTables(this, countFiles, outputFile, + args.idCols, args.valCol, args.numHeaderLines, args.fallback, fileExtension = Some(fileExtension))) + extraSummaryFiles += s"${name}_table" -> outputFile + } } def addHeatmapJob(countTable: File, outputFile: File, name: String, countType: Option[String] = None): Unit = { - val job = new PlotHeatmap(qscript) - job.input = countTable - job.output = outputFile - job.countType = countType - add(job) - extraSummaryFiles += s"${name}_heatmap" -> outputFile + if (mergeCountFiles) { + val job = new PlotHeatmap(qscript) + job.input = countTable + job.output = outputFile + job.countType = countType + add(job) + extraSummaryFiles += s"${name}_heatmap" -> outputFile + } } /** Must return a map with used settings for this pipeline */ -- GitLab