Commit 0055d58e authored by bow's avatar bow
Browse files

Update summary creation for Flexiprep FastQC

parent d46ad182
...@@ -67,27 +67,30 @@ class Fastqc(root: Configurable) extends nl.lumc.sasc.biopet.extensions.Fastqc(r ...@@ -67,27 +67,30 @@ class Fastqc(root: Configurable) extends nl.lumc.sasc.biopet.extensions.Fastqc(r
line <- block if !line.startsWith("#"); line <- block if !line.startsWith("#");
values = line.split("\t") if values.size >= 4 values = line.split("\t") if values.size >= 4
) yield values(3) ) yield values(3)
/** Summary of the FastQC run, stored in a [[Json]] object */
def summary: Json = {
seqs.filter(x => found.exists(_.startsWith(x.name))) seqs.filter(x => found.exists(_.startsWith(x.name)))
} }
val outputDir: String = output.getAbsolutePath.stripSuffix(".zip")
val outputMap =
Map("plot_duplication_levels" -> "Images/duplication_levels.png",
"plot_kmer_profiles" -> "Images/kmer_profiles.png",
"plot_per_base_gc_content" -> "Images/per_base_gc_content.png",
"plot_per_base_n_content" -> "Images/per_base_n_content.png",
"plot_per_base_quality" -> "Images/per_base_quality.png",
"plot_per_base_sequence_content" -> "Images/per_base_sequence_content.png",
"plot_per_sequence_gc_content" -> "Images/per_sequence_gc_content.png",
"plot_per_sequence_quality" -> "Images/per_sequence_quality.png",
"plot_sequence_length_distribution" -> "Images/sequence_length_distribution.png",
"fastqc_data" -> "fastqc_data.txt")
.map {
case (name, relPath) =>
name -> Map("path" -> (outputDir + relPath))
}
def getSummary: Json = { (("" := outputMap) ->: jEmptyObject)
val subfixs = Map("plot_duplication_levels" -> "Images/duplication_levels.png", .fieldOrEmptyObject("")
"plot_kmer_profiles" -> "Images/kmer_profiles.png",
"plot_per_base_gc_content" -> "Images/per_base_gc_content.png",
"plot_per_base_n_content" -> "Images/per_base_n_content.png",
"plot_per_base_quality" -> "Images/per_base_quality.png",
"plot_per_base_sequence_content" -> "Images/per_base_sequence_content.png",
"plot_per_sequence_gc_content" -> "Images/per_sequence_gc_content.png",
"plot_per_sequence_quality" -> "Images/per_sequence_quality.png",
"plot_sequence_length_distribution" -> "Images/sequence_length_distribution.png",
"fastqc_data" -> "fastqc_data.txt")
val dir = output.getAbsolutePath.stripSuffix(".zip") + "/"
var outputMap: Map[String, Map[String, String]] = Map()
for ((k, v) <- subfixs) outputMap += (k -> Map("path" -> (dir + v)))
val temp = ("" := outputMap) ->: jEmptyObject
return temp.fieldOrEmptyObject("")
} }
} }
......
...@@ -201,7 +201,7 @@ class FlexiprepSummary(val root: Configurable) extends InProcessFunction with Co ...@@ -201,7 +201,7 @@ class FlexiprepSummary(val root: Configurable) extends InProcessFunction with Co
def fastqcSummary(fastqc: Fastqc): Option[Json] = { def fastqcSummary(fastqc: Fastqc): Option[Json] = {
if (fastqc == null) return None if (fastqc == null) return None
else return Option(fastqc.getSummary) else return Option(fastqc.summary)
} }
def clipstatSummary(): Option[Json] = { def clipstatSummary(): Option[Json] = {
......
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