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
18b8594a
Commit
18b8594a
authored
Mar 03, 2017
by
Peter van 't Hof
Browse files
Fixed compile errors
parent
c8ac4699
Changes
8
Hide whitespace changes
Inline
Side-by-side
bammetrics/src/main/scala/nl/lumc/sasc/biopet/pipelines/bammetrics/BammetricsReport.scala
View file @
18b8594a
...
...
@@ -66,8 +66,8 @@ object BammetricsReport extends ReportBuilder {
//val pipelineId: Int = summary.getPipelineId(runId, metricsTag).map(_.get)
val
wgsExecuted
=
summary
.
getStatsSize
(
runId
,
metricsTag
.
right
,
Some
(
"wgs"
.
right
),
sample
=
sampleId
.
map
(
_
.
left
),
library
=
libId
.
map
(
_
.
left
))
>=
1
val
rnaExecuted
=
summary
.
getStatsSize
(
runId
,
metricsTag
.
right
,
Some
(
"rna"
.
right
),
sample
=
sampleId
.
map
(
_
.
left
),
library
=
libId
.
map
(
_
.
left
))
>=
1
val
wgsExecuted
=
summary
.
getStatsSize
(
runId
,
Some
(
metricsTag
.
right
)
,
Some
(
Some
(
"wgs"
.
right
)
)
,
sample
=
sampleId
.
map
(
x
=>
Some
(
x
.
left
)
)
,
library
=
libId
.
map
(
x
=>
Some
(
x
.
left
))
)
>=
1
val
rnaExecuted
=
summary
.
getStatsSize
(
runId
,
Some
(
metricsTag
.
right
)
,
Some
(
Some
(
"rna"
.
right
)
)
,
sample
=
sampleId
.
map
(
x
=>
Some
(
x
.
left
)
)
,
library
=
libId
.
map
(
x
=>
Some
(
x
.
left
))
)
>=
1
val
insertsizeMetrics
=
summary
.
getStatKeys
(
runId
,
metricsTag
.
right
,
Some
(
"CollectInsertSizeMetrics"
.
right
),
sample
=
sampleId
.
map
(
_
.
left
),
library
=
libId
.
map
(
_
.
left
),
Map
(
"metrics"
->
List
(
"metrics"
)))
...
...
flexiprep/src/main/scala/nl/lumc/sasc/biopet/pipelines/flexiprep/FlexiprepReport.scala
View file @
18b8594a
...
...
@@ -23,6 +23,8 @@ import nl.lumc.sasc.biopet.utils.summary.db.SummaryDb
import
scala.concurrent.Await
import
scala.concurrent.duration.Duration
import
scalaz._
import
Scalaz._
class
FlexiprepReport
(
val
parent
:
Configurable
)
extends
ReportBuilderExtension
{
def
builder
=
FlexiprepReport
...
...
@@ -95,15 +97,15 @@ object FlexiprepReport extends ReportBuilder {
tsvWriter
.
println
(
"Library\tAfter_QC\tClipping\tTrimming\tSynced"
)
val
seqstatPaths
=
Map
(
"num_total"
->
List
(
"reads"
,
"num_total"
))
val
seqstatStats
=
summary
.
getStatsForLibraries
(
runId
,
Right
(
"flexiprep"
),
Right
(
"seqstat_"
+
read
),
keyValues
=
seqstatPaths
)
val
seqstatQcStats
=
summary
.
getStatsForLibraries
(
runId
,
Right
(
"flexiprep"
),
Right
(
"seqstat_"
+
read
+
"_qc"
),
keyValues
=
seqstatPaths
)
val
seqstatStats
=
summary
.
getStatsForLibraries
(
runId
,
"flexiprep"
.
right
,
Some
(
(
"seqstat_"
+
read
)
.
right
)
,
keyValues
=
seqstatPaths
)
val
seqstatQcStats
=
summary
.
getStatsForLibraries
(
runId
,
"flexiprep"
.
right
,
Some
(
(
"seqstat_"
+
read
+
"_qc"
)
.
right
)
,
keyValues
=
seqstatPaths
)
val
clippingPaths
=
Map
(
"num_reads_discarded_too_short"
->
List
(
"num_reads_discarded_too_short"
),
"num_reads_discarded_too_long"
->
List
(
"num_reads_discarded_too_long"
))
val
clippingStats
=
summary
.
getStatsForLibraries
(
runId
,
Right
(
"flexiprep"
),
Right
(
"clipping_"
+
read
),
keyValues
=
clippingPaths
)
val
clippingStats
=
summary
.
getStatsForLibraries
(
runId
,
"flexiprep"
.
right
,
Some
(
(
"clipping_"
+
read
)
.
right
)
,
keyValues
=
clippingPaths
)
val
trimmingPaths
=
Map
(
"num_reads_discarded"
->
List
(
"num_reads_discarded_"
+
read
))
val
trimmingStats
=
summary
.
getStatsForLibraries
(
runId
,
Right
(
"flexiprep"
),
Right
(
"trimming"
),
keyValues
=
trimmingPaths
)
val
trimmingStats
=
summary
.
getStatsForLibraries
(
runId
,
"flexiprep"
.
right
,
Some
(
"trimming"
.
right
),
keyValues
=
trimmingPaths
)
val
libraries
=
Await
.
result
(
summary
.
getLibraries
(
runId
=
runId
,
sampleId
=
sampleId
),
Duration
.
Inf
)
...
...
@@ -154,8 +156,8 @@ object FlexiprepReport extends ReportBuilder {
tsvWriter
.
println
(
"Library\tAfter_QC\tDiscarded"
)
val
statsPaths
=
Map
(
"num_total"
->
List
(
"bases"
,
"num_total"
))
val
seqstatStats
=
summary
.
getStatsForLibraries
(
runId
,
Right
(
"flexiprep"
),
Right
(
"seqstat_"
+
read
),
keyValues
=
statsPaths
)
val
seqstatQcStats
=
summary
.
getStatsForLibraries
(
runId
,
Right
(
"flexiprep"
),
Right
(
"seqstat_"
+
read
+
"_qc"
),
keyValues
=
statsPaths
)
val
seqstatStats
=
summary
.
getStatsForLibraries
(
runId
,
"flexiprep"
.
right
,
Some
(
(
"seqstat_"
+
read
)
.
right
)
,
keyValues
=
statsPaths
)
val
seqstatQcStats
=
summary
.
getStatsForLibraries
(
runId
,
"flexiprep"
.
right
,
Some
(
(
"seqstat_"
+
read
+
"_qc"
)
.
right
)
,
keyValues
=
statsPaths
)
val
libraries
=
Await
.
result
(
summary
.
getLibraries
(
runId
=
runId
,
sampleId
=
sampleId
),
Duration
.
Inf
)
...
...
gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/GearsReport.scala
View file @
18b8594a
...
...
@@ -14,7 +14,6 @@
*/
package
nl.lumc.sasc.biopet.pipelines.gears
import
nl.lumc.sasc.biopet.utils.implicits.Either._
import
nl.lumc.sasc.biopet.core.report.
{
MultisampleReportBuilder
,
ReportBuilderExtension
,
ReportPage
,
ReportSection
}
import
nl.lumc.sasc.biopet.pipelines.flexiprep.FlexiprepReport
import
nl.lumc.sasc.biopet.utils.config.Configurable
...
...
@@ -22,6 +21,9 @@ import nl.lumc.sasc.biopet.utils.config.Configurable
import
scala.concurrent.Await
import
scala.concurrent.duration.Duration
import
scalaz._
import
Scalaz._
/**
* Report for Gears
*
...
...
@@ -39,10 +41,10 @@ object GearsReport extends MultisampleReportBuilder {
.
map
(
x
=>
ExtFile
(
"/nl/lumc/sasc/biopet/pipelines/gears/report/ext/"
+
x
,
x
))
def
indexPage
=
{
val
krakenExecuted
=
summary
.
getStatsSize
(
runId
=
runId
,
pipeline
=
Right
(
"gearskraken"
),
module
=
Some
(
Right
(
"krakenreport"
)),
library
=
Some
(
None
),
mustHaveSample
=
true
)
>=
samples
.
size
val
centrifugeExecuted
=
summary
.
getStatsSize
(
runId
,
Right
(
"gearscentrifuge"
),
Some
(
Right
(
"centrifuge_report"
)),
library
=
Some
(
None
),
mustHaveSample
=
true
)
>=
samples
.
size
val
qiimeClosesOtuTable
=
summary
.
getFile
(
runId
,
Right
(
"gears"
)
,
None
,
None
,
None
,
key
=
"qiime_closed_otu_table"
)
val
qiimeOpenOtuTable
=
summary
.
getFile
(
runId
,
Right
(
"gears"
)
,
None
,
None
,
None
,
key
=
"qiime_open_otu_table"
)
val
krakenExecuted
=
summary
.
getStatsSize
(
runId
=
runId
,
pipeline
=
Some
(
"gearskraken"
.
right
),
module
=
Some
(
Some
(
"krakenreport"
.
right
)),
library
=
Some
(
None
),
mustHaveSample
=
true
)
>=
samples
.
size
val
centrifugeExecuted
=
summary
.
getStatsSize
(
runId
,
Some
(
"gearscentrifuge"
.
right
),
Some
(
Some
(
"centrifuge_report"
.
right
)),
library
=
Some
(
None
),
mustHaveSample
=
true
)
>=
samples
.
size
val
qiimeClosesOtuTable
=
summary
.
getFile
(
runId
,
"gears"
.
right
,
None
,
None
,
None
,
key
=
"qiime_closed_otu_table"
)
val
qiimeOpenOtuTable
=
summary
.
getFile
(
runId
,
"gears"
.
right
,
None
,
None
,
None
,
key
=
"qiime_open_otu_table"
)
ReportPage
(
(
if
(
centrifugeExecuted
)
List
(
"Centriguge analysis"
->
ReportPage
(
List
(
"Non-unique"
->
ReportPage
(
List
(),
List
(
"All mappings"
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp"
,
...
...
@@ -80,10 +82,10 @@ object GearsReport extends MultisampleReportBuilder {
/** Single sample page */
def
samplePage
(
sampleId
:
Int
,
args
:
Map
[
String
,
Any
])
:
ReportPage
=
{
val
krakenExecuted
=
Await
.
result
(
summary
.
getStatsSize
(
runId
,
Right
(
"gearskraken"
),
Some
(
Right
(
"krakenreport"
)),
sample
=
Left
(
sampleId
),
library
=
Some
(
None
)),
Duration
.
Inf
)
==
1
val
centrifugeExecuted
=
Await
.
result
(
summary
.
getStatsSize
(
runId
,
Right
(
"gearscentrifuge"
),
Some
(
Right
(
"centrifuge_report"
)),
sample
=
Left
(
sampleId
),
library
=
None
),
Duration
.
Inf
)
==
1
val
qiimeClosesOtuTable
=
Await
.
result
(
summary
.
getFile
(
runId
,
Right
(
"gears"
)
,
None
,
Some
(
Left
(
sampleId
)
),
None
,
"qiime_closed_otu_table"
),
Duration
.
Inf
)
val
qiimeOpenOtuTable
=
Await
.
result
(
summary
.
getFile
(
runId
,
Right
(
"gears"
)
,
None
,
Some
(
Left
(
sampleId
)
),
None
,
"qiime_open_otu_table"
),
Duration
.
Inf
)
val
krakenExecuted
=
Await
.
result
(
summary
.
getStatsSize
(
runId
,
Some
(
"gearskraken"
.
right
),
Some
(
Some
(
"krakenreport"
.
right
)),
sample
=
Some
(
Some
(
sampleId
.
left
)
),
library
=
Some
(
None
)),
Duration
.
Inf
)
==
1
val
centrifugeExecuted
=
Await
.
result
(
summary
.
getStatsSize
(
runId
,
Some
(
"gearscentrifuge"
.
right
),
Some
(
Some
(
"centrifuge_report"
.
right
)),
sample
=
Some
(
Some
(
sampleId
.
left
)
),
library
=
None
),
Duration
.
Inf
)
==
1
val
qiimeClosesOtuTable
=
Await
.
result
(
summary
.
getFile
(
runId
,
"gears"
.
right
,
None
,
Some
(
sampleId
.
left
),
None
,
"qiime_closed_otu_table"
),
Duration
.
Inf
)
val
qiimeOpenOtuTable
=
Await
.
result
(
summary
.
getFile
(
runId
,
"gears"
.
right
,
None
,
Some
(
sampleId
.
left
),
None
,
"qiime_open_otu_table"
),
Duration
.
Inf
)
ReportPage
((
if
(
centrifugeExecuted
)
List
(
"Centriguge analysis"
->
ReportPage
(
List
(
"Non-unique"
->
ReportPage
(
List
(),
List
(
"All mappings"
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp"
,
Map
(
"summaryStatsTag"
->
"centrifuge_report"
)
...
...
@@ -112,12 +114,12 @@ object GearsReport extends MultisampleReportBuilder {
val
sName
=
Await
.
result
(
summary
.
getSampleName
(
sampleId
),
Duration
.
Inf
)
val
lName
=
Await
.
result
(
summary
.
getLibraryName
(
libId
),
Duration
.
Inf
)
val
flexiprepExecuted
=
Await
.
result
(
summary
.
getStatsSize
(
runId
,
Some
(
Right
(
"flexiprep"
)
),
sample
=
Some
(
Left
(
sampleId
)),
library
=
Some
(
Left
(
libId
))),
Duration
.
Inf
)
>=
1
val
flexiprepExecuted
=
Await
.
result
(
summary
.
getStatsSize
(
runId
,
Some
(
"flexiprep"
.
right
),
sample
=
Some
(
Some
(
sampleId
.
left
)),
library
=
Some
(
Some
(
libId
.
left
))),
Duration
.
Inf
)
>=
1
val
krakenExecuted
=
Await
.
result
(
summary
.
getStatsSize
(
runId
,
Right
(
"gearskraken"
),
Some
(
Right
(
"krakenreport"
)),
sample
=
Some
(
Left
(
sampleId
)),
library
=
Some
(
Left
(
libId
))),
Duration
.
Inf
)
==
1
val
centrifugeExecuted
=
Await
.
result
(
summary
.
getStatsSize
(
runId
,
Right
(
"gearscentrifuge"
),
Some
(
Right
(
"centrifuge_report"
)),
sample
=
Some
(
Left
(
sampleId
)),
library
=
Some
(
Left
(
libId
))),
Duration
.
Inf
)
==
1
val
qiimeClosesOtuTable
=
Await
.
result
(
summary
.
getFile
(
runId
,
Right
(
"gears"
)
,
None
,
Some
(
Left
(
sampleId
)
),
Some
(
Left
(
libId
)
),
"qiime_closed_otu_table"
),
Duration
.
Inf
)
val
qiimeOpenOtuTable
=
Await
.
result
(
summary
.
getFile
(
runId
,
Right
(
"gears"
)
,
None
,
Some
(
Left
(
sampleId
)
),
Some
(
Left
(
libId
)
),
"qiime_open_otu_table"
),
Duration
.
Inf
)
val
krakenExecuted
=
Await
.
result
(
summary
.
getStatsSize
(
runId
,
Some
(
"gearskraken"
.
right
),
Some
(
Some
(
"krakenreport"
.
right
)),
sample
=
Some
(
Some
(
sampleId
.
left
)),
library
=
Some
(
Some
(
libId
.
left
))),
Duration
.
Inf
)
==
1
val
centrifugeExecuted
=
Await
.
result
(
summary
.
getStatsSize
(
runId
,
Some
(
"gearscentrifuge"
.
right
),
Some
(
Some
(
"centrifuge_report"
.
right
)),
sample
=
Some
(
Some
(
sampleId
.
left
)),
library
=
Some
(
Some
(
libId
.
left
))),
Duration
.
Inf
)
==
1
val
qiimeClosesOtuTable
=
Await
.
result
(
summary
.
getFile
(
runId
,
"gears"
.
right
,
None
,
Some
(
sampleId
.
left
),
Some
(
libId
.
left
),
"qiime_closed_otu_table"
),
Duration
.
Inf
)
val
qiimeOpenOtuTable
=
Await
.
result
(
summary
.
getFile
(
runId
,
"gears"
.
right
,
None
,
Some
(
sampleId
.
left
),
Some
(
libId
.
left
),
"qiime_open_otu_table"
),
Duration
.
Inf
)
ReportPage
(
(
if
(
flexiprepExecuted
)
List
(
"QC"
->
FlexiprepReport
.
flexiprepPage
)
else
Nil
...
...
gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/GearsSingleReport.scala
View file @
18b8594a
...
...
@@ -19,6 +19,8 @@ import nl.lumc.sasc.biopet.utils.config.Configurable
import
scala.concurrent.Await
import
scala.concurrent.duration.Duration
import
scalaz._
import
Scalaz._
class
GearsSingleReport
(
val
parent
:
Configurable
)
extends
ReportBuilderExtension
{
def
builder
=
GearsSingleReport
...
...
@@ -33,8 +35,8 @@ object GearsSingleReport extends ReportBuilder {
val
sampleName
=
sampleId
.
flatMap
(
x
=>
Await
.
result
(
summary
.
getSampleName
(
x
),
Duration
.
Inf
))
val
libraryName
=
libId
.
flatMap
(
x
=>
Await
.
result
(
summary
.
getLibraryName
(
x
),
Duration
.
Inf
))
val
krakenExecuted
=
summary
.
getStatsSize
(
runId
,
Right
(
"gearskraken"
),
Some
(
Right
(
"krakenreport"
)),
sample
=
sampleId
.
map
(
L
eft
(
_
)),
library
=
libId
.
map
(
Left
(
_
))
)
==
1
val
centrifugeExecuted
=
summary
.
getStatsSize
(
runId
,
Right
(
"gearscentrifuge"
),
Some
(
Right
(
"centrifuge_report"
)),
sample
=
sampleId
.
map
(
L
eft
(
_
)),
library
=
libId
.
map
(
Left
(
_
))
)
==
1
val
krakenExecuted
=
Await
.
result
(
summary
.
getStatsSize
(
runId
,
Some
(
"gearskraken"
.
right
),
Some
(
Some
(
"krakenreport"
.
right
)),
sample
=
Some
(
sampleId
.
map
(
_
.
l
eft
)),
library
=
Some
(
libId
.
map
(
_
.
left
))),
Duration
.
Inf
)
==
1
val
centrifugeExecuted
=
Await
.
result
(
summary
.
getStatsSize
(
runId
,
Some
(
"gearscentrifuge"
.
right
),
Some
(
Some
(
"centrifuge_report"
.
right
)),
sample
=
Some
(
sampleId
.
map
(
_
.
l
eft
)),
library
=
Some
(
libId
.
map
(
_
.
left
))),
Duration
.
Inf
)
==
1
ReportPage
(
List
(
...
...
kopisu/src/test/scala/nl/lumc/sasc/biopet/pipelines/kopisu/KopisuTest.scala
View file @
18b8594a
...
...
@@ -57,8 +57,8 @@ class KopisuTest extends TestNGSuite with Matchers {
@Test
(
dataProvider
=
"shivaSvCallingOptions"
)
def
testKopisu
(
bams
:
Int
,
freec
:
Boolean
,
conifer
:
Boolean
)
=
{
freec
:
Boolean
,
conifer
:
Boolean
)
=
{
val
outputDir
=
Files
.
createTempDir
()
dirs
:+=
outputDir
...
...
mapping/src/main/scala/nl/lumc/sasc/biopet/pipelines/mapping/MappingReport.scala
View file @
18b8594a
...
...
@@ -21,6 +21,8 @@ import nl.lumc.sasc.biopet.pipelines.flexiprep.FlexiprepReport
import
scala.concurrent.Await
import
scala.concurrent.duration.Duration
import
scalaz._
import
Scalaz._
class
MappingReport
(
val
parent
:
Configurable
)
extends
ReportBuilderExtension
{
def
builder
=
MappingReport
...
...
@@ -38,12 +40,12 @@ object MappingReport extends ReportBuilder {
override
def
extFiles
=
super
.
extFiles
++
List
(
"js/gears.js"
,
"js/krona-2.0.js"
,
"img/krona/loading.gif"
,
"img/krona/hidden.png"
,
"img/krona/favicon.ico"
)
.
map
(
x
=>
ExtFile
(
"/nl/lumc/sasc/biopet/pipelines/gears/report/ext/"
+
x
,
x
))
def
krakenExecuted
:
Boolean
=
Await
.
result
(
summary
.
getStatsSize
(
runId
,
Right
(
"gears"
),
Some
(
Right
(
"krakenreport"
)),
sample
=
sampleId
.
map
(
L
eft
(
_
)),
library
=
libId
.
map
(
L
eft
(
_
))),
Duration
.
Inf
)
>=
1
def
krakenExecuted
:
Boolean
=
Await
.
result
(
summary
.
getStatsSize
(
runId
,
Some
(
"gears"
.
right
),
Some
(
Some
(
"krakenreport"
.
right
)),
sample
=
Some
(
sampleId
.
map
(
_
.
l
eft
)),
library
=
Some
(
libId
.
map
(
_
.
l
eft
))),
Duration
.
Inf
)
>=
1
/** Root page for single BamMetrcis report */
def
indexPage
=
{
val
mappingSettings
=
summary
.
getSettingKeys
(
runId
,
Right
(
"mapping"
)
,
None
,
sample
=
sampleId
.
map
(
Left
(
_
)
),
library
=
libId
.
map
(
Left
(
_
)
),
val
mappingSettings
=
summary
.
getSettingKeys
(
runId
,
"mapping"
.
right
,
None
,
sample
=
sampleId
.
map
(
_
.
left
),
library
=
libId
.
map
(
_
.
left
),
keyValues
=
Map
(
"skip_flexiprep"
->
List
(
"skip_flexiprep"
),
"skip_metrics"
->
List
(
"skip_metrics"
)))
val
skipFlexiprep
=
mappingSettings
.
get
(
"skip_flexiprep"
).
flatten
.
getOrElse
(
false
)
==
true
val
bamMetricsPage
=
if
(
mappingSettings
.
get
(
"skip_metrics"
).
flatten
.
getOrElse
(
false
)
==
true
)
{
...
...
mapping/src/main/scala/nl/lumc/sasc/biopet/pipelines/mapping/MultisampleMappingReport.scala
View file @
18b8594a
...
...
@@ -21,6 +21,8 @@ import nl.lumc.sasc.biopet.utils.config.Configurable
import
scala.concurrent.Await
import
scala.concurrent.duration.Duration
import
scalaz._
import
Scalaz._
/**
* Created by pjvanthof on 11/01/16.
...
...
@@ -48,20 +50,20 @@ trait MultisampleMappingReportTrait extends MultisampleReportBuilder {
/** Root page for the carp report */
def
indexPage
=
{
val
krakenExecuted
=
Await
.
result
(
summary
.
getStatsSize
(
runId
,
Right
(
"gearskraken"
),
Some
(
Right
(
"krakenreport"
)),
val
krakenExecuted
=
Await
.
result
(
summary
.
getStatsSize
(
runId
,
Some
(
"gearskraken"
.
right
),
Some
(
Some
(
"krakenreport"
.
right
)),
library
=
Some
(
None
),
mustHaveSample
=
true
),
Duration
.
Inf
)
>=
1
val
centrifugeExecuted
=
Await
.
result
(
summary
.
getStatsSize
(
runId
,
Right
(
"gearscentrifuge"
),
Some
(
Right
(
"centrifuge_report"
)),
val
centrifugeExecuted
=
Await
.
result
(
summary
.
getStatsSize
(
runId
,
Some
(
"gearscentrifuge"
.
right
),
Some
(
Some
(
"centrifuge_report"
.
right
)),
library
=
Some
(
None
),
mustHaveSample
=
true
),
Duration
.
Inf
)
>=
1
val
wgsExecuted
=
Await
.
result
(
summary
.
getStatsSize
(
runId
,
Right
(
"bammetrics"
),
Some
(
Right
(
"wgs"
)),
val
wgsExecuted
=
Await
.
result
(
summary
.
getStatsSize
(
runId
,
Some
(
"bammetrics"
.
right
),
Some
(
Some
(
"wgs"
.
right
)),
library
=
Some
(
None
),
mustHaveSample
=
true
),
Duration
.
Inf
)
>=
1
val
rnaExecuted
=
Await
.
result
(
summary
.
getStatsSize
(
runId
,
Right
(
"bammetrics"
),
Some
(
Right
(
"rna"
)),
val
rnaExecuted
=
Await
.
result
(
summary
.
getStatsSize
(
runId
,
Some
(
"bammetrics"
.
right
),
Some
(
Some
(
"rna"
.
right
)),
library
=
Some
(
None
),
mustHaveSample
=
true
),
Duration
.
Inf
)
>=
1
val
insertsizeExecuted
=
Await
.
result
(
summary
.
getStatsSize
(
runId
,
Right
(
"bammetrics"
),
Some
(
Right
(
"CollectInsertSizeMetrics"
)),
val
insertsizeExecuted
=
Await
.
result
(
summary
.
getStatsSize
(
runId
,
Some
(
"bammetrics"
.
right
),
Some
(
Some
(
"CollectInsertSizeMetrics"
.
right
)),
library
=
Some
(
None
),
mustHaveSample
=
true
),
Duration
.
Inf
)
>=
1
val
mappingExecuted
=
Await
.
result
(
summary
.
getStatsSize
(
runId
,
Right
(
"mapping"
),
Some
(
None
),
mustHaveLibrary
=
true
),
Duration
.
Inf
)
>=
1
val
mappingSettings
=
summary
.
getSettingsForLibraries
(
runId
,
Right
(
"mapping"
)
,
None
,
keyValues
=
Map
(
"paired"
->
List
(
"paired"
)))
val
mappingExecuted
=
Await
.
result
(
summary
.
getStatsSize
(
runId
,
Some
(
"mapping"
.
right
),
Some
(
None
),
mustHaveLibrary
=
true
),
Duration
.
Inf
)
>=
1
val
mappingSettings
=
summary
.
getSettingsForLibraries
(
runId
,
"mapping"
.
right
,
None
,
keyValues
=
Map
(
"paired"
->
List
(
"paired"
)))
val
pairedFound
=
!
mappingExecuted
||
mappingSettings
.
exists
(
_
.
_2
.
exists
(
_
.
_2
==
Option
(
true
)))
val
flexiprepExecuted
=
Await
.
result
(
summary
.
getStatsSize
(
runId
,
Right
(
"flexiprep"
),
mustHaveLibrary
=
true
),
Duration
.
Inf
)
>=
1
val
flexiprepExecuted
=
Await
.
result
(
summary
.
getStatsSize
(
runId
,
Some
(
"flexiprep"
.
right
),
mustHaveLibrary
=
true
),
Duration
.
Inf
)
>=
1
ReportPage
(
List
(
"Samples"
->
generateSamplesPage
(
pageArgs
))
++
...
...
@@ -113,19 +115,19 @@ trait MultisampleMappingReportTrait extends MultisampleReportBuilder {
/** Files page, can be used general or at sample level */
def
filesPage
(
sampleId
:
Option
[
Int
]
=
None
,
libraryId
:
Option
[
Int
]
=
None
)
:
ReportPage
=
{
val
flexiprepExecuted
=
Await
.
result
(
summary
.
getStatsSize
(
runId
,
Right
(
"flexiprep"
),
Some
(
None
),
mustHaveLibrary
=
true
),
Duration
.
Inf
)
>=
1
val
flexiprepExecuted
=
Await
.
result
(
summary
.
getStatsSize
(
runId
,
Some
(
"flexiprep"
.
right
),
Some
(
None
),
mustHaveLibrary
=
true
),
Duration
.
Inf
)
>=
1
ReportPage
(
List
(),
Nil
,
Map
())
}
/** Single sample page */
def
samplePage
(
sampleId
:
Int
,
args
:
Map
[
String
,
Any
])
:
ReportPage
=
{
val
krakenExecuted
=
Await
.
result
(
summary
.
getStatsSize
(
runId
,
Right
(
"gearskraken"
),
Some
(
Right
(
"krakenreport"
)),
library
=
Some
(
None
),
sample
=
Some
(
Left
(
sampleId
))),
Duration
.
Inf
)
>=
1
val
centrifugeExecuted
=
Await
.
result
(
summary
.
getStatsSize
(
runId
,
Right
(
"gearscentrifuge"
),
Some
(
Right
(
"centrifuge_report"
)),
library
=
Some
(
None
),
sample
=
Some
(
Left
(
sampleId
)),
mustHaveSample
=
true
),
Duration
.
Inf
)
>=
1
val
flexiprepExecuted
=
Await
.
result
(
summary
.
getStatsSize
(
runId
,
Right
(
"flexiprep"
),
sample
=
Some
(
Left
(
sampleId
)),
mustHaveLibrary
=
true
),
Duration
.
Inf
)
>=
1
val
krakenExecuted
=
Await
.
result
(
summary
.
getStatsSize
(
runId
,
Some
(
"gearskraken"
.
right
),
Some
(
Some
(
"krakenreport"
.
right
)),
library
=
Some
(
None
),
sample
=
Some
(
Some
(
sampleId
.
left
))),
Duration
.
Inf
)
>=
1
val
centrifugeExecuted
=
Await
.
result
(
summary
.
getStatsSize
(
runId
,
Some
(
"gearscentrifuge"
.
right
),
Some
(
Some
(
"centrifuge_report"
.
right
)),
library
=
Some
(
None
),
sample
=
Some
(
Some
(
sampleId
.
left
)),
mustHaveSample
=
true
),
Duration
.
Inf
)
>=
1
val
flexiprepExecuted
=
Await
.
result
(
summary
.
getStatsSize
(
runId
,
Some
(
"flexiprep"
.
right
),
sample
=
Some
(
Some
(
sampleId
.
left
)),
mustHaveLibrary
=
true
),
Duration
.
Inf
)
>=
1
ReportPage
(
List
(
"Libraries"
->
generateLibraryPage
(
args
),
...
...
@@ -153,12 +155,12 @@ trait MultisampleMappingReportTrait extends MultisampleReportBuilder {
/** Library page */
def
libraryPage
(
sampleId
:
Int
,
libId
:
Int
,
args
:
Map
[
String
,
Any
])
:
ReportPage
=
{
val
krakenExecuted
=
Await
.
result
(
summary
.
getStatsSize
(
runId
,
Right
(
"gearskraken"
),
Some
(
Right
(
"krakenreport"
)),
library
=
Some
(
Left
(
libId
)),
sample
=
Some
(
Left
(
sampleId
))),
Duration
.
Inf
)
>=
1
val
centrifugeExecuted
=
Await
.
result
(
summary
.
getStatsSize
(
runId
,
Right
(
"gearscentrifuge"
),
Some
(
Right
(
"centrifuge_report"
)),
library
=
Some
(
Left
(
libId
)),
sample
=
Some
(
Left
(
sampleId
)),
mustHaveSample
=
true
),
Duration
.
Inf
)
>=
1
val
flexiprepExecuted
=
Await
.
result
(
summary
.
getStatsSize
(
runId
,
Right
(
"flexiprep"
),
library
=
Some
(
Left
(
libId
)),
sample
=
Some
(
Left
(
sampleId
)),
mustHaveLibrary
=
true
),
Duration
.
Inf
)
>=
1
val
krakenExecuted
=
Await
.
result
(
summary
.
getStatsSize
(
runId
,
Some
(
"gearskraken"
.
right
),
Some
(
Some
(
"krakenreport"
.
right
)),
library
=
Some
(
Some
(
libId
.
left
)),
sample
=
Some
(
Some
(
sampleId
.
left
))),
Duration
.
Inf
)
>=
1
val
centrifugeExecuted
=
Await
.
result
(
summary
.
getStatsSize
(
runId
,
Some
(
"gearscentrifuge"
.
right
),
Some
(
Some
(
"centrifuge_report"
.
right
)),
library
=
Some
(
Some
(
libId
.
left
)),
sample
=
Some
(
Some
(
sampleId
.
left
)),
mustHaveSample
=
true
),
Duration
.
Inf
)
>=
1
val
flexiprepExecuted
=
Await
.
result
(
summary
.
getStatsSize
(
runId
,
Some
(
"flexiprep"
.
right
),
library
=
Some
(
Some
(
libId
.
left
)),
sample
=
Some
(
Some
(
sampleId
.
left
)),
mustHaveLibrary
=
true
),
Duration
.
Inf
)
>=
1
ReportPage
(
(
"Alignment"
->
BammetricsReport
.
bamMetricsPage
(
summary
,
Some
(
sampleId
),
Some
(
libId
)))
::
...
...
shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaReport.scala
View file @
18b8594a
...
...
@@ -25,6 +25,8 @@ import nl.lumc.sasc.biopet.utils.summary.{ Summary, SummaryValue }
import
scala.concurrent.Await
import
scala.concurrent.duration.Duration
import
scalaz._
import
Scalaz._
/**
* With this extension the report is executed within a pipeline
...
...
@@ -41,7 +43,7 @@ object ShivaReport extends ShivaReportTrait
/** Trait for report generation for Shiva pipeline, this can be extended */
trait
ShivaReportTrait
extends
MultisampleMappingReportTrait
{
def
variantcallingExecuted
=
summary
.
getSettingKeys
(
runId
,
Right
(
"shiva"
)
,
None
,
keyValues
=
Map
(
"multisample_variantcalling"
->
List
(
"multisample_variantcalling"
))).
get
(
"multisample_variantcalling"
)
def
variantcallingExecuted
=
summary
.
getSettingKeys
(
runId
,
"shiva"
.
right
,
None
,
keyValues
=
Map
(
"multisample_variantcalling"
->
List
(
"multisample_variantcalling"
))).
get
(
"multisample_variantcalling"
)
.
flatten
match
{
case
Some
(
true
)
=>
true
case
_
=>
false
...
...
@@ -65,8 +67,8 @@ trait ShivaReportTrait extends MultisampleMappingReportTrait {
/** Generate a page with all target coverage stats */
def
regionsPage
:
Option
[(
String
,
ReportPage
)]
=
{
val
roi
=
summary
.
getSetting
(
runId
,
Right
(
"shiva"
)
).
get
(
"regions_of_interest"
)
val
amplicon
=
summary
.
getSetting
(
runId
,
Right
(
"shiva"
)
).
get
(
"amplicon_bed"
)
val
roi
=
summary
.
getSetting
(
runId
,
"shiva"
.
right
).
get
(
"regions_of_interest"
)
val
amplicon
=
summary
.
getSetting
(
runId
,
"shiva"
.
right
).
get
(
"amplicon_bed"
)
var
regionPages
:
Map
[
String
,
ReportPage
]
=
Map
()
...
...
@@ -155,7 +157,7 @@ trait ShivaReportTrait extends MultisampleMappingReportTrait {
case
_
=>
s
"multisample-vcfstats-$caller"
}
val
results
=
summary
.
getStatKeys
(
runId
,
Right
(
"shivavariantcalling"
)
,
Some
(
Right
(
moduleName
)
),
sampleId
.
map
(
Left
(
_
)
),
keyValues
=
statsPaths
)
val
results
=
summary
.
getStatKeys
(
runId
,
"shivavariantcalling"
.
right
,
Some
(
moduleName
.
right
),
sampleId
.
map
(
_
.
left
),
keyValues
=
statsPaths
)
for
(
sample
<-
samples
if
sampleId
.
isEmpty
||
sample
.
id
==
sampleId
.
get
)
{
tsvWriter
.
println
(
sample
.
name
+
"\t"
+
field
.
map
(
f
=>
results
(
s
"${sample.name};$f"
).
getOrElse
(
""
)).
mkString
(
"\t"
))
...
...
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