Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
biopet.biopet
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
Mirrors
biopet.biopet
Commits
af15286b
Commit
af15286b
authored
May 01, 2017
by
Peter van 't Hof
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing wgs plot for newer version of picard
parent
c093bace
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
39 deletions
+64
-39
bammetrics/src/main/scala/nl/lumc/sasc/biopet/pipelines/bammetrics/BammetricsReport.scala
...c/sasc/biopet/pipelines/bammetrics/BammetricsReport.scala
+64
-39
No files found.
bammetrics/src/main/scala/nl/lumc/sasc/biopet/pipelines/bammetrics/BammetricsReport.scala
View file @
af15286b
...
...
@@ -226,6 +226,24 @@ object BammetricsReport extends ReportBuilder {
plot
.
runLocal
()
}
/**
* This is a generic method to create plots
* @param outputDir Outputdir of the plot
* @param prefix Files will start with this name
* @param summary Summary where the data is
* @param libraryLevel If enabled the plots will show data per library
* @param sampleId If set only this sample is shown
* @param libraryId If set onlt this library is shown
* @param statsPaths Paths in summary where the tables can be found
* @param yKeyList Keys to search from, first has prio over second one
* @param xKeyList Keys to search from, first has prio over second one
* @param pipeline Query for the pipeline
* @param module Query for the module
* @param xlabel X label shown on the plot
* @param ylabel Y label shown on the plot
* @param title Title of the plot
* @param removeZero
*/
def
writePlotFromSummary
(
outputDir
:
File
,
prefix
:
String
,
summary
:
SummaryDb
,
...
...
@@ -233,8 +251,8 @@ object BammetricsReport extends ReportBuilder {
sampleId
:
Option
[
Int
]
=
None
,
libraryId
:
Option
[
Int
]
=
None
,
statsPaths
:
Map
[
String
,
List
[
String
]],
yKey
:
String
,
xKey
:
String
,
yKey
List
:
List
[
String
]
,
xKey
List
:
List
[
String
]
,
pipeline
:
PipelineQuery
,
module
:
ModuleQuery
,
xlabel
:
Option
[
String
]
=
None
,
...
...
@@ -266,13 +284,15 @@ object BammetricsReport extends ReportBuilder {
.
getOrElse
(
throw
new
IllegalStateException
(
"Sample must be there"
))
val
libraryName
=
library
.
flatMap
(
l
=>
Await
.
result
(
summary
.
getLibraryName
(
l
),
Duration
.
Inf
))
val
yKey
=
yKeyList
.
find
(
x
=>
map
.
contains
(
x
)
&&
map
(
x
).
isDefined
).
get
val
xKey
=
xKeyList
.
find
(
x
=>
map
.
contains
(
x
)
&&
map
(
x
).
isDefined
).
get
Map
(
yKey
->
map
(
yKey
).
getOrElse
(
Array
()),
yKey
List
.
head
->
map
(
yKey
).
getOrElse
(
Array
()),
(
sampleName
+
libraryName
.
map
(
"-"
+
_
).
getOrElse
(
""
))
->
map
(
xKey
).
getOrElse
(
Array
())
)
}.
toArray
writeTableToTsv
(
tsvFile
,
mergeTables
(
tables
,
yKey
),
yKey
)
writeTableToTsv
(
tsvFile
,
mergeTables
(
tables
,
yKey
List
.
head
),
yKeyList
.
head
)
LinePlot
(
tsvFile
,
pngFile
,
...
...
@@ -311,8 +331,8 @@ object BammetricsReport extends ReportBuilder {
sampleId
,
libraryId
,
statsPaths
,
"insert_size"
,
"count"
,
"insert_size"
::
Nil
,
"count"
::
Nil
,
"bammetrics"
,
"CollectInsertSizeMetrics"
,
"Insert size"
,
...
...
@@ -340,8 +360,8 @@ object BammetricsReport extends ReportBuilder {
sampleId
,
libraryId
,
statsPaths
,
"mapping_quality"
,
"count"
,
"mapping_quality"
::
Nil
,
"count"
::
Nil
,
"bammetrics"
,
"bamstats"
,
"Mapping quality"
,
...
...
@@ -361,20 +381,22 @@ object BammetricsReport extends ReportBuilder {
"count"
->
List
(
"clipping"
,
"histogram"
,
"counts"
)
)
writePlotFromSummary
(
outputDir
,
prefix
,
summary
,
libraryLevel
,
sampleId
,
libraryId
,
statsPaths
,
"clipping"
,
"count"
,
"bammetrics"
,
"bamstats"
,
"Clipping"
,
"Reads"
,
"Clipping"
)
writePlotFromSummary
(
outputDir
,
prefix
,
summary
,
libraryLevel
,
sampleId
,
libraryId
,
statsPaths
,
"clipping"
::
Nil
,
"count"
::
Nil
,
"bammetrics"
,
"bamstats"
,
"Clipping"
,
"Reads"
,
"Clipping"
)
}
/**
...
...
@@ -394,23 +416,26 @@ object BammetricsReport extends ReportBuilder {
libraryId
:
Option
[
Int
]
=
None
)
:
Unit
=
{
val
statsPaths
=
Map
(
"coverage"
->
List
(
"histogram"
,
"coverage"
),
"count"
->
List
(
"histogram"
,
"count"
)
"count"
->
List
(
"histogram"
,
"count"
),
"high_quality_coverage_count"
->
List
(
"histogram"
,
"high_quality_coverage_count"
)
)
writePlotFromSummary
(
outputDir
,
prefix
,
summary
,
libraryLevel
,
sampleId
,
libraryId
,
statsPaths
,
"coverage"
,
"count"
,
"bammetrics"
,
"wgs"
,
"Coverage"
,
"Bases"
,
"Whole genome coverage"
)
writePlotFromSummary
(
outputDir
,
prefix
,
summary
,
libraryLevel
,
sampleId
,
libraryId
,
statsPaths
,
"coverage"
::
Nil
,
"count"
::
"high_quality_coverage_count"
::
Nil
,
"bammetrics"
,
"wgs"
,
"Coverage"
,
"Bases"
,
"Whole genome coverage"
)
}
/**
...
...
@@ -441,8 +466,8 @@ object BammetricsReport extends ReportBuilder {
sampleId
,
libraryId
,
statsPaths
,
"position"
,
"count"
,
"position"
::
Nil
,
"count"
::
Nil
,
"bammetrics"
,
"rna"
,
"Relative position"
,
...
...
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