Commit 6ae2579a authored by bow's avatar bow
Browse files

Refactor FastQC encoding retrieval

parent 1b221835
...@@ -66,9 +66,20 @@ class Fastqc(root: Configurable) extends nl.lumc.sasc.biopet.extensions.Fastqc(r ...@@ -66,9 +66,20 @@ class Fastqc(root: Configurable) extends nl.lumc.sasc.biopet.extensions.Fastqc(r
else fqModules else fqModules
} }
protected case class Sequence(name: String, seq: String) /**
def getFoundAdapters: List[Sequence] = { * Retrieves the FASTQ file encoding as computed by FastQC.
def getSeqs(file: File) = { *
* @return encoding name
* @throws NoSuchElementException when the "Basic Statistics" key does not exist in the mapping or
* when a line starting with "Encoding" does not exist.
*/
@throws(classOf[NoSuchElementException])
lazy val encoding: String =
qcModules("Basic Statistics")
.dropWhile(!_.startsWith("Encoding"))
.head
.stripPrefix("Encoding\t")
if (file != null) { if (file != null) {
(for ( (for (
line <- Source.fromFile(file).getLines(); if line.startsWith("#"); line <- Source.fromFile(file).getLines(); if line.startsWith("#");
......
...@@ -25,7 +25,7 @@ class SeqtkSeq(root: Configurable) extends nl.lumc.sasc.biopet.extensions.seqtk. ...@@ -25,7 +25,7 @@ class SeqtkSeq(root: Configurable) extends nl.lumc.sasc.biopet.extensions.seqtk.
override def beforeCmd { override def beforeCmd {
super.beforeCmd super.beforeCmd
if (fastqc != null && Q == None) { if (fastqc != null && Q == None) {
val encoding = fastqc.getEncoding val encoding = fastqc.encoding
Q = encoding match { Q = encoding match {
case null => None case null => None
case s if (s.contains("Sanger / Illumina 1.9")) => None case s if (s.contains("Sanger / Illumina 1.9")) => None
......
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