Commit 86ecb782 authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Added a check on empty files

parent 24a1b29e
......@@ -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) Logging.addError(s"Input R1 is a empty file: $inputR1")
inputR2.foreach(r => if (r.exists() && r.length() == 0) Logging.addError(s"Input R2 is a empty file: $r"))
inputFiles :+= new InputFile(inputR1)
inputR2.foreach(inputFiles :+= new InputFile(_))
......
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