Commit a9c9dfbd authored by bow's avatar bow
Browse files

Use requirements check on mapping and flexiprep pipeline

parent ad0c55bc
......@@ -62,11 +62,12 @@ class Flexiprep(val root: Configurable) extends QScript with BiopetQScript {
val summary = new FlexiprepSummary(this)
def init() {
if (input_R1 == null) throw new IllegalStateException("Missing R1 on flexiprep module")
if (outputDir == null) throw new IllegalStateException("Missing Output directory on flexiprep module")
if (sampleId == null) throw new IllegalStateException("Missing Sample name on flexiprep module")
if (libId == null) throw new IllegalStateException("Missing Library name on flexiprep module")
else if (!outputDir.endsWith("/")) outputDir += "/"
require(outputDir != null, "Missing output directory on flexiprep module")
require(input_R1 != null, "Missing output directory on flexiprep module")
require(sampleId != null, "Missing sample ID on flexiprep module")
require(libId != null, "Missing library ID on flexiprep module")
if (!outputDir.endsWith("/")) outputDir += "/"
paired = (input_R2 != null)
if (input_R1.endsWith(".gz")) R1_name = input_R1.getName.substring(0, input_R1.getName.lastIndexOf(".gz"))
......
......@@ -95,13 +95,14 @@ class Mapping(val root: Configurable) extends QScript with BiopetQScript {
def finalBamFile: File = outputDir + outputName + ".final.bam"
def init() {
if (outputDir == null) throw new IllegalStateException("Missing Output directory on mapping module")
else if (!outputDir.endsWith("/")) outputDir += "/"
if (input_R1 == null) throw new IllegalStateException("Missing FastQ R1 on mapping module")
require(outputDir != null, "Missing output directory on mapping module")
require(input_R1 != null, "Missing output directory on mapping module")
require(sampleId != null, "Missing sample ID on mapping module")
require(libId != null, "Missing library ID on mapping module")
if (!outputDir.endsWith("/")) outputDir += "/"
paired = (input_R2 != null)
if (libId == null) libId = config("library_id")
if (sampleId == null) sampleId = config("sample_id")
if (readgroupId == null && sampleId != null && libId != null) readgroupId = sampleId + "-" + libId
else if (readgroupId == null) readgroupId = config("readgroup_id")
......
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