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
else fqModules
}
protected case class Sequence(name: String, seq: String)
def getFoundAdapters: List[Sequence] = {
def getSeqs(file: File) = {
/**
* Retrieves the FASTQ file encoding as computed by FastQC.
*
* @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) {
(for (
line <- Source.fromFile(file).getLines(); if line.startsWith("#");
......
......@@ -25,7 +25,7 @@ class SeqtkSeq(root: Configurable) extends nl.lumc.sasc.biopet.extensions.seqtk.
override def beforeCmd {
super.beforeCmd
if (fastqc != null && Q == None) {
val encoding = fastqc.getEncoding
val encoding = fastqc.encoding
Q = encoding match {
case null => 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