Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Mirrors
biopet.biopet
Commits
b0ec2c16
Commit
b0ec2c16
authored
Mar 14, 2017
by
Peter van 't Hof
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added files to report
parent
f7dce595
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
76 additions
and
10 deletions
+76
-10
biopet-core/src/main/resources/nl/lumc/sasc/biopet/core/report/fileModules.ssp
...resources/nl/lumc/sasc/biopet/core/report/fileModules.ssp
+22
-0
biopet-core/src/main/resources/nl/lumc/sasc/biopet/core/report/files.ssp
.../main/resources/nl/lumc/sasc/biopet/core/report/files.ssp
+23
-0
biopet-utils/src/main/scala/nl/lumc/sasc/biopet/utils/summary/db/SummaryDb.scala
...cala/nl/lumc/sasc/biopet/utils/summary/db/SummaryDb.scala
+10
-0
biopet-utils/src/test/scala/nl/lumc/sasc/biopet/utils/summary/db/SummaryDbTest.scala
.../nl/lumc/sasc/biopet/utils/summary/db/SummaryDbTest.scala
+4
-0
mapping/src/main/scala/nl/lumc/sasc/biopet/pipelines/mapping/MultisampleMappingReport.scala
...c/biopet/pipelines/mapping/MultisampleMappingReport.scala
+17
-10
No files found.
biopet-core/src/main/resources/nl/lumc/sasc/biopet/core/report/fileModules.ssp
0 → 100644
View file @
b0ec2c16
#import(nl.lumc.sasc.biopet.utils.summary.db.Schema.File)
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb)
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb._)
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb.Implicts._)
#import(nl.lumc.sasc.biopet.core.report.ReportPage)
#import(scala.concurrent.Await)
#import(scala.concurrent.duration.Duration)
<%@ var summary: SummaryDb %>
<%@ var sampleId: Option[Int] = None %>
<%@ var libId: Option[Int] = None %>
<%@ var runId: Int %>
<%@ var pipelineNames: List[Option[String]] %>
<table class="table">
<thead><tr>
<th>Pipeline</th>
</tr></thead>
<tbody>
#for (pipelineName <- pipelineNames)
<tr><td><a href="./${pipelineName}/index.html" >${pipelineName}</a></td></tr>
#end
</tbody>
</table>
biopet-core/src/main/resources/nl/lumc/sasc/biopet/core/report/files.ssp
View file @
b0ec2c16
#import(nl.lumc.sasc.biopet.utils.summary.db.Schema.File)
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb)
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb._)
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb.Implicts._)
#import(nl.lumc.sasc.biopet.core.report.ReportPage)
#import(scala.concurrent.Await)
#import(scala.concurrent.duration.Duration)
<%@ var summary: SummaryDb %>
<%@ var sampleId: Option[Int] = None %>
<%@ var libId: Option[Int] = None %>
<%@ var runId: Int %>
<%@ var files: Seq[File]%>
<table class="table">
<thead><tr>
<th data-sorted="true" data-sorted-direction="ascending">Key</th>
<th>path</th><th>md5</th>
</tr></thead>
<tbody>
#for (file <- files)
<tr><td>${file.key}</td><td>${file.path}</td><td>${file.md5}</td></tr>
#end
</tbody>
</table>
biopet-utils/src/main/scala/nl/lumc/sasc/biopet/utils/summary/db/SummaryDb.scala
View file @
b0ec2c16
...
@@ -177,6 +177,11 @@ class SummaryDb(val db: Database) extends Closeable {
...
@@ -177,6 +177,11 @@ class SummaryDb(val db: Database) extends Closeable {
getPipelines
(
runId
=
Some
(
runId
),
name
=
Some
(
pipelineName
)).
map
(
_
.
headOption
.
map
(
_
.
id
))
getPipelines
(
runId
=
Some
(
runId
),
name
=
Some
(
pipelineName
)).
map
(
_
.
headOption
.
map
(
_
.
id
))
}
}
/** Return name of a pipeline */
def
getPipelineName
(
pipelineId
:
Int
)
:
Future
[
Option
[
String
]]
=
{
getPipelines
(
pipelineId
=
Some
(
pipelineId
)).
map
(
_
.
headOption
.
map
(
_
.
name
))
}
/** Creates a new module, even if it already exist. This may give a database exeption */
/** Creates a new module, even if it already exist. This may give a database exeption */
def
forceCreateModule
(
name
:
String
,
runId
:
Int
,
pipelineId
:
Int
)
:
Future
[
Int
]
=
{
def
forceCreateModule
(
name
:
String
,
runId
:
Int
,
pipelineId
:
Int
)
:
Future
[
Int
]
=
{
val
id
=
Await
.
result
(
db
.
run
(
modules
.
size
.
result
),
Duration
.
Inf
)
val
id
=
Await
.
result
(
db
.
run
(
modules
.
size
.
result
),
Duration
.
Inf
)
...
@@ -211,6 +216,11 @@ class SummaryDb(val db: Database) extends Closeable {
...
@@ -211,6 +216,11 @@ class SummaryDb(val db: Database) extends Closeable {
getModules
(
runId
=
Some
(
runId
),
name
=
Some
(
moduleName
),
pipelineId
=
Some
(
pipelineId
)).
map
(
_
.
headOption
.
map
(
_
.
id
))
getModules
(
runId
=
Some
(
runId
),
name
=
Some
(
moduleName
),
pipelineId
=
Some
(
pipelineId
)).
map
(
_
.
headOption
.
map
(
_
.
id
))
}
}
/** Returns name of a module */
def
getModuleName
(
pipelineId
:
Int
,
moduleId
:
Int
)
:
Future
[
Option
[
String
]]
=
{
getModules
(
pipelineId
=
Some
(
pipelineId
),
moduleId
=
Some
(
moduleId
)).
map
(
_
.
headOption
.
map
(
_
.
name
))
}
/** Create a new stat in the database, This method is need checking before */
/** Create a new stat in the database, This method is need checking before */
def
createStat
(
runId
:
Int
,
pipelineId
:
Int
,
moduleId
:
Option
[
Int
]
=
None
,
def
createStat
(
runId
:
Int
,
pipelineId
:
Int
,
moduleId
:
Option
[
Int
]
=
None
,
sampleId
:
Option
[
Int
]
=
None
,
libId
:
Option
[
Int
]
=
None
,
content
:
String
)
:
Future
[
Int
]
=
{
sampleId
:
Option
[
Int
]
=
None
,
libId
:
Option
[
Int
]
=
None
,
content
:
String
)
:
Future
[
Int
]
=
{
...
...
biopet-utils/src/test/scala/nl/lumc/sasc/biopet/utils/summary/db/SummaryDbTest.scala
View file @
b0ec2c16
...
@@ -101,7 +101,9 @@ class SummaryDbTest extends TestNGSuite with Matchers {
...
@@ -101,7 +101,9 @@ class SummaryDbTest extends TestNGSuite with Matchers {
val
runId
=
Await
.
result
(
db
.
createRun
(
"name"
,
"dir"
,
"version"
,
"hash"
,
date
),
Duration
.
Inf
)
val
runId
=
Await
.
result
(
db
.
createRun
(
"name"
,
"dir"
,
"version"
,
"hash"
,
date
),
Duration
.
Inf
)
Await
.
result
(
db
.
getPipelines
(),
Duration
.
Inf
)
shouldBe
empty
Await
.
result
(
db
.
getPipelines
(),
Duration
.
Inf
)
shouldBe
empty
Await
.
result
(
db
.
getPipelineName
(
0
),
Duration
.
Inf
)
shouldBe
None
val
pipelineId
=
Await
.
result
(
db
.
createPipeline
(
"test"
,
runId
),
Duration
.
Inf
)
val
pipelineId
=
Await
.
result
(
db
.
createPipeline
(
"test"
,
runId
),
Duration
.
Inf
)
Await
.
result
(
db
.
getPipelineName
(
pipelineId
),
Duration
.
Inf
)
shouldBe
Some
(
"test"
)
Await
.
result
(
db
.
getPipelines
(),
Duration
.
Inf
)
shouldBe
Seq
(
Schema
.
Pipeline
(
pipelineId
,
"test"
,
runId
))
Await
.
result
(
db
.
getPipelines
(),
Duration
.
Inf
)
shouldBe
Seq
(
Schema
.
Pipeline
(
pipelineId
,
"test"
,
runId
))
Await
.
result
(
db
.
getPipelineId
(
runId
,
"test"
),
Duration
.
Inf
)
shouldBe
Some
(
pipelineId
)
Await
.
result
(
db
.
getPipelineId
(
runId
,
"test"
),
Duration
.
Inf
)
shouldBe
Some
(
pipelineId
)
Await
.
result
(
db
.
createPipeline
(
"test"
,
runId
),
Duration
.
Inf
)
shouldBe
pipelineId
Await
.
result
(
db
.
createPipeline
(
"test"
,
runId
),
Duration
.
Inf
)
shouldBe
pipelineId
...
@@ -122,8 +124,10 @@ class SummaryDbTest extends TestNGSuite with Matchers {
...
@@ -122,8 +124,10 @@ class SummaryDbTest extends TestNGSuite with Matchers {
val
runId
=
Await
.
result
(
db
.
createRun
(
"name"
,
"dir"
,
"version"
,
"hash"
,
date
),
Duration
.
Inf
)
val
runId
=
Await
.
result
(
db
.
createRun
(
"name"
,
"dir"
,
"version"
,
"hash"
,
date
),
Duration
.
Inf
)
val
pipelineId
=
Await
.
result
(
db
.
createPipeline
(
"test"
,
runId
),
Duration
.
Inf
)
val
pipelineId
=
Await
.
result
(
db
.
createPipeline
(
"test"
,
runId
),
Duration
.
Inf
)
Await
.
result
(
db
.
getModules
(),
Duration
.
Inf
)
shouldBe
empty
Await
.
result
(
db
.
getModules
(),
Duration
.
Inf
)
shouldBe
empty
Await
.
result
(
db
.
getModuleName
(
pipelineId
,
0
),
Duration
.
Inf
)
shouldBe
None
val
moduleId
=
Await
.
result
(
db
.
createModule
(
"test"
,
runId
,
pipelineId
),
Duration
.
Inf
)
val
moduleId
=
Await
.
result
(
db
.
createModule
(
"test"
,
runId
,
pipelineId
),
Duration
.
Inf
)
Await
.
result
(
db
.
getmoduleId
(
runId
,
"test"
,
pipelineId
),
Duration
.
Inf
)
shouldBe
Some
(
moduleId
)
Await
.
result
(
db
.
getmoduleId
(
runId
,
"test"
,
pipelineId
),
Duration
.
Inf
)
shouldBe
Some
(
moduleId
)
Await
.
result
(
db
.
getModuleName
(
pipelineId
,
moduleId
),
Duration
.
Inf
)
shouldBe
Some
(
"test"
)
Await
.
result
(
db
.
getModules
(),
Duration
.
Inf
)
shouldBe
Seq
(
Schema
.
Module
(
pipelineId
,
"test"
,
runId
,
pipelineId
))
Await
.
result
(
db
.
getModules
(),
Duration
.
Inf
)
shouldBe
Seq
(
Schema
.
Module
(
pipelineId
,
"test"
,
runId
,
pipelineId
))
Await
.
result
(
db
.
createModule
(
"test"
,
runId
,
pipelineId
),
Duration
.
Inf
)
shouldBe
pipelineId
Await
.
result
(
db
.
createModule
(
"test"
,
runId
,
pipelineId
),
Duration
.
Inf
)
shouldBe
pipelineId
Await
.
result
(
db
.
getModules
(),
Duration
.
Inf
)
shouldBe
Seq
(
Schema
.
Module
(
pipelineId
,
"test"
,
runId
,
pipelineId
))
Await
.
result
(
db
.
getModules
(),
Duration
.
Inf
)
shouldBe
Seq
(
Schema
.
Module
(
pipelineId
,
"test"
,
runId
,
pipelineId
))
...
...
mapping/src/main/scala/nl/lumc/sasc/biopet/pipelines/mapping/MultisampleMappingReport.scala
View file @
b0ec2c16
...
@@ -14,14 +14,14 @@
...
@@ -14,14 +14,14 @@
*/
*/
package
nl.lumc.sasc.biopet.pipelines.mapping
package
nl.lumc.sasc.biopet.pipelines.mapping
import
nl.lumc.sasc.biopet.core.report.
{
MultisampleReportBuilder
,
ReportBuilderExtension
,
ReportPage
,
ReportSection
}
import
nl.lumc.sasc.biopet.core.report.
{
MultisampleReportBuilder
,
ReportBuilderExtension
,
ReportPage
,
ReportSection
}
import
nl.lumc.sasc.biopet.pipelines.bammetrics.BammetricsReport
import
nl.lumc.sasc.biopet.pipelines.bammetrics.BammetricsReport
import
nl.lumc.sasc.biopet.pipelines.flexiprep.FlexiprepReport
import
nl.lumc.sasc.biopet.pipelines.flexiprep.FlexiprepReport
import
nl.lumc.sasc.biopet.utils.config.Configurable
import
nl.lumc.sasc.biopet.utils.config.Configurable
import
nl.lumc.sasc.biopet.utils.summary.db.SummaryDb.Implicts._
import
nl.lumc.sasc.biopet.utils.summary.db.SummaryDb.Implicts._
import
nl.lumc.sasc.biopet.utils.summary.db.SummaryDb._
import
nl.lumc.sasc.biopet.utils.summary.db.SummaryDb._
import
scala.concurrent.
{
Await
,
Future
}
import
scala.concurrent.
{
Await
,
Future
}
import
scala.concurrent.duration.Duration
import
scala.concurrent.duration.Duration
import
scala.concurrent.ExecutionContext.Implicits.global
import
scala.concurrent.ExecutionContext.Implicits.global
...
@@ -119,15 +119,22 @@ trait MultisampleMappingReportTrait extends MultisampleReportBuilder {
...
@@ -119,15 +119,22 @@ trait MultisampleMappingReportTrait extends MultisampleReportBuilder {
val
dbFiles
=
summary
.
getFiles
(
runId
,
sample
=
Some
(
sampleId
.
map
(
SampleId
).
getOrElse
(
NoSample
)),
val
dbFiles
=
summary
.
getFiles
(
runId
,
sample
=
Some
(
sampleId
.
map
(
SampleId
).
getOrElse
(
NoSample
)),
library
=
Some
(
libraryId
.
map
(
LibraryId
).
getOrElse
(
NoLibrary
)))
library
=
Some
(
libraryId
.
map
(
LibraryId
).
getOrElse
(
NoLibrary
)))
.
map
(
_
.
groupBy
(
_
.
pipelineId
))
.
map
(
_
.
groupBy
(
_
.
pipelineId
))
.
map
(
_
.
map
{
case
(
pipelineId
,
files
)
=>
val
modulePages
=
dbFiles
.
map
(
_
.
map
{
val
moduleSections
=
files
.
groupBy
(
_
.
moduleId
).
map
{
case
(
moduleId
,
files
)
=>
case
(
pipelineId
,
files
)
=>
summary
.
getModules
(
moduleId
=
moduleId
,
pipelineId
=
pipelineId
)
val
moduleSections
=
files
.
groupBy
(
_
.
moduleId
).
map
{
.
map
(
_
.
headOption
.
map
(
_
.
name
).
getOrElse
(
"Pipeline"
)
->
ReportSection
(
"/nl/lumc/sasc/biopet/core/report/files.ssp"
))
case
(
moduleId
,
files
)
=>
}
val
moduleName
:
Future
[
String
]
=
moduleId
match
{
summary
.
getPipelines
(
pipelineId
=
pipelineId
).
map
(
_
.
head
.
name
->
ReportPage
(
Nil
,
Await
.
result
(
Future
.
sequence
(
moduleSections
),
Duration
.
Inf
).
toList
,
Map
()))
case
Some
(
id
)
=>
summary
.
getModuleName
(
pipelineId
,
id
).
map
(
_
.
getOrElse
(
"Pipeline"
))
case
_
=>
Future
(
"Pipeline"
)
}
moduleName
.
map
(
_
->
ReportSection
(
"/nl/lumc/sasc/biopet/core/report/files.ssp"
,
Map
(
"files"
->
files
)))
}
summary
.
getPipelineName
(
pipelineId
=
pipelineId
).
map
(
_
.
get
->
ReportPage
(
Nil
,
Await
.
result
(
Future
.
sequence
(
moduleSections
),
Duration
.
Inf
).
toList
,
Map
()))
})
})
dbFiles
.
flatMap
(
Future
.
sequence
(
_
)).
map
(
x
=>
ReportPage
(
x
.
toList
,
Nil
,
Map
()))
val
pipelineNames
=
dbFiles
.
flatMap
(
x
=>
Future
.
sequence
(
x
.
map
(
y
=>
summary
.
getPipelineName
(
y
.
_1
))))
modulePages
.
flatMap
(
Future
.
sequence
(
_
)).
map
(
x
=>
ReportPage
(
x
.
toList
,
"Pipelines"
->
ReportSection
(
"/nl/lumc/sasc/biopet/core/report/fileModules.ssp"
,
Map
(
"pipelineNames"
->
Await
.
result
(
pipelineNames
,
Duration
.
Inf
).
toList
))
::
Nil
,
Map
()))
}
}
/** Single sample page */
/** Single sample page */
...
@@ -184,7 +191,7 @@ trait MultisampleMappingReportTrait extends MultisampleReportBuilder {
...
@@ -184,7 +191,7 @@ trait MultisampleMappingReportTrait extends MultisampleReportBuilder {
else
Nil
)
:::
(
if
(
krakenExecuted
)
List
(
"Dustbin analysis"
->
ReportPage
(
List
(),
List
(
else
Nil
)
:::
(
if
(
krakenExecuted
)
List
(
"Dustbin analysis"
->
ReportPage
(
List
(),
List
(
"Krona Plot"
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp"
"Krona Plot"
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp"
)),
Map
()))
)),
Map
()))
else
Nil
),
else
Nil
)
:::
List
(
"Files"
->
Await
.
result
(
filesPage
(
sampleId
=
sampleId
,
libraryId
=
libId
),
Duration
.
Inf
))
,
"Alignment"
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/bammetrics/alignmentSummary.ssp"
)
::
"Alignment"
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/bammetrics/alignmentSummary.ssp"
)
::
(
if
(
flexiprepExecuted
)
List
(
"QC reads"
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepReadSummary.ssp"
),
(
if
(
flexiprepExecuted
)
List
(
"QC reads"
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepReadSummary.ssp"
),
"QC bases"
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepBaseSummary.ssp"
))
"QC bases"
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepBaseSummary.ssp"
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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