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

Remove unused vars

parent 8e8b825e
......@@ -132,7 +132,7 @@ class Flexiprep(val root: Configurable) extends QScript with BiopetQScript {
var results: Map[String, File] = Map()
var R1: File = new File(R1_in)
var R2: File = new File(R2_in)
var R2: File = if (paired) new File(R2_in) else null
var deps: List[File] = if (paired) List(R1, R2) else List(R1)
val seqtkSeq_R1 = SeqtkSeq(this, R1, swapExt(outDir, R1, R1_ext, ".sanger" + R1_ext), fastqc_R1)
......@@ -199,7 +199,8 @@ class Flexiprep(val root: Configurable) extends QScript with BiopetQScript {
}
sickle.output_stats = swapExt(outDir, R1, R1_ext, ".trim.stats")
sickle.deps = deps
add(sickle, isIntermediate = true)
sickle.isIntermediate = true
add(sickle)
summary.addSickle(sickle, chunk)
R1 = sickle.output_R1
if (paired) R2 = sickle.output_R2
......@@ -256,7 +257,8 @@ class Flexiprep(val root: Configurable) extends QScript with BiopetQScript {
}
def extractIfNeeded(file: File, runDir: String): File = {
if (file.getName().endsWith(".gz") || file.getName().endsWith(".gzip")) {
if (file == null) return file
else if (file.getName().endsWith(".gz") || file.getName().endsWith(".gzip")) {
var newFile: File = swapExt(runDir, file, ".gz", "")
if (file.getName().endsWith(".gzip")) newFile = swapExt(runDir, file, ".gzip", "")
val zcatCommand = Zcat(this, file, newFile)
......
......@@ -122,12 +122,10 @@ class Mapping(val root: Configurable) extends QScript with BiopetQScript {
}
def biopetScript() {
var fastq_R1: File = input_R1
var fastq_R2: File = if (paired) input_R2 else ""
if (!skipFlexiprep) {
flexiprep.outputDir = outputDir + "flexiprep/"
flexiprep.input_R1 = fastq_R1
if (paired) flexiprep.input_R2 = fastq_R2
flexiprep.input_R1 = input_R1
if (paired) flexiprep.input_R2 = input_R2
flexiprep.sampleName = this.RGSM
flexiprep.libraryName = this.RGLB
flexiprep.init
......@@ -145,22 +143,22 @@ class Mapping(val root: Configurable) extends QScript with BiopetQScript {
var chunks: Map[String, (String, String)] = Map()
if (chunking) for (t <- 1 to numberChunks.getOrElse(1)) {
val chunkDir = outputDir + "chunks/" + t + "/"
chunks += (chunkDir -> (removeGz(chunkDir + fastq_R1.getName),
if (paired) removeGz(chunkDir + fastq_R2.getName) else ""))
chunks += (chunkDir -> (removeGz(chunkDir + input_R1.getName),
if (paired) removeGz(chunkDir + input_R2.getName) else ""))
}
else chunks += (outputDir -> (flexiprep.extractIfNeeded(fastq_R1, flexiprep.outputDir),
flexiprep.extractIfNeeded(fastq_R2, flexiprep.outputDir)))
else chunks += (outputDir -> (flexiprep.extractIfNeeded(input_R1, flexiprep.outputDir),
flexiprep.extractIfNeeded(input_R2, flexiprep.outputDir)))
if (chunking) {
val fastSplitter_R1 = new FastqSplitter(this)
fastSplitter_R1.input = fastq_R1
fastSplitter_R1.input = input_R1
for ((chunkDir, fastqfile) <- chunks) fastSplitter_R1.output :+= fastqfile._1
fastSplitter_R1.isIntermediate = true
add(fastSplitter_R1)
if (paired) {
val fastSplitter_R2 = new FastqSplitter(this)
fastSplitter_R2.input = fastq_R2
fastSplitter_R2.input = input_R2
for ((chunkDir, fastqfile) <- chunks) fastSplitter_R2.output :+= fastqfile._2
fastSplitter_R2.isIntermediate = true
add(fastSplitter_R2)
......
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