Commit 3fb5cf10 authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Merge branch 'feature-skip_abort' into 'develop'

Feature skip abort

This adds the possibility to force the pipeline to continue with a config value even when the Fastqvalidator finds a problem.

This merge request depends on !326 

See merge request !333
parents e972a0d1 75ee4ec8
......@@ -120,10 +120,12 @@ class Flexiprep(val root: Configurable) extends QScript with SummaryQScript with
validateFastq.jobOutputFile = new File(outputDir, ".validate_fastq.log.out")
add(validateFastq)
if (config("abort_on_corrupt_fastq", default = true)) {
val checkValidateFastq = new CheckValidateFastq
checkValidateFastq.inputLogFile = validateFastq.jobOutputFile
checkValidateFastq.jobOutputFile = new File(outputDir, ".check.validate_fastq.log.out")
add(checkValidateFastq)
}
if (paired) {
fastqc_R2 = Fastqc(this, input_R2.get, new File(outputDir, R2_name + ".fastqc/"))
......@@ -271,10 +273,12 @@ class Flexiprep(val root: Configurable) extends QScript with SummaryQScript with
validateFastq.jobOutputFile = new File(outputDir, ".validate_fastq.qc.log.out")
add(validateFastq)
if (config("abort_on_corrupt_fastq", default = true)) {
val checkValidateFastq = new CheckValidateFastq
checkValidateFastq.inputLogFile = validateFastq.jobOutputFile
checkValidateFastq.jobOutputFile = new File(outputDir, ".check.validate_fastq.qc.log.out")
add(checkValidateFastq)
}
outputFiles += ("output_R1_gzip" -> fastqR1Qc)
if (paired) outputFiles += ("output_R2_gzip" -> fastqR2Qc.get)
......
......@@ -18,10 +18,9 @@ package nl.lumc.sasc.biopet.pipelines.flexiprep
import java.io.File
import com.google.common.io.Files
import nl.lumc.sasc.biopet.utils.config.Config
import nl.lumc.sasc.biopet.extensions.{ Gzip, Sickle, Zcat }
import nl.lumc.sasc.biopet.extensions.tools.{ FastqSync, SeqStat }
import nl.lumc.sasc.biopet.extensions.tools.{ ValidateFastq, SeqStat }
import nl.lumc.sasc.biopet.utils.ConfigUtils
import nl.lumc.sasc.biopet.utils.config.Config
import org.apache.commons.io.FileUtils
import org.broadinstitute.gatk.queue.QSettings
import org.scalatest.Matchers
......@@ -50,20 +49,24 @@ class FlexiprepTest extends TestNGSuite with Matchers {
val skipTrims = Array(true, false)
val skipClips = Array(true, false)
val zipped = Array(true, false)
val abortOnCorruptFastqs = Array(true, false)
for (
pair <- paired;
skipTrim <- skipTrims;
skipClip <- skipClips;
zip <- zipped
) yield Array("", pair, skipTrim, skipClip, zip)
zip <- zipped;
abortOnCorruptFastq <- abortOnCorruptFastqs
) yield Array("", pair, skipTrim, skipClip, zip, abortOnCorruptFastq)
}
@Test(dataProvider = "flexiprepOptions")
def testFlexiprep(f: String, paired: Boolean, skipTrim: Boolean, skipClip: Boolean, zipped: Boolean) = {
def testFlexiprep(f: String, paired: Boolean, skipTrim: Boolean, skipClip: Boolean,
zipped: Boolean, abortOnCorruptFastq: Boolean) = {
val map = ConfigUtils.mergeMaps(Map("output_dir" -> FlexiprepTest.outputDir,
"skip_trim" -> skipTrim,
"skip_clip" -> skipClip
"skip_clip" -> skipClip,
"abort_on_corrupt_fastq" -> abortOnCorruptFastq
), Map(FlexiprepTest.executables.toSeq: _*))
val flexiprep: Flexiprep = initPipeline(map)
......@@ -75,6 +78,10 @@ class FlexiprepTest extends TestNGSuite with Matchers {
flexiprep.functions.count(_.isInstanceOf[Fastqc]) shouldBe (if (paired) 4 else 2)
flexiprep.functions.count(_.isInstanceOf[SeqStat]) shouldBe (if (paired) 4 else 2)
flexiprep.functions.count(_.isInstanceOf[ValidateFastq]) shouldBe 2
flexiprep.functions.count(_.isInstanceOf[CheckValidateFastq]) shouldBe (if (abortOnCorruptFastq) 2 else 0)
}
// remove temporary run directory all tests in the class have been run
......
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