Commit 1aca9cd6 authored by bow's avatar bow
Browse files

Use def again instead of lazy vals

parent 4aed5bdc
...@@ -17,12 +17,14 @@ ...@@ -17,12 +17,14 @@
package nl.lumc.sasc.biopet.pipelines.flexiprep package nl.lumc.sasc.biopet.pipelines.flexiprep
import java.io.{ File, FileNotFoundException } import java.io.{ File, FileNotFoundException }
import scala.io.Source import scala.io.Source
import argonaut._, Argonaut._ import argonaut._, Argonaut._
import scalaz._, Scalaz._ import scalaz._, Scalaz._
import nl.lumc.sasc.biopet.core.config.Configurable import nl.lumc.sasc.biopet.core.config.Configurable
import nl.lumc.sasc.biopet.utils.ConfigUtils
/** /**
* FastQC wrapper with added functionality for the Flexiprep pipeline * FastQC wrapper with added functionality for the Flexiprep pipeline
...@@ -41,7 +43,7 @@ class Fastqc(root: Configurable) extends nl.lumc.sasc.biopet.extensions.Fastqc(r ...@@ -41,7 +43,7 @@ class Fastqc(root: Configurable) extends nl.lumc.sasc.biopet.extensions.Fastqc(r
*/ */
@throws(classOf[FileNotFoundException]) @throws(classOf[FileNotFoundException])
@throws(classOf[IllegalStateException]) @throws(classOf[IllegalStateException])
protected lazy val qcModules: Map[String, Array[String]] = { protected def qcModules: Map[String, Array[String]] = {
val outputDir = output.getAbsolutePath.stripSuffix(".zip") val outputDir = output.getAbsolutePath.stripSuffix(".zip")
val dataFile = new File(outputDir, "fastqc_data.txt") val dataFile = new File(outputDir, "fastqc_data.txt")
...@@ -80,7 +82,7 @@ class Fastqc(root: Configurable) extends nl.lumc.sasc.biopet.extensions.Fastqc(r ...@@ -80,7 +82,7 @@ class Fastqc(root: Configurable) extends nl.lumc.sasc.biopet.extensions.Fastqc(r
* when a line starting with "Encoding" does not exist. * when a line starting with "Encoding" does not exist.
*/ */
@throws(classOf[NoSuchElementException]) @throws(classOf[NoSuchElementException])
lazy val encoding: String = def encoding: String =
qcModules("Basic Statistics") qcModules("Basic Statistics")
.dropWhile(!_.startsWith("Encoding")) .dropWhile(!_.startsWith("Encoding"))
.head .head
...@@ -94,7 +96,7 @@ class Fastqc(root: Configurable) extends nl.lumc.sasc.biopet.extensions.Fastqc(r ...@@ -94,7 +96,7 @@ class Fastqc(root: Configurable) extends nl.lumc.sasc.biopet.extensions.Fastqc(r
* *
* @return a [[Set]] of [[AdapterSequence]] objects. * @return a [[Set]] of [[AdapterSequence]] objects.
*/ */
lazy val foundAdapters: Set[AdapterSequence] = { def foundAdapters: Set[AdapterSequence] = {
/** Returns a list of adapter and/or contaminant sequences known to FastQC */ /** Returns a list of adapter and/or contaminant sequences known to FastQC */
def getFastqcSeqs(file: File): Set[AdapterSequence] = def getFastqcSeqs(file: File): Set[AdapterSequence] =
...@@ -135,13 +137,11 @@ class Fastqc(root: Configurable) extends nl.lumc.sasc.biopet.extensions.Fastqc(r ...@@ -135,13 +137,11 @@ class Fastqc(root: Configurable) extends nl.lumc.sasc.biopet.extensions.Fastqc(r
"plot_per_sequence_quality" -> "Images/per_sequence_quality.png", "plot_per_sequence_quality" -> "Images/per_sequence_quality.png",
"plot_sequence_length_distribution" -> "Images/sequence_length_distribution.png", "plot_sequence_length_distribution" -> "Images/sequence_length_distribution.png",
"fastqc_data" -> "fastqc_data.txt") "fastqc_data" -> "fastqc_data.txt")
.map { .map { case (name, relPath) =>
case (name, relPath) =>
name -> Map("path" -> (outputDir + relPath)) name -> Map("path" -> (outputDir + relPath))
} }
(("" := outputMap) ->: jEmptyObject) ConfigUtils.mapToJson(outputMap)
.fieldOrEmptyObject("")
} }
} }
......
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