Commit 097f37b0 authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Added check abort step in pipeline

parent 7c863726
......@@ -17,9 +17,9 @@ package nl.lumc.sasc.biopet.extensions.tools
import java.io.File
import nl.lumc.sasc.biopet.core.{Reference, ToolCommandFunction}
import nl.lumc.sasc.biopet.core.{ Reference, ToolCommandFunction }
import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{Input, Output}
import org.broadinstitute.gatk.utils.commandline.{ Input, Output }
class ValidateFastq(val root: Configurable) extends ToolCommandFunction {
def toolObject = nl.lumc.sasc.biopet.tools.ValidateFastq
......
......@@ -96,10 +96,10 @@ object ValidateFastq extends ToolCommand {
private var maxQual: Option[Char] = None
/**
*
* @param record
* @throws IllegalStateException
*/
*
* @param record
* @throws IllegalStateException
*/
private[tools] def checkQualEncoding(record: FastqRecord): Unit = {
val min = record.getBaseQualityString.min
val max = record.getBaseQualityString.max
......@@ -114,10 +114,10 @@ object ValidateFastq extends ToolCommand {
}
/**
*
* @return
* @throws IllegalStateException
*/
*
* @return
* @throws IllegalStateException
*/
private[tools] def getPossibleEncodings: List[String] = {
val buffer: ListBuffer[String] = ListBuffer()
(minQual, maxQual) match {
......
/**
* Biopet is built on top of GATK Queue for building bioinformatic
* pipelines. It is mainly intended to support LUMC SHARK cluster which is running
* SGE. But other types of HPC that are supported by GATK Queue (such as PBS)
* should also be able to execute Biopet tools and pipelines.
*
* Copyright 2014 Sequencing Analysis Support Core - Leiden University Medical Center
*
* Contact us at: sasc@lumc.nl
*
* A dual licensing mode is applied. The source code within this project that are
* not part of GATK Queue is freely available for non-commercial use under an AGPL
* license; For commercial users or users who do not want to follow the AGPL
* license, please contact us to obtain a separate license.
*/
package nl.lumc.sasc.biopet.pipelines.flexiprep
import java.io.File
import nl.lumc.sasc.biopet.core.summary.WriteSummary
import org.broadinstitute.gatk.queue.function.InProcessFunction
import org.broadinstitute.gatk.utils.commandline.{ Argument, Input }
import scala.io.Source
/**
* This class checks md5sums and give an exit code 1 when md5sum is not the same
*
* Created by pjvanthof on 16/08/15.
*/
class CheckValidateFastq extends InProcessFunction {
@Input(required = true)
var inputLogFile: File = _
/** Exits whenever the input md5sum is not the same as the output md5sum */
def run: Unit = {
val reader = Source.fromFile(inputLogFile)
reader.getLines().foreach { line =>
if (line.startsWith("ERROR")) {
logger.error("Corrupt fastq file found, aborting pipeline")
// 130 Simulates a ctr-C
Runtime.getRuntime.halt(130)
}
}
reader.close()
}
}
\ No newline at end of file
......@@ -20,7 +20,7 @@ import nl.lumc.sasc.biopet.core.{ BiopetFifoPipe, PipelineCommand, SampleLibrary
import nl.lumc.sasc.biopet.extensions.{ Zcat, Gzip }
import nl.lumc.sasc.biopet.utils.config.Configurable
import nl.lumc.sasc.biopet.utils.IoUtils._
import nl.lumc.sasc.biopet.extensions.tools.{ValidateFastq, SeqStat, FastqSync}
import nl.lumc.sasc.biopet.extensions.tools.{ ValidateFastq, SeqStat, FastqSync }
import org.broadinstitute.gatk.queue.QScript
......@@ -120,6 +120,11 @@ class Flexiprep(val root: Configurable) extends QScript with SummaryQScript with
validateFastq.jobOutputFile = new File(outputDir, ".validate_fastq.log.out")
add(validateFastq)
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/"))
add(fastqc_R2)
......
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