Commit 0460d525 authored by Peter van 't Hof's avatar Peter van 't Hof

Style fixes

parent f6ea9831
......@@ -63,7 +63,7 @@ class SummaryDbTest extends TestNGSuite with Matchers {
db.createTables()
Await.result(db.createOrUpdateStat(0, 0, Some(0), Some(0), Some(0),
"""
"""
|{
|"content": "test",
|"content2": {
......@@ -71,9 +71,9 @@ class SummaryDbTest extends TestNGSuite with Matchers {
|}
| }""".stripMargin), Duration.Inf)
db.getStatKeys(0,Left(0),Some(Left(0)),Some(Left(0)),Some(Left(0)), keyValues = Map()) shouldBe Map()
db.getStatKeys(0,Left(0),Some(Left(0)),Some(Left(0)),Some(Left(0)), keyValues = Map("content" -> List("content"))) shouldBe Map("content" -> Some("test"))
db.getStatKeys(0,Left(0),Some(Left(0)),Some(Left(0)),Some(Left(0)), keyValues = Map("content" -> List("content2", "key"))) shouldBe Map("content" -> Some("value"))
db.getStatKeys(0, Left(0), Some(Left(0)), Some(Left(0)), Some(Left(0)), keyValues = Map()) shouldBe Map()
db.getStatKeys(0, Left(0), Some(Left(0)), Some(Left(0)), Some(Left(0)), keyValues = Map("content" -> List("content"))) shouldBe Map("content" -> Some("test"))
db.getStatKeys(0, Left(0), Some(Left(0)), Some(Left(0)), Some(Left(0)), keyValues = Map("content" -> List("content2", "key"))) shouldBe Map("content" -> Some("value"))
db.close()
}
......@@ -97,8 +97,8 @@ class SummaryDbTest extends TestNGSuite with Matchers {
|}
| }""".stripMargin), Duration.Inf)
db.getStatsForSamples(0, Left(0),Some(Left(0)), keyValues = Map()) shouldBe Map(0 -> Map())
db.getStatsForSamples(0, Left(0),Some(Left(0)), keyValues = Map("content" -> List("content"))) shouldBe Map(0 -> Map("content" -> Some("test")))
db.getStatsForSamples(0, Left(0), Some(Left(0)), keyValues = Map()) shouldBe Map(0 -> Map())
db.getStatsForSamples(0, Left(0), Some(Left(0)), keyValues = Map("content" -> List("content"))) shouldBe Map(0 -> Map("content" -> Some("test")))
db.close()
}
......@@ -122,13 +122,12 @@ class SummaryDbTest extends TestNGSuite with Matchers {
|}
| }""".stripMargin), Duration.Inf)
db.getStatsForLibraries(0, Left(0),Some(Left(0)), keyValues = Map()) shouldBe Map((0,0) -> Map())
db.getStatsForLibraries(0, Left(0),Some(Left(0)), keyValues = Map("content" -> List("content"))) shouldBe Map((0,0) -> Map("content" -> Some("test")))
db.getStatsForLibraries(0, Left(0), Some(Left(0)), keyValues = Map()) shouldBe Map((0, 0) -> Map())
db.getStatsForLibraries(0, Left(0), Some(Left(0)), keyValues = Map("content" -> List("content"))) shouldBe Map((0, 0) -> Map("content" -> Some("test")))
db.close()
}
@Test
def testExecutable: Unit = {
val dbFile = File.createTempFile("summary.", ".db")
......
......@@ -124,31 +124,31 @@
#end
</td>
#for (lib <- libraries.filter(_.sampleId == sample.id))
#{ val paired = settings.filter(_._1._1 == sample.id).filter(_._1._2 == lib.id).head._2("paired") == Some(true) }#
<td #if (paired == true) rowspan="2" #end>
#if (multisample)
<a href="${rootPath}Samples/${sample.name}/Libraries/${lib.name}/index.html">${lib.name}</a>
#else
${lib.name}
#end
</td>
#{ val reads = if (paired == true) List("R1", "R2") else List("R1") }#
#for (read <- reads)
#if (read == "R2") </tr><tr> #end
#{
val statsPaths = Map("num_total" -> List("bases", "num_total"))
val seqstatStats = summary.getStatKeys(runId, Right("flexiprep"), Some(Right("seqstat_" + read)), sample = Some(Left(sample.id)), library = Some(Left(lib.id)), keyValues = statsPaths)
val seqstatQcStats = summary.getStatKeys(runId, Right("flexiprep"), Some(Right("seqstat_" + read + "_qc")), sample = Some(Left(sample.id)), library = Some(Left(lib.id)), keyValues = statsPaths)
#{ val paired = settings.filter(_._1._1 == sample.id).filter(_._1._2 == lib.id).head._2("paired") == Some(true) }#
<td #if (paired == true) rowspan="2" #end>
#if (multisample)
<a href="${rootPath}Samples/${sample.name}/Libraries/${lib.name}/index.html">${lib.name}</a>
#else
${lib.name}
#end
</td>
#{ val reads = if (paired == true) List("R1", "R2") else List("R1") }#
#for (read <- reads)
#if (read == "R2") </tr><tr> #end
#{
val statsPaths = Map("num_total" -> List("bases", "num_total"))
val seqstatStats = summary.getStatKeys(runId, Right("flexiprep"), Some(Right("seqstat_" + read)), sample = Some(Left(sample.id)), library = Some(Left(lib.id)), keyValues = statsPaths)
val seqstatQcStats = summary.getStatKeys(runId, Right("flexiprep"), Some(Right("seqstat_" + read + "_qc")), sample = Some(Left(sample.id)), library = Some(Left(lib.id)), keyValues = statsPaths)
val beforeTotal = seqstatStats("num_total").getOrElse(0).toString.toLong
val afterTotal = seqstatQcStats("num_total").getOrElse(0).toString.toLong
}#
<td>${read}</td>
<td>${beforeTotal}</td>
<td>${beforeTotal - afterTotal}</td>
<td>${(beforeTotal - afterTotal).toDouble / beforeTotal * 100}%</td>
<td>${afterTotal}</td>
#end
val beforeTotal = seqstatStats("num_total").getOrElse(0).toString.toLong
val afterTotal = seqstatQcStats("num_total").getOrElse(0).toString.toLong
}#
<td>${read}</td>
<td>${beforeTotal}</td>
<td>${beforeTotal - afterTotal}</td>
<td>${(beforeTotal - afterTotal).toDouble / beforeTotal * 100}%</td>
<td>${afterTotal}</td>
#end
</tr>
#end
#end
......
......@@ -129,42 +129,42 @@
#end
</td>
#for (lib <- libraries.filter(_.sampleId == sample.id))
#{ val paired = settings.filter(_._1._1 == sample.id).filter(_._1._2 == lib.id).head._2("paired") == Some(true) }#
<td #if (paired == true) rowspan="2" #end>
#if (multisample)
<a href="${rootPath}Samples/${sample.name}/Libraries/${lib.name}/index.html">${lib.name}</a>
#else
${lib.name}
#end
</td>
#{ val reads = if (paired == true) List("R1", "R2") else List("R1") }#
#for (read <- reads)
#if (read == "R2") </tr><tr> #end
#{
val seqstatPaths = Map("num_total" -> List("reads", "num_total"))
val seqstatStats = summary.getStatKeys(runId, Right("flexiprep"), Some(Right("seqstat_" + read)), sample = Some(Left(sample.id)), library = Some(Left(lib.id)), keyValues = seqstatPaths)
val seqstatQcStats = summary.getStatKeys(runId, Right("flexiprep"), Some(Right("seqstat_" + read + "_qc")), sample = Some(Left(sample.id)), library = Some(Left(lib.id)), keyValues = seqstatPaths)
#{ val paired = settings.filter(_._1._1 == sample.id).filter(_._1._2 == lib.id).head._2("paired") == Some(true) }#
<td #if (paired == true) rowspan="2" #end>
#if (multisample)
<a href="${rootPath}Samples/${sample.name}/Libraries/${lib.name}/index.html">${lib.name}</a>
#else
${lib.name}
#end
</td>
#{ val reads = if (paired == true) List("R1", "R2") else List("R1") }#
#for (read <- reads)
#if (read == "R2") </tr><tr> #end
#{
val seqstatPaths = Map("num_total" -> List("reads", "num_total"))
val seqstatStats = summary.getStatKeys(runId, Right("flexiprep"), Some(Right("seqstat_" + read)), sample = Some(Left(sample.id)), library = Some(Left(lib.id)), keyValues = seqstatPaths)
val seqstatQcStats = summary.getStatKeys(runId, Right("flexiprep"), Some(Right("seqstat_" + read + "_qc")), sample = Some(Left(sample.id)), library = Some(Left(lib.id)), keyValues = seqstatPaths)
val clippingPaths = Map("num_reads_discarded_too_short" -> List("num_reads_discarded_too_short"),
"num_reads_discarded_too_long" -> List("num_reads_discarded_too_long"))
val clippingStats = summary.getStatKeys(runId, Right("flexiprep"), Some(Right("clipping_" + read)), sample = Some(Left(sample.id)), library = Some(Left(lib.id)), keyValues = clippingPaths)
val clippingPaths = Map("num_reads_discarded_too_short" -> List("num_reads_discarded_too_short"),
"num_reads_discarded_too_long" -> List("num_reads_discarded_too_long"))
val clippingStats = summary.getStatKeys(runId, Right("flexiprep"), Some(Right("clipping_" + read)), sample = Some(Left(sample.id)), library = Some(Left(lib.id)), keyValues = clippingPaths)
val trimmingPaths = Map("num_reads_discarded" -> List("num_reads_discarded_" + read))
val trimmingStats = summary.getStatKeys(runId, Right("flexiprep"), Some(Right("trimming")), sample = Some(Left(sample.id)), library = Some(Left(lib.id)), keyValues = trimmingPaths)
val trimmingPaths = Map("num_reads_discarded" -> List("num_reads_discarded_" + read))
val trimmingStats = summary.getStatKeys(runId, Right("flexiprep"), Some(Right("trimming")), sample = Some(Left(sample.id)), library = Some(Left(lib.id)), keyValues = trimmingPaths)
val beforeTotal = seqstatStats("num_total").getOrElse(0).toString.toLong
val afterTotal = seqstatQcStats("num_total").getOrElse(0).toString.toLong
val clippingDiscardedToShort = clippingStats("num_reads_discarded_too_short").getOrElse(0).toString.toLong
val clippingDiscardedToLong = clippingStats("num_reads_discarded_too_long").getOrElse(0).toString.toLong
val trimmingDiscarded = trimmingStats("num_reads_discarded").getOrElse(0).toString.toLong
}#
<td>${read}</td>
<td>${beforeTotal}</td>
<td>${clippingDiscardedToShort + clippingDiscardedToLong}</td>
<td>${trimmingDiscarded}</td>
#if (paired == true) <td>${beforeTotal - clippingDiscardedToShort - clippingDiscardedToLong - trimmingDiscarded - afterTotal}</td> #end
<td>${afterTotal}</td>
#end
val beforeTotal = seqstatStats("num_total").getOrElse(0).toString.toLong
val afterTotal = seqstatQcStats("num_total").getOrElse(0).toString.toLong
val clippingDiscardedToShort = clippingStats("num_reads_discarded_too_short").getOrElse(0).toString.toLong
val clippingDiscardedToLong = clippingStats("num_reads_discarded_too_long").getOrElse(0).toString.toLong
val trimmingDiscarded = trimmingStats("num_reads_discarded").getOrElse(0).toString.toLong
}#
<td>${read}</td>
<td>${beforeTotal}</td>
<td>${clippingDiscardedToShort + clippingDiscardedToLong}</td>
<td>${trimmingDiscarded}</td>
#if (paired == true) <td>${beforeTotal - clippingDiscardedToShort - clippingDiscardedToLong - trimmingDiscarded - afterTotal}</td> #end
<td>${afterTotal}</td>
#end
</tr>
#end
#end
......
......@@ -14,10 +14,10 @@
*/
package nl.lumc.sasc.biopet.pipelines.flexiprep
import java.io.{File, PrintWriter}
import java.io.{ File, PrintWriter }
import nl.lumc.sasc.biopet.utils.config.Configurable
import nl.lumc.sasc.biopet.core.report.{ReportBuilder, ReportBuilderExtension, ReportPage, ReportSection}
import nl.lumc.sasc.biopet.core.report.{ ReportBuilder, ReportBuilderExtension, ReportPage, ReportSection }
import nl.lumc.sasc.biopet.utils.rscript.StackedBarPlot
import nl.lumc.sasc.biopet.utils.summary.db.SummaryDb
......
Markdown is supported
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