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
f2472f2d
Commit
f2472f2d
authored
Jun 17, 2015
by
Peter van 't Hof
Browse files
Added single sample coverage plot
parent
a03a1b88
Changes
4
Hide whitespace changes
Inline
Side-by-side
public/bammetrics/src/main/resources/nl/lumc/sasc/biopet/pipelines/bammetrics/covstatsPlot.ssp
0 → 100644
View file @
f2472f2d
#import(nl.lumc.sasc.biopet.utils.IoUtils)
#import(nl.lumc.sasc.biopet.core.summary.Summary)
#import(nl.lumc.sasc.biopet.core.report.ReportPage)
#import(org.apache.commons.io.FileUtils)
#import(java.io.File)
<%@ var summary: Summary %>
<%@ var sampleId: Option[String] %>
<%@ var libId: Option[String] = None %>
<%@ var outputDir: File %>
<%@ var target: String %>
#{
val originalPlot = new File(summary.getLibraryValue(sampleId, libId, "bammetrics", "files", target + "_cov_stats", "plot", "path")
.getOrElse(throw new IllegalArgumentException("No plot found in summary")).toString)
val plot = new File(outputDir, target + "_cov_stats.png")
IoUtils.copyFile(originalPlot, plot)
}#
<img src="${plot}">
public/bammetrics/src/main/scala/nl/lumc/sasc/biopet/pipelines/bammetrics/BammetricsReport.scala
View file @
f2472f2d
...
...
@@ -14,26 +14,32 @@ object BammetricsReport extends ReportBuilder {
val
reportName
=
"Bam Metrics"
def
indexPage
=
ReportPage
(
Map
(
"Bam Metrics"
->
bamMetricsPage
),
List
(
"Report"
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/bammetrics/bamMetricsFront.ssp"
)
),
Map
()
)
def
bamMetricsPage
=
ReportPage
(
Map
(),
List
(
"Summary"
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/bammetrics/alignmentSummary.ssp"
),
"Bam Stats"
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/bammetrics/bamStats.ssp"
),
"Insert Size"
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/bammetrics/insertSize.ssp"
,
Map
(
"showPlot"
->
true
)),
"RNA (optional)"
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/bammetrics/rna.ssp"
),
"Target (optional)"
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/bammetrics/target.ssp"
),
"GC Bias"
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/bammetrics/gcBias.ssp"
)
),
Map
()
)
def
indexPage
=
ReportPage
(
Map
(),
List
(),
Map
())
def
bamMetricsPage
(
summary
:
Summary
,
sampleId
:
Option
[
String
],
libId
:
Option
[
String
])
=
{
val
targets
=
(
summary
.
getLibraryValue
(
sampleId
,
libId
,
"bammetrics"
,
"settings"
,
"amplicon_name"
),
summary
.
getLibraryValue
(
sampleId
,
libId
,
"bammetrics"
,
"settings"
,
"roi_name"
)
)
match
{
case
(
Some
(
amplicon
:
String
),
Some
(
roi
:
List
[
_
]))
=>
amplicon
::
roi
.
map
(
_
.
toString
)
case
(
_
,
Some
(
roi
:
List
[
_
]))
=>
roi
.
map
(
_
.
toString
)
case
_
=>
Nil
}
ReportPage
(
(
if
(
targets
.
isEmpty
)
Map
()
else
Map
(
"Targets"
->
ReportPage
(
Map
(),
targets
.
map
(
t
=>
(
t
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/bammetrics/covstatsPlot.ssp"
,
Map
(
"target"
->
t
)))),
Map
()))),
List
(
"Summary"
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/bammetrics/alignmentSummary.ssp"
),
"Bam Stats"
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/bammetrics/bamStats.ssp"
),
"Insert Size"
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/bammetrics/insertSize.ssp"
,
Map
(
"showPlot"
->
true
))
),
Map
()
)
}
def
alignmentSummaryPlot
(
outputDir
:
File
,
prefix
:
String
,
...
...
@@ -168,6 +174,5 @@ object BammetricsReport extends ReportBuilder {
plot
.
removeZero
=
true
plot
.
title
=
Some
(
"Insert size"
)
plot
.
runLocal
()
}
}
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/report/MultisampleReportBuilder.scala
View file @
f2472f2d
...
...
@@ -12,7 +12,7 @@ trait MultisampleReportBuilder extends ReportBuilder {
)
}
def
libraryPage
(
libraryId
:
String
,
args
:
Map
[
String
,
Any
])
:
ReportPage
def
libraryPage
(
sampleId
:
String
,
libraryId
:
String
,
args
:
Map
[
String
,
Any
])
:
ReportPage
def
libririesSections
:
List
[(
String
,
ReportSection
)]
=
{
List
(
...
...
@@ -28,11 +28,13 @@ trait MultisampleReportBuilder extends ReportBuilder {
}
def
generateLibraryPage
(
args
:
Map
[
String
,
Any
])
:
ReportPage
=
{
val
libPages
=
summary
.
libraries
(
args
(
"sampleId"
)
match
{
val
sampleId
=
args
(
"sampleId"
)
match
{
case
Some
(
x
)
=>
x
.
toString
case
None
=>
throw
new
IllegalStateException
(
"Sample not found"
)
})
.
map
(
libId
=>
(
libId
->
libraryPage
(
libId
,
args
++
Map
(
"libId"
->
Some
(
libId
)))))
}
val
libPages
=
summary
.
libraries
(
sampleId
)
.
map
(
libId
=>
(
libId
->
libraryPage
(
sampleId
,
libId
,
args
++
Map
(
"libId"
->
Some
(
libId
)))))
.
toMap
ReportPage
(
libPages
,
libririesSections
,
args
)
}
...
...
public/shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaReport.scala
View file @
f2472f2d
...
...
@@ -86,7 +86,7 @@ object ShivaReport extends MultisampleReportBuilder {
def
samplePage
(
sampleId
:
String
,
args
:
Map
[
String
,
Any
])
=
{
ReportPage
(
Map
(
"Libraries"
->
generateLibraryPage
(
args
),
"Alignment"
->
BammetricsReport
.
bamMetricsPage
,
"Alignment"
->
BammetricsReport
.
bamMetricsPage
(
summary
,
Some
(
sampleId
),
None
)
,
"Files"
->
filesPage
),
List
(
"Alignment"
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/bammetrics/alignmentSummary.ssp"
,
...
...
@@ -98,9 +98,9 @@ object ShivaReport extends MultisampleReportBuilder {
),
args
)
}
def
libraryPage
(
libId
:
String
,
args
:
Map
[
String
,
Any
])
=
{
def
libraryPage
(
sampleId
:
String
,
libId
:
String
,
args
:
Map
[
String
,
Any
])
=
{
ReportPage
(
Map
(
"Alignment"
->
BammetricsReport
.
bamMetricsPage
,
"Alignment"
->
BammetricsReport
.
bamMetricsPage
(
summary
,
Some
(
sampleId
),
Some
(
libId
))
,
"QC"
->
FlexiprepReport
.
flexiprepPage
),
List
(
"Alignment"
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/bammetrics/alignmentSummary.ssp"
),
...
...
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