Commit b9b1a0b0 authored by Peter van 't Hof's avatar Peter van 't Hof

Fixing dependency error

parent 38b152be
......@@ -14,12 +14,12 @@
*/
package nl.lumc.sasc.biopet.pipelines.flexiprep
import nl.lumc.sasc.biopet.core.summary.{Summarizable, SummaryQScript}
import nl.lumc.sasc.biopet.core.{BiopetFifoPipe, PipelineCommand, SampleLibraryTag}
import nl.lumc.sasc.biopet.extensions.{Gzip, Zcat}
import nl.lumc.sasc.biopet.core.summary.{ Summarizable, SummaryQScript }
import nl.lumc.sasc.biopet.core.{ BiopetFifoPipe, PipelineCommand, SampleLibraryTag }
import nl.lumc.sasc.biopet.extensions.{ Gzip, Zcat }
import nl.lumc.sasc.biopet.utils.config.Configurable
import nl.lumc.sasc.biopet.utils.IoUtils._
import nl.lumc.sasc.biopet.extensions.tools.{FastqSync, SeqStat, ValidateFastq}
import nl.lumc.sasc.biopet.extensions.tools.{ FastqSync, SeqStat, ValidateFastq }
import nl.lumc.sasc.biopet.utils.Logging
import org.broadinstitute.gatk.queue.QScript
......@@ -179,9 +179,8 @@ class Flexiprep(val root: Configurable) extends QScript with SummaryQScript with
var R1 = R1_in
var R2 = R2_in
val qcCmdR1 = new QcCommand(this, fastqcR1)
val qcCmdR1 = new QcCommand(this, fastqcR1, "R1")
qcCmdR1.input = R1_in
qcCmdR1.read = "R1"
qcCmdR1.output = if (paired) new File(outDir, fastqR1Qc.getName.stripSuffix(".gz"))
else fastqR1Qc
qcCmdR1.deps :+= fastqcR1.output
......@@ -189,10 +188,9 @@ class Flexiprep(val root: Configurable) extends QScript with SummaryQScript with
addSummarizable(qcCmdR1, "qc_command_R1")
if (paired) {
val qcCmdR2 = new QcCommand(this, fastqcR2)
val qcCmdR2 = new QcCommand(this, fastqcR2, "R2")
qcCmdR2.input = R2_in.get
qcCmdR2.output = new File(outDir, fastqR2Qc.get.getName.stripSuffix(".gz"))
qcCmdR2.read = "R2"
addSummarizable(qcCmdR2, "qc_command_R2")
qcCmdR1.compress = false
......
......@@ -26,7 +26,7 @@ import org.broadinstitute.gatk.utils.commandline.{ Output, Input }
/**
* Created by pjvan_thof on 9/22/15.
*/
class QcCommand(val root: Configurable, val fastqc: Fastqc) extends BiopetCommandLineFunction with Summarizable {
class QcCommand(val root: Configurable, val fastqc: Fastqc, val read: String) extends BiopetCommandLineFunction with Summarizable {
val flexiprep = root match {
case f: Flexiprep => f
......@@ -41,14 +41,21 @@ class QcCommand(val root: Configurable, val fastqc: Fastqc) extends BiopetComman
var compress = true
var read: String = _
override def defaultCoreMemory = 2.0
override def defaultThreads = 3
val seqtk = new SeqtkSeq(root)
var clip: Option[Cutadapt] = if (!flexiprep.skipClip) Some(new Cutadapt(root, fastqc)) else None
var trim: Option[Sickle] = None
var trim: Option[Sickle] = if (!flexiprep.skipTrim) {
val sickle = new Sickle(root)
sickle.outputStats = new File(flexiprep.outputDir, s"${flexiprep.sampleId.getOrElse("x")}-${flexiprep.libId.getOrElse("x")}.$read.trim.stats")
sickle.inputR1 = clip match {
case Some(c) => c.fastqOutput
case _ => seqtk.output
}
Some(sickle)
} else None
lazy val outputCommand: BiopetCommandLineFunction = if (compress) {
val gzip = Gzip(root)
gzip.output = output
......@@ -121,17 +128,10 @@ class QcCommand(val root: Configurable, val fastqc: Fastqc) extends BiopetComman
} else None
} else None
trim = if (!flexiprep.skipTrim) {
val sickle = new Sickle(root)
sickle.outputStats = new File(flexiprep.outputDir, s"${flexiprep.sampleId.getOrElse("x")}-${flexiprep.libId.getOrElse("x")}.$read.trim.stats")
sickle.inputR1 = clip match {
case Some(c) => c.fastqOutput
case _ => seqtk.output
}
sickle.outputR1 = new File(output.getParentFile, input.getName + ".sickle.fq")
addPipeJob(sickle)
Some(sickle)
} else None
trim.foreach { t =>
t.outputR1 = new File(output.getParentFile, input.getName + ".sickle.fq")
addPipeJob(t)
}
val outputFile = (clip, trim) match {
case (_, Some(t)) => t.outputR1
......
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