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
5fda5828
Commit
5fda5828
authored
Apr 09, 2015
by
Peter van 't Hof
Browse files
Added default sample and library lists
parent
6f77b5f3
Changes
7
Hide whitespace changes
Inline
Side-by-side
public/biopet-framework/src/main/resources/nl/lumc/sasc/biopet/core/report/librariesList.ssp
0 → 100644
View file @
5fda5828
#import(nl.lumc.sasc.biopet.core.summary.Summary)
#import(nl.lumc.sasc.biopet.core.report.ReportPage)
<%@ var summary: Summary %>
<%@ var rootPath: String %>
<%@ var sampleId: Option[String] = None %>
<table>
<thead><tr></tr><th>Libraries</th></thead></tr>
<tbody>
#for (lib <- summary.libraries(sampleId.get))
<tr><td><a href="${rootPath}Samples/${sampleId.get}/Libraries/${lib}/index.html">${lib}</a></td></tr>
#end
</tbody>
</table>
\ No newline at end of file
public/biopet-framework/src/main/resources/nl/lumc/sasc/biopet/core/report/main.ssp
View file @
5fda5828
...
...
@@ -6,9 +6,9 @@
<
%@
var
page:
ReportPage
%
>
<
%@
var
path:
List
[
String
]
%
>
<
%@
var
args:
Map
[
String
,
Any
]
%
>
#{
val rootPath = "./" + Array.fill(path.size)("../").mkString("")
<
%@
var
rootPath:
String
%
>
#{
def createMenu(page: ReportPage, path: List[String] = Nil): String = {
val buffer: StringBuffer = new StringBuffer()
buffer.append("
<ul>
")
...
...
@@ -35,6 +35,7 @@
<!DOCTYPE html>
<html>
<head>
<title>
${reportName}
</title>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"${rootPath}css/biopet.css"
>
</head>
<body>
...
...
public/biopet-framework/src/main/resources/nl/lumc/sasc/biopet/core/report/samplesList.ssp
0 → 100644
View file @
5fda5828
#import(nl.lumc.sasc.biopet.core.summary.Summary)
#import(nl.lumc.sasc.biopet.core.report.ReportPage)
<%@ var summary: Summary %>
<%@ var rootPath: String %>
<table>
<thead><tr></tr><th>Sample</th></thead></tr>
<tbody>
#for (sample <- summary.samples)
<tr><td><a href="${rootPath}Samples/${sample}/index.html">${sample}</a></td></tr>
#end
</tbody>
</table>
\ No newline at end of file
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/report/MultisampleReportBuilder.scala
View file @
5fda5828
package
nl.lumc.sasc.biopet.core.report
import
nl.lumc.sasc.biopet.core.summary.Summary
/**
* Created by pjvan_thof on 3/30/15.
*/
trait
MultisampleReportBuilder
extends
ReportBuilder
{
def
generalPage
:
ReportPage
def
samplePage
(
sampleId
:
String
,
args
:
Map
[
String
,
Any
])
:
ReportPage
def
samplesSections
:
List
[(
String
,
ReportSection
)]
=
{
List
(
(
"Samples"
,
ReportSection
(
"/nl/lumc/sasc/biopet/core/report/samplesList.ssp"
))
)
}
def
libraryPage
(
libraryId
:
String
,
args
:
Map
[
String
,
Any
])
:
ReportPage
def
libririesSections
:
List
[(
String
,
ReportSection
)]
=
{
List
(
(
"Libraries"
,
ReportSection
(
"/nl/lumc/sasc/biopet/core/report/librariesList.ssp"
))
)
}
def
generateSamplesPage
(
args
:
Map
[
String
,
Any
])
:
ReportPage
=
{
val
samplePages
=
summary
.
samples
.
map
(
sampleId
=>
(
sampleId
->
samplePage
(
sampleId
,
args
++
Map
(
"sampleId"
->
Some
(
sampleId
)))))
.
toMap
ReportPage
(
samplePages
,
List
()
,
args
)
ReportPage
(
samplePages
,
samplesSections
,
args
)
}
def
generateLibraryPage
(
args
:
Map
[
String
,
Any
])
:
ReportPage
=
{
...
...
@@ -26,8 +34,6 @@ trait MultisampleReportBuilder extends ReportBuilder {
})
.
map
(
libId
=>
(
libId
->
libraryPage
(
libId
,
args
++
Map
(
"libId"
->
Some
(
libId
)))))
.
toMap
ReportPage
(
libPages
,
List
()
,
args
)
ReportPage
(
libPages
,
libririesSections
,
args
)
}
def
indexPage
=
ReportPage
(
Map
(
"General"
->
generalPage
,
"Samples"
->
generateSamplesPage
(
pageArgs
)),
List
(),
pageArgs
)
}
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/report/ReportBuilder.scala
View file @
5fda5828
...
...
@@ -73,7 +73,13 @@ trait ReportBuilder extends ToolCommand {
val
pageOutputDir
=
new
File
(
outputDir
,
path
.
mkString
(
File
.
separator
))
pageOutputDir
.
mkdirs
()
val
pageArgs
=
args
++
page
.
args
++
Map
(
"page"
->
page
,
"path"
->
path
,
"outputDir"
->
pageOutputDir
)
val
rootPath
=
"./"
+
Array
.
fill
(
path
.
size
)(
"../"
).
mkString
(
""
)
val
pageArgs
=
args
++
page
.
args
++
Map
(
"page"
->
page
,
"path"
->
path
,
"outputDir"
->
pageOutputDir
,
"rootPath"
->
rootPath
)
val
output
=
ReportBuilder
.
renderTemplate
(
"/nl/lumc/sasc/biopet/core/report/main.ssp"
,
pageArgs
++
Map
(
"args"
->
pageArgs
))
...
...
@@ -94,7 +100,7 @@ object ReportBuilder {
protected
val
engine
=
new
TemplateEngine
()
def
renderTemplate
(
location
:
String
,
args
:
Map
[
String
,
Any
])
:
String
=
{
def
renderTemplate
(
location
:
String
,
args
:
Map
[
String
,
Any
])
:
String
=
{
val
templateText
=
Source
.
fromInputStream
(
getClass
.
getResourceAsStream
(
location
)).
getLines
().
mkString
(
"\n"
)
val
template
=
engine
.
compileText
(
"ssp"
,
templateText
)
...
...
public/flexiprep/src/main/scala/nl/lumc/sasc/biopet/pipelines/flexiprep/FlexiprepReport.scala
View file @
5fda5828
package
nl.lumc.sasc.biopet.pipelines.flexiprep
import
nl.lumc.sasc.biopet.core.report.
{
ReportSection
,
ReportPage
,
ReportBuilder
}
import
nl.lumc.sasc.biopet.core.report.
{
ReportSection
,
ReportPage
,
ReportBuilder
}
/**
* Created by pjvan_thof on 3/30/15.
...
...
@@ -23,7 +23,7 @@ object FlexiprepReport extends ReportBuilder {
),
Map
())
}
protected
def
fastqcPlotSection
(
name
:
String
,
tag
:
String
)
=
{
protected
def
fastqcPlotSection
(
name
:
String
,
tag
:
String
)
=
{
name
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepFastaqcPlot.ssp"
,
Map
(
"plot"
->
tag
))
}
...
...
public/shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaReport.scala
View file @
5fda5828
package
nl.lumc.sasc.biopet.pipelines.shiva
import
nl.lumc.sasc.biopet.core.report.
{
ReportSection
,
MultisampleReportBuilder
,
ReportPage
}
import
nl.lumc.sasc.biopet.core.report.
{
ReportSection
,
MultisampleReportBuilder
,
ReportPage
}
import
nl.lumc.sasc.biopet.pipelines.flexiprep.FlexiprepReport
/**
* Created by pjvan_thof on 3/30/15.
*/
object
ShivaReport
extends
MultisampleReportBuilder
{
def
indexPage
=
ReportPage
(
Map
(
"General"
->
ReportPage
(
Map
(),
List
(
"Variantcalling"
->
ReportSection
(
"/nl/lumc/sasc/biopet/core/report/ShivaVariantcalling.ssp"
),
"QC reads"
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepReadSummary.ssp"
),
"QC bases"
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepBaseSummary.ssp"
)
),
Map
()),
"Samples"
->
generateSamplesPage
(
pageArgs
)
),
Nil
,
pageArgs
)
def
samplePage
(
sampleId
:
String
,
args
:
Map
[
String
,
Any
])
=
{
ReportPage
(
Map
(
"Libraries"
->
generateLibraryPage
(
args
)),
List
(
"Variantcalling"
->
ReportSection
(
"/nl/lumc/sasc/biopet/core/report/ShivaVariantcalling.ssp"
),
...
...
@@ -16,7 +29,7 @@ object ShivaReport extends MultisampleReportBuilder {
}
def
libraryPage
(
libId
:
String
,
args
:
Map
[
String
,
Any
])
=
{
ReportPage
(
Map
(
"
Flexiprep
"
->
FlexiprepReport
.
indexPage
),
List
(
ReportPage
(
Map
(
"
QC
"
->
FlexiprepReport
.
indexPage
),
List
(
"QC reads"
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepReadSummary.ssp"
),
"QC bases"
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepBaseSummary.ssp"
)
),
args
)
...
...
@@ -24,11 +37,5 @@ object ShivaReport extends MultisampleReportBuilder {
def
reportName
=
"Title Test"
def
generalPage
=
ReportPage
(
Map
(),
List
(
"Variantcalling"
->
ReportSection
(
"/nl/lumc/sasc/biopet/core/report/ShivaVariantcalling.ssp"
),
"QC reads"
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepReadSummary.ssp"
),
"QC bases"
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepBaseSummary.ssp"
)
),
Map
())
// FIXME: Not yet finished
}
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