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
7d824f77
Commit
7d824f77
authored
Jun 23, 2015
by
Peter van 't Hof
Browse files
Switch map the list for subpages
parent
fc6efaf7
Changes
6
Hide whitespace changes
Inline
Side-by-side
public/bammetrics/src/main/scala/nl/lumc/sasc/biopet/pipelines/bammetrics/BammetricsReport.scala
View file @
7d824f77
...
...
@@ -14,7 +14,7 @@ object BammetricsReport extends ReportBuilder {
val
reportName
=
"Bam Metrics"
def
indexPage
=
ReportPage
(
Map
(),
List
(),
Map
())
def
indexPage
=
ReportPage
(
List
(),
List
(),
Map
())
def
bamMetricsPage
(
summary
:
Summary
,
sampleId
:
Option
[
String
],
libId
:
Option
[
String
])
=
{
val
targets
=
(
...
...
@@ -27,8 +27,8 @@ object BammetricsReport extends ReportBuilder {
}
ReportPage
(
(
if
(
targets
.
isEmpty
)
Map
()
else
Map
(
"Targets"
->
ReportPage
(
Map
(),
(
if
(
targets
.
isEmpty
)
List
()
else
List
(
"Targets"
->
ReportPage
(
List
(),
targets
.
map
(
t
=>
(
t
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/bammetrics/covstatsPlot.ssp"
,
Map
(
"target"
->
t
)))),
Map
()))),
List
(
...
...
public/biopet-framework/src/main/resources/nl/lumc/sasc/biopet/core/report/main.ssp
View file @
7d824f77
...
...
@@ -36,7 +36,11 @@
}
def getSubPage(path:List[String]): ReportPage = {
path.foldLeft(indexPage)(_.subPages(_))
path.foldLeft(indexPage)((c, p) => {
val foundPages = c.subPages.filter(_._1 == p)
require(foundPages.size == 1, "Name of page not found or duplicate is found, page:: " + p + " in path: " + path)
foundPages.head._2
})
}
}#
<!DOCTYPE html>
...
...
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/report/MultisampleReportBuilder.scala
View file @
7d824f77
...
...
@@ -23,7 +23,7 @@ trait MultisampleReportBuilder extends ReportBuilder {
def
generateSamplesPage
(
args
:
Map
[
String
,
Any
])
:
ReportPage
=
{
val
samplePages
=
summary
.
samples
.
map
(
sampleId
=>
(
sampleId
->
samplePage
(
sampleId
,
args
++
Map
(
"sampleId"
->
Some
(
sampleId
)))))
.
to
Map
.
to
List
ReportPage
(
samplePages
,
samplesSections
,
args
)
}
...
...
@@ -35,7 +35,7 @@ trait MultisampleReportBuilder extends ReportBuilder {
val
libPages
=
summary
.
libraries
(
sampleId
)
.
map
(
libId
=>
(
libId
->
libraryPage
(
sampleId
,
libId
,
args
++
Map
(
"libId"
->
Some
(
libId
)))))
.
to
Map
.
to
List
ReportPage
(
libPages
,
libririesSections
,
args
)
}
}
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/report/ReportPage.scala
View file @
7d824f77
...
...
@@ -3,6 +3,6 @@ package nl.lumc.sasc.biopet.core.report
/**
* Created by pjvan_thof on 3/27/15.
*/
case
class
ReportPage
(
subPages
:
Map
[
String
,
ReportPage
],
case
class
ReportPage
(
subPages
:
List
[(
String
,
ReportPage
)
],
sections
:
List
[(
String
,
ReportSection
)],
args
:
Map
[
String
,
Any
])
public/flexiprep/src/main/scala/nl/lumc/sasc/biopet/pipelines/flexiprep/FlexiprepReport.scala
View file @
7d824f77
...
...
@@ -12,7 +12,7 @@ import nl.lumc.sasc.biopet.extensions.rscript.StackedBarPlot
object
FlexiprepReport
extends
ReportBuilder
{
val
reportName
=
"Flexiprep"
def
indexPage
=
ReportPage
(
Map
(
def
indexPage
=
ReportPage
(
List
(
"QC"
->
flexiprepPage
),
List
(
"Report"
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepFront.ssp"
)
...
...
@@ -21,7 +21,7 @@ object FlexiprepReport extends ReportBuilder {
)
def
flexiprepPage
=
ReportPage
(
Map
(),
List
(),
List
(
"Read Summary"
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepReadSummary.ssp"
),
"Base Summary"
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepBaseSummary.ssp"
),
...
...
public/shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaReport.scala
View file @
7d824f77
...
...
@@ -25,10 +25,10 @@ object ShivaReport extends MultisampleReportBuilder {
def
indexPage
=
{
val
regions
=
regionsPage
ReportPage
(
Map
(
"Samples"
->
generateSamplesPage
(
pageArgs
))
++
List
(
"Samples"
->
generateSamplesPage
(
pageArgs
))
++
(
if
(
regions
.
isDefined
)
Map
(
regions
.
get
)
else
Map
())
++
Map
(
"Files"
->
filesPage
,
"Versions"
->
ReportPage
(
Map
(),
List
((
"Versions"
->
ReportPage
(
List
(),
List
((
"Executables"
->
ReportSection
(
"/nl/lumc/sasc/biopet/core/report/executables.ssp"
))),
Map
())
),
...
...
@@ -58,7 +58,7 @@ object ShivaReport extends MultisampleReportBuilder {
def
createPage
(
name
:
String
,
amplicon
:
Boolean
=
false
)
:
ReportPage
=
{
ReportPage
(
Map
(),
List
(),
List
(
"Coverage"
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/bammetrics/covstatsMultiTable.ssp"
)),
Map
(
"target"
->
name
)
)
...
...
@@ -76,16 +76,17 @@ object ShivaReport extends MultisampleReportBuilder {
}
if
(
regionPages
.
nonEmpty
)
Some
(
"Regions"
->
ReportPage
(
Map
(),
List
(),
regionPages
.
map
(
p
=>
(
p
.
_1
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/bammetrics/covstatsMultiTable.ssp"
,
Map
(
"target"
->
p
.
_1
.
stripSuffix
(
" (Amplicon)"
))
))).
toList
.
sortBy
(
_
.
_1
),
Map
())
)
else
None
)
else
None
}
def
filesPage
=
ReportPage
(
Map
(),
List
(
def
filesPage
=
ReportPage
(
List
(),
List
(
"Input fastq files"
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepInputfiles.ssp"
),
"After QC fastq files"
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepOutputfiles.ssp"
),
"Bam files per lib"
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/mapping/outputBamfiles.ssp"
,
Map
(
"sampleLevel"
->
false
)),
...
...
@@ -95,7 +96,7 @@ object ShivaReport extends MultisampleReportBuilder {
),
Map
())
def
samplePage
(
sampleId
:
String
,
args
:
Map
[
String
,
Any
])
=
{
ReportPage
(
Map
(
ReportPage
(
List
(
"Libraries"
->
generateLibraryPage
(
args
),
"Alignment"
->
BammetricsReport
.
bamMetricsPage
(
summary
,
Some
(
sampleId
),
None
),
"Files"
->
filesPage
...
...
@@ -110,7 +111,7 @@ object ShivaReport extends MultisampleReportBuilder {
}
def
libraryPage
(
sampleId
:
String
,
libId
:
String
,
args
:
Map
[
String
,
Any
])
=
{
ReportPage
(
Map
(
ReportPage
(
List
(
"Alignment"
->
BammetricsReport
.
bamMetricsPage
(
summary
,
Some
(
sampleId
),
Some
(
libId
)),
"QC"
->
FlexiprepReport
.
flexiprepPage
),
List
(
...
...
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