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

Update summary creation for Flexiprep FastQC

parent d46ad182
......@@ -67,12 +67,14 @@ class Fastqc(root: Configurable) extends nl.lumc.sasc.biopet.extensions.Fastqc(r
line <- block if !line.startsWith("#");
values = line.split("\t") if values.size >= 4
) yield values(3)
/** Summary of the FastQC run, stored in a [[Json]] object */
def summary: Json = {
seqs.filter(x => found.exists(_.startsWith(x.name)))
}
def getSummary: Json = {
val subfixs = Map("plot_duplication_levels" -> "Images/duplication_levels.png",
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",
......@@ -82,12 +84,13 @@ class Fastqc(root: Configurable) extends nl.lumc.sasc.biopet.extensions.Fastqc(r
"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)))
.map {
case (name, relPath) =>
name -> Map("path" -> (outputDir + relPath))
}
val temp = ("" := outputMap) ->: jEmptyObject
return temp.fieldOrEmptyObject("")
(("" := outputMap) ->: jEmptyObject)
.fieldOrEmptyObject("")
}
}
......
......@@ -201,7 +201,7 @@ class FlexiprepSummary(val root: Configurable) extends InProcessFunction with Co
def fastqcSummary(fastqc: Fastqc): Option[Json] = {
if (fastqc == null) return None
else return Option(fastqc.getSummary)
else return Option(fastqc.summary)
}
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