Commit e6462da9 authored by akaljuvee's avatar akaljuvee

showing translocation counts aswell

parent 6f595a73
......@@ -11,6 +11,7 @@
val sampleNames: List[String] = summary.samples.toList.sorted
val counts: Map[String, Map[String, Array[Long]]] = ShivaSvCallingReport.parseSummaryForSvCounts(summary)
val traCounts: Map[String, Long] = ShivaSvCallingReport.parseSummaryForTranslocations(summary)
var svTypes = List(
SvTypeForReport("DEL", "Deletions", "svSummaryDeletions.tsv", "svSummaryDeletions.png"),
......@@ -31,12 +32,29 @@
<img src="${sv.pngFileName}" />
#end
</div>
#if (traCounts.nonEmpty)
<div class="panel-body">
<h5>Number of translocation events detected:</h5>
<table class="table table-condensed" style="width:auto">
<thead><tr>
#for (sampleName <- sampleNames)
<th>${sampleName}</th>
#end
</tr></thead>
<tbody><tr>
#for (sampleName <- sampleNames)
<td>${traCounts.get(sampleName).get}</td>
#end
</tr></tbody>
</table>
</div>
#end
<div class="panel-footer">
<button type="button" class="btn btn-info" data-toggle="collapse" data-target="#svSummaryTable">
#if (showTable)
<i class="glyphicon glyphicon-eye-close"></i> Hide table
<i class="glyphicon glyphicon-eye-close"></i> Hide tables
#else
<i class="glyphicon glyphicon-eye-open"></i> Show table
<i class="glyphicon glyphicon-eye-open"></i> Show tables
#end
</button>
<a href="${tsvAllTypes}"><button type="button" class="btn btn-info"><i class="glyphicon glyphicon-cloud-download"></i> TSV file</button></a>
......
......@@ -15,12 +15,12 @@
package nl.lumc.sasc.biopet.pipelines.shiva
import htsjdk.variant.vcf.VCFFileReader
import nl.lumc.sasc.biopet.core.summary.{Summarizable, SummaryQScript}
import nl.lumc.sasc.biopet.core.{PipelineCommand, Reference, SampleLibraryTag}
import nl.lumc.sasc.biopet.core.summary.{ Summarizable, SummaryQScript }
import nl.lumc.sasc.biopet.core.{ PipelineCommand, Reference, SampleLibraryTag }
import nl.lumc.sasc.biopet.extensions.Pysvtools
import nl.lumc.sasc.biopet.pipelines.shiva.svcallers._
import nl.lumc.sasc.biopet.utils.config.Configurable
import nl.lumc.sasc.biopet.utils.{BamUtils, Logging}
import nl.lumc.sasc.biopet.utils.{ BamUtils, Logging }
import org.broadinstitute.gatk.queue.QScript
/**
......
......@@ -35,6 +35,15 @@ object ShivaSvCallingReport {
result
}
def parseSummaryForTranslocations(summary: Summary): Map[String, Long] = {
var traCounts: Map[String, Long] = Map()
for (sampleName <- summary.samples) {
var counts: Map[String, Any] = summary.getSampleValue(sampleName, "shivasvcalling", "stats", "variantsBySizeAndType").get.asInstanceOf[Map[String, Any]]
traCounts += (sampleName -> counts.get("TRA").get.asInstanceOf[Long])
}
if (traCounts.exists(elem => elem._2 > 0)) traCounts else Map.empty
}
def writeTsvFiles(sampleNames: List[String], counts: Map[String, Map[String, Array[Long]]], svTypes: List[SvTypeForReport], outFileAllTypes: String, outDir: File): Unit = {
val tsvWriter = new PrintWriter(new File(outDir, outFileAllTypes))
......
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