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

Merge branch 'fix-BIOPET-493' into 'develop'

Fixing Biopet-493



See merge request !505
parents 32ddf7a8 3c73be57
......@@ -204,7 +204,7 @@ class Flexiprep(val root: Configurable) extends QScript with SummaryQScript with
fqSync.outputFastq2 = new File(outDir, fastqR2Qc.get.getName)
fqSync.outputStats = new File(outDir, s"${sampleId.getOrElse("x")}-${libId.getOrElse("x")}.sync.stats")
val pipe = new BiopetFifoPipe(this, fqSync :: Nil) with Summarizable {
val pipe = new BiopetFifoPipe(this, fqSync :: qcCmdR1.jobs ::: qcCmdR2.jobs) with Summarizable {
override def configNamespace = "qc_cmd"
override def beforeGraph(): Unit = {
......@@ -233,6 +233,8 @@ class Flexiprep(val root: Configurable) extends QScript with SummaryQScript with
pipe.deps ::= fastqcR1.output
pipe.deps ::= fastqcR2.output
pipe.deps ::= R1_in
pipe.deps ::= R2_in.get
pipe.isIntermediate = !keepQcFastqFiles
addSummarizable(pipe, "qc_cmd")
add(pipe)
......
......@@ -19,11 +19,11 @@ import java.util.Date
import nl.lumc.sasc.biopet.core._
import nl.lumc.sasc.biopet.core.summary.SummaryQScript
import nl.lumc.sasc.biopet.extensions.bowtie.{ Bowtie, Bowtie2 }
import nl.lumc.sasc.biopet.extensions.bwa.{ BwaAln, BwaMem, BwaSampe, BwaSamse }
import nl.lumc.sasc.biopet.extensions.bowtie.{Bowtie, Bowtie2}
import nl.lumc.sasc.biopet.extensions.bwa.{BwaAln, BwaMem, BwaSampe, BwaSamse}
import nl.lumc.sasc.biopet.extensions.gmap.Gsnap
import nl.lumc.sasc.biopet.extensions.hisat.Hisat2
import nl.lumc.sasc.biopet.extensions.picard.{ AddOrReplaceReadGroups, MarkDuplicates, MergeSamFiles, ReorderSam, SortSam }
import nl.lumc.sasc.biopet.extensions.picard.{AddOrReplaceReadGroups, MarkDuplicates, MergeSamFiles, ReorderSam, SortSam}
import nl.lumc.sasc.biopet.extensions.tools.FastqSplitter
import nl.lumc.sasc.biopet.extensions._
import nl.lumc.sasc.biopet.pipelines.bammetrics.BamMetrics
......@@ -31,7 +31,7 @@ import nl.lumc.sasc.biopet.pipelines.bamtobigwig.Bam2Wig
import nl.lumc.sasc.biopet.pipelines.flexiprep.Flexiprep
import nl.lumc.sasc.biopet.pipelines.gears.GearsSingle
import nl.lumc.sasc.biopet.pipelines.mapping.scripts.TophatRecondition
import nl.lumc.sasc.biopet.utils.textToSize
import nl.lumc.sasc.biopet.utils.{Logging, textToSize}
import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.queue.QScript
......@@ -150,9 +150,11 @@ class Mapping(val root: Configurable) extends QScript with SummaryQScript with S
/** Will be executed before script */
def init() {
require(outputDir != null, "Missing output directory on mapping module")
require(inputR1 != null, "Missing output directory on mapping module")
require(inputR1 != null, "Missing inputR1 on mapping module")
require(sampleId.isDefined, "Missing sample ID on mapping module")
require(libId.isDefined, "Missing library ID on mapping module")
if (inputR1.exists() && inputR1.length() == 0) logger.warn(s"Input R1 is a empty file: $inputR1")
inputR2.foreach(r => if (r.exists() && r.length() == 0) logger.warn(s"Input R2 is a empty file: $r"))
inputFiles :+= new InputFile(inputR1)
inputR2.foreach(inputFiles :+= new InputFile(_))
......@@ -171,7 +173,8 @@ class Mapping(val root: Configurable) extends QScript with SummaryQScript with S
val chunkSize: String = config("chunksize", default = "5G")
val filesize = if (inputR1.getName.endsWith(".gz") || inputR1.getName.endsWith(".gzip")) inputR1.length * 3
else inputR1.length
numberChunks = Option(ceil(filesize.toDouble / textToSize(chunkSize)).toInt)
numberChunks = Some(ceil(filesize.toDouble / textToSize(chunkSize)).toInt)
if (numberChunks == Some(0)) numberChunks = Some(1)
}
}
logger.debug("Chunks: " + numberChunks.getOrElse(1))
......
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