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
aa7b5e34
Commit
aa7b5e34
authored
Mar 14, 2017
by
Peter van 't Hof
Browse files
Fixing BIOPET-577
parent
b0ec2c16
Changes
5
Hide whitespace changes
Inline
Side-by-side
biopet-core/src/main/resources/nl/lumc/sasc/biopet/core/report/fileModules.ssp
View file @
aa7b5e34
#import(nl.lumc.sasc.biopet.utils.summary.db.Schema.File)
#import(nl.lumc.sasc.biopet.utils.summary.db.Schema.Pipeline)
#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._)
...
...
@@ -9,7 +10,9 @@
<%@ var sampleId: Option[Int] = None %>
<%@ var libId: Option[Int] = None %>
<%@ var runId: Int %>
<%@ var pipelineNames: List[Option[String]] %>
<%@ var pipelineIds: List[Int] %>
<%@ var allPipelines: Seq[Pipeline] %>
#{ val pipelineNames = pipelineIds.map(x => allPipelines.find(_.id == x).map(_.name)) }#
<table class="table">
<thead><tr>
<th>Pipeline</th>
...
...
biopet-core/src/main/resources/nl/lumc/sasc/biopet/core/report/files.ssp
View file @
aa7b5e34
#import(nl.lumc.sasc.biopet.utils.summary.db.Schema.File)
#import(nl.lumc.sasc.biopet.utils.summary.db.Schema.Pipeline)
#import(nl.lumc.sasc.biopet.utils.summary.db.Schema.Module)
#import(nl.lumc.sasc.biopet.utils.summary.db.Schema.Sample)
#import(nl.lumc.sasc.biopet.utils.summary.db.Schema.Library)
#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._)
...
...
@@ -10,14 +14,29 @@
<%@ var libId: Option[Int] = None %>
<%@ var runId: Int %>
<%@ var files: Seq[File]%>
<table class="table">
<%@ var allPipelines: Seq[Pipeline]%>
<%@ var allModules: Seq[Module]%>
<%@ var allSamples: Seq[Sample]%>
<%@ var allLibraries: Seq[Library]%>
<table class="table sortable-theme-bootstrap" data-sortable>
<thead><tr>
<th>Pipeline</th>
<th>Module</th>
<th>Sample</th>
<th>Library</th>
<th data-sorted="true" data-sorted-direction="ascending">Key</th>
<th>path</th><th>md5</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>
<tr><td>${allPipelines.find(_.id == file.pipelineId).map(_.name)}</td>
<td>${file.moduleId.map(id => allModules.find(x => x.pipelineId == file.pipelineId && file.moduleId == id).map(_.name)).flatten.getOrElse(("-"))}</td>
<td>${file.sampleId.map(id => allSamples.find(_.id == id).map(_.name)).flatten.getOrElse(("-"))}</td>
<td>${file.libraryId.map(id => allLibraries.find(_.id == id).map(_.name)).flatten.getOrElse(("-"))}</td>
<td>${file.key}</td>
<td>${file.path}</td>
<td>${file.md5}</td></tr>
#end
</tbody>
</table>
biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/report/ReportBuilder.scala
View file @
aa7b5e34
...
...
@@ -17,7 +17,7 @@ package nl.lumc.sasc.biopet.core.report
import
java.io._
import
nl.lumc.sasc.biopet.core.ToolCommandFunction
import
nl.lumc.sasc.biopet.utils.summary.db.Schema.
{
Library
,
Sample
}
import
nl.lumc.sasc.biopet.utils.summary.db.Schema.
{
Library
,
Module
,
Pipeline
,
Sample
}
import
nl.lumc.sasc.biopet.utils.summary.db.SummaryDb
import
nl.lumc.sasc.biopet.utils.
{
IoUtils
,
Logging
,
ToolCommand
}
import
org.broadinstitute.gatk.utils.commandline.Input
...
...
@@ -118,6 +118,10 @@ trait ReportBuilder extends ToolCommand {
final
def
runId
=
setRunId
private
var
_setPipelines
=
Seq
[
Pipeline
]()
final
def
pipelines
=
_setPipelines
private
var
_setModules
=
Seq
[
Module
]()
final
def
modules
=
_setModules
private
var
_setSamples
=
Seq
[
Sample
]()
final
def
samples
=
_setSamples
private
var
_setLibraries
=
Seq
[
Library
]()
...
...
@@ -177,6 +181,8 @@ trait ReportBuilder extends ToolCommand {
case
_
=>
}
_setPipelines
=
Await
.
result
(
summary
.
getPipelines
(
runId
=
Some
(
runId
)),
Duration
.
Inf
)
_setModules
=
Await
.
result
(
summary
.
getModules
(
runId
=
Some
(
runId
)),
Duration
.
Inf
)
_setSamples
=
Await
.
result
(
summary
.
getSamples
(
runId
=
Some
(
runId
),
sampleId
=
sampleId
),
Duration
.
Inf
)
_setLibraries
=
Await
.
result
(
summary
.
getLibraries
(
runId
=
Some
(
runId
),
sampleId
=
sampleId
,
libId
=
libId
),
Duration
.
Inf
)
...
...
@@ -236,7 +242,11 @@ trait ReportBuilder extends ToolCommand {
Map
(
"page"
->
page
,
"path"
->
path
,
"outputDir"
->
pageOutputDir
,
"rootPath"
->
rootPath
"rootPath"
->
rootPath
,
"allPipelines"
->
pipelines
,
"allModules"
->
modules
,
"allSamples"
->
samples
,
"allLibraries"
->
libraries
)
// Generating subpages
...
...
biopet-utils/src/main/scala/nl/lumc/sasc/biopet/utils/summary/db/Schema.scala
View file @
aa7b5e34
...
...
@@ -105,7 +105,7 @@ object Schema {
}
val
settings
=
TableQuery
[
Settings
]
case
class
File
(
runId
:
Int
,
pipelineId
:
Int
,
moduleId
:
Option
[
Int
],
sampleId
:
Option
[
Int
],
library
:
Option
[
Int
],
key
:
String
,
path
:
String
,
md5
:
String
,
link
:
Boolean
,
size
:
Long
)
case
class
File
(
runId
:
Int
,
pipelineId
:
Int
,
moduleId
:
Option
[
Int
],
sampleId
:
Option
[
Int
],
library
Id
:
Option
[
Int
],
key
:
String
,
path
:
String
,
md5
:
String
,
link
:
Boolean
,
size
:
Long
)
class
Files
(
tag
:
Tag
)
extends
Table
[
File
](
tag
,
"Files"
)
{
def
runId
=
column
[
Int
](
"runId"
)
def
pipelineId
=
column
[
Int
](
"pipelineId"
)
...
...
mapping/src/main/scala/nl/lumc/sasc/biopet/pipelines/mapping/MultisampleMappingReport.scala
View file @
aa7b5e34
...
...
@@ -116,25 +116,28 @@ trait MultisampleMappingReportTrait extends MultisampleReportBuilder {
/** Files page, can be used general or at sample level */
def
filesPage
(
sampleId
:
Option
[
Int
]
=
None
,
libraryId
:
Option
[
Int
]
=
None
)
:
Future
[
ReportPage
]
=
{
val
dbFiles
=
summary
.
getFiles
(
runId
,
sample
=
Some
(
sampleId
.
map
(
SampleId
)
.
getOrElse
(
NoSample
))
,
library
=
Some
(
libraryId
.
map
(
LibraryId
)
.
getOrElse
(
NoLibrary
))
)
val
dbFiles
=
summary
.
getFiles
(
runId
,
sample
=
sampleId
.
map
(
SampleId
),
library
=
libraryId
.
map
(
LibraryId
))
.
map
(
_
.
groupBy
(
_
.
pipelineId
))
val
modulePages
=
dbFiles
.
map
(
_
.
map
{
case
(
pipelineId
,
files
)
=>
val
moduleSections
=
files
.
groupBy
(
_
.
moduleId
).
map
{
case
(
moduleId
,
files
)
=>
val
moduleName
:
Future
[
String
]
=
moduleId
match
{
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
()))
})
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
()))
case
(
pipelineId
,
files
)
=>
val
moduleSections
=
files
.
groupBy
(
_
.
moduleId
).
map
{
case
(
moduleId
,
files
)
=>
val
moduleName
:
Future
[
String
]
=
moduleId
match
{
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
)))
}
val
moduleSectionsSorted
=
moduleSections
.
find
(
_
.
_1
==
"Pipeline"
)
++
moduleSections
.
filter
(
_
.
_1
!=
"Pipeline"
)
summary
.
getPipelineName
(
pipelineId
=
pipelineId
).
map
(
_
.
get
->
ReportPage
(
Nil
,
Await
.
result
(
Future
.
sequence
(
moduleSectionsSorted
),
Duration
.
Inf
).
toList
,
Map
()))
})
val
pipelineFiles
=
summary
.
getPipelineId
(
runId
,
pipelineName
).
flatMap
(
pipelinelineId
=>
dbFiles
.
map
(
x
=>
x
(
pipelinelineId
.
get
).
filter
(
_
.
moduleId
.
isEmpty
)))
modulePages
.
flatMap
(
Future
.
sequence
(
_
)).
map
(
x
=>
ReportPage
(
x
.
toList
,
s
"$pipelineName files"
->
ReportSection
(
"/nl/lumc/sasc/biopet/core/report/files.ssp"
,
Map
(
"files"
->
Await
.
result
(
pipelineFiles
,
Duration
.
Inf
)))
::
"Sub pipelines/modules"
->
ReportSection
(
"/nl/lumc/sasc/biopet/core/report/fileModules.ssp"
,
Map
(
"pipelineIds"
->
Await
.
result
(
dbFiles
.
map
(
_
.
keys
.
toList
),
Duration
.
Inf
)))
::
Nil
,
Map
()))
}
/** Single sample page */
...
...
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