Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mirrors
biopet.biopet
Commits
ddada7c6
Commit
ddada7c6
authored
Mar 30, 2017
by
akaljuvee
Browse files
sv-s are grouped by type also for the tables
parent
835790c0
Changes
2
Hide whitespace changes
Inline
Side-by-side
shiva/src/main/resources/nl/lumc/sasc/biopet/pipelines/shiva/sampleVariantsSv.ssp
View file @
ddada7c6
...
...
@@ -8,22 +8,28 @@
<%@ var showIntro: Boolean = true %>
#{
val svTypes = List(
SvTypeForReport("DEL", "Deletion", "svSummaryDeletions.tsv", "svSummaryDeletions.png"),
SvTypeForReport("DUP", "Duplication", "svSummaryDuplications.tsv", "svSummaryDuplications.png"),
SvTypeForReport("INS", "Insertion", "svSummaryInsertions.tsv", "svSummaryInsertions.png"),
SvTypeForReport("INV", "Inversion", "svSummaryInversions.tsv", "svSummaryInversions.png"))
val sampleNames: List[String] = summary.samples.toList.sorted
val counts: Map[String, Map[String, Array[Any]]] = ShivaSvCallingReport.parseSummaryForSvCounts(summary)
ShivaSvCallingReport.writeTsvForPlots(counts, svTypes, outputDir)
var svTypes = List(
SvTypeForReport("DEL", "Deletions", "svSummaryDeletions.tsv", "svSummaryDeletions.png"),
SvTypeForReport("DUP", "Duplications", "svSummaryDuplications.tsv", "svSummaryDuplications.png"),
SvTypeForReport("INS", "Insertions", "svSummaryInsertions.tsv", "svSummaryInsertions.png"),
SvTypeForReport("INV", "Inversions", "svSummaryInversions.tsv", "svSummaryInversions.png"))
svTypes = svTypes.filter(sv => counts.contains(sv.svType))
val tsvAllTypes = "svSummary.tsv"
ShivaSvCallingReport.writeTsvFiles(sampleNames, counts, svTypes, tsvAllTypes, outputDir)
ShivaSvCallingReport.createPlots(svTypes, outputDir)
}#
#if (showPlot)
<div class="panel-body">
<img src="svSummaryDeletions.png" class="img-responsive" />
#for (sv <- svTypes)
<img src="${sv.pngFileName}" />
#end
</div>
<div class="panel-footer">
#if (showTable)
...
...
@@ -31,49 +37,34 @@
#else
<button type="button" class="btn btn-info" data-toggle="collapse" data-target="#svSummaryTable">Show table</button>
#end
<i class="glyphicon glyphicon-file"></i> <a href="
svSummary.tsv
">tsv file</a>
<i class="glyphicon glyphicon-file"></i> <a href="
${tsvAllTypes}
">tsv file</a>
</div>
#end
<div class="panel-body collapse #if (showTable)in#end" id="svSummaryTable">
#for (sv <- svTypes)
#{
val countsForSvType: Map[String, Array[Any]] = counts.get(sv.svType).get
}#
<h3>${sv.displayText}</h3>
<table class="table sortable-theme-bootstrap" data-sortable>
<thead><tr><th data-sorted="true" data-sorted-direction="ascending">Sample</th>
<th>Variant Type</th> <!-- TODO: use values from summary.getValue("shivasvcalling", "stats", "histBreaksForCounts") -->
<th>≤100bp</th>
<th>0.1-1kb</th>
<th>1-10kb</th>
<th>10-100kb</th>
<th>0.1-1Mb</th>
<th>1-10Mb</th>
<th>>10Mb</th>
#for (text <- ShivaSvCallingReport.histogramText)
<th>${text}</th>
#end
</tr></thead>
<tbody>
#for (sampleName <- summary.samples.toList.sorted)
#{
val sampleCounts:Map[String, Array[Any]] = counts.get(sampleName).get
var firstRow = true
}#
#for (sv <- svTypes)
<tr>
#if (counts.contains(sv.svType))
#if (firstRow)
<td><a href="${rootPath}Samples/${sampleName}/index.html">${sampleName}</a></td>
#{ firstRow = false }#
#else
<td></td>
#end
<td>${sv.displayText}</td>
#for (countForSize <- counts.get(sv.svType).get.asInstanceOf[List[Long]])
<td>${countForSize}</td>
#end
#end
</tr>
#for (sampleName <- sampleNames)
<tr>
<td><a href="${rootPath}Samples/${sampleName}/index.html">${sampleName}</a></td>
#for (countForSize <- countsForSvType.get(sampleName).get)
<td>${countForSize}</td>
#end
</tr>
#end
</tbody>
</table>
#end
</div>
shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaSvCalling.scala
View file @
ddada7c6
...
...
@@ -14,11 +14,9 @@
*/
package
nl.lumc.sasc.biopet.pipelines.shiva
import
java.io.File
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.
{
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
...
...
@@ -100,7 +98,7 @@ class ShivaSvCalling(val root: Configurable) extends QScript with SummaryQScript
// sample tagging is however not available within this pipeline
for
((
sample
,
mergedResultFile
)
<-
outputMergedVCFbySample
)
{
lazy
val
counts
=
getVariantCounts
(
mergedResultFile
,
ShivaSvCalling
.
histogramBinBoundaries
)
lazy
val
counts
=
getVariantCounts
(
mergedResultFile
,
ShivaSvCalling
Report
.
histogramBinBoundaries
)
addSummarizable
(
new
Summarizable
{
def
summaryFiles
=
Map
.
empty
def
summaryStats
=
counts
...
...
@@ -108,7 +106,7 @@ class ShivaSvCalling(val root: Configurable) extends QScript with SummaryQScript
}
addSummarizable
(
new
Summarizable
{
def
summaryFiles
=
Map
.
empty
def
summaryStats
=
ShivaSvCalling
.
histogramBinBoundaries
def
summaryStats
=
ShivaSvCalling
Report
.
histogramBinBoundaries
},
"histBreaksForCounts"
)
addSummaryJobs
()
...
...
@@ -164,13 +162,4 @@ class ShivaSvCalling(val root: Configurable) extends QScript with SummaryQScript
true
}
}
object
ShivaSvCalling
extends
PipelineCommand
{
val
histogramBinBoundaries
:
Array
[
Int
]
=
Array
(
100
,
1000
,
10000
,
100000
,
1000000
,
10000000
)
}
object
StructuralVariantType
extends
Enumeration
{
val
Deletion
=
Value
(
"DEL"
)
val
Inversion
=
Value
(
"INV"
)
}
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment