Commit 8e67bf4f authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Seqstat now uses quality type data

parent 7a45bbcd
......@@ -75,24 +75,24 @@ class Flexiprep(val root: Configurable) extends QScript with BiopetQScript {
outputFiles += ("fastq_input_R1" -> extractIfNeeded(input_R1, outputDir))
if (paired) outputFiles += ("fastq_input_R2" -> extractIfNeeded(input_R2, outputDir))
addSeqstat(outputFiles("fastq_input_R1"), "seqstat_R1")
if (paired) addSeqstat(outputFiles("fastq_input_R2"), "seqstat_R2")
addSha1sum(outputFiles("fastq_input_R1"), "sha1_R1")
if (paired) addSha1sum(outputFiles("fastq_input_R2"), "sha1_R2")
var fastqc_R1 = Fastqc(this, input_R1, outputDir + "/" + R1_name + ".fastqc/")
add(fastqc_R1)
outputFiles += ("fastqc_R1" -> fastqc_R1.output)
outputFiles += ("qualtype_R1" -> getQualtype(fastqc_R1, R1_name))
outputFiles += ("contams_R1" -> getContams(fastqc_R1, R1_name))
addSeqstat(outputFiles("fastq_input_R1"), "seqstat_R1", fastqc_R1)
addSha1sum(outputFiles("fastq_input_R1"), "sha1_R1")
if (paired) {
var fastqc_R2 = Fastqc(this, input_R2, outputDir + "/" + R2_name + ".fastqc/")
add(fastqc_R2)
outputFiles += ("fastqc_R2" -> fastqc_R2.output)
outputFiles += ("qualtype_R2" -> getQualtype(fastqc_R2, R2_name))
outputFiles += ("contams_R2" -> getContams(fastqc_R2, R2_name))
addSeqstat(outputFiles("fastq_input_R2"), "seqstat_R2", fastqc_R2)
addSha1sum(outputFiles("fastq_input_R2"), "sha1_R2")
}
}
......@@ -275,11 +275,13 @@ class Flexiprep(val root: Configurable) extends QScript with BiopetQScript {
} else return file
}
def addSeqstat(fastq: File, key: String) {
def addSeqstat(fastq: File, key: String, fastqc:Fastqc = null) {
val ext = fastq.getName.substring(fastq.getName.lastIndexOf("."))
val seqstat = new Seqstat(this)
seqstat.input_fastq = fastq
seqstat.fastqc = fastqc
seqstat.out = swapExt(outputDir, fastq, ext, ".seqstats.json")
if (fastqc != null) seqstat.deps ::= fastqc.output
add(seqstat)
outputFiles += (key -> seqstat.out)
}
......
......@@ -2,6 +2,7 @@ package nl.lumc.sasc.biopet.pipelines.flexiprep.scripts
import java.io.File
import nl.lumc.sasc.biopet.function.fastq.Fastqc
import org.broadinstitute.gatk.utils.commandline.{ Input, Output }
import nl.lumc.sasc.biopet.core.config.Configurable
......@@ -16,9 +17,23 @@ class Seqstat(val root: Configurable) extends PythonCommandLineFunction {
@Output(doc = "Output file", shortName = "out", required = true)
var out: File = _
var fmt: String = _
var fastqc: Fastqc = _
override def beforeCmd {
if (fastqc != null && fmt == null) {
fastqc.getEncoding match {
case null => {}
case s if (s.contains("Sanger / Illumina 1.9")) => fmt = "sanger"
case s if (s.contains("Illumina <1.3")) => fmt = "solexa"
case s if (s.contains("Illumina 1.3")) => fmt = "illumina"
case s if (s.contains("Illumina 1.5")) => fmt = "illumina"
//case _ => null
}
}
}
def cmdLine = {
getPythonCommand +
optional("--fmt", fmt) +
......
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