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
d5ae90cf
Commit
d5ae90cf
authored
Sep 21, 2015
by
Sander Bollen
Browse files
Merge branch 'fix-report' into 'develop'
Fix report Fixes #202 See merge request !236
parents
f65704c6
884125eb
Changes
12
Hide whitespace changes
Inline
Side-by-side
protected/biopet-protected-package/src/main/scala/nl/lumc/sasc/biopet/BiopetExecutableProtected.scala
View file @
d5ae90cf
...
...
@@ -8,7 +8,7 @@ package nl.lumc.sasc.biopet
import
nl.lumc.sasc.biopet.utils.
{
BiopetExecutable
,
MainCommand
}
object
BiopetExecutableProtected
extends
BiopetExecutable
{
def
pipelines
:
List
[
MainCommand
]
=
BiopetExecutablePublic
.
pipelines
:::
List
(
def
pipelines
:
List
[
MainCommand
]
=
BiopetExecutablePublic
.
p
ublicP
ipelines
:::
List
(
nl
.
lumc
.
sasc
.
biopet
.
pipelines
.
gatk
.
Shiva
,
nl
.
lumc
.
sasc
.
biopet
.
pipelines
.
gatk
.
ShivaVariantcalling
,
nl
.
lumc
.
sasc
.
biopet
.
pipelines
.
gatk
.
Basty
)
...
...
public/bammetrics/src/main/resources/nl/lumc/sasc/biopet/pipelines/bammetrics/insertSize.ssp
View file @
d5ae90cf
...
...
@@ -42,7 +42,7 @@
#end
#if (showPlot)
#{ BammetricsReport.insertSizePlot(outputDir, "insertsize", summary, !sampleLevel, sampleId = sampleId) }#
#{ BammetricsReport.insertSizePlot(outputDir, "insertsize", summary, !sampleLevel, sampleId = sampleId
, libId = libId
) }#
<div class="panel-body">
<img src="insertsize.png" class="img-responsive" />
...
...
public/bammetrics/src/main/resources/nl/lumc/sasc/biopet/pipelines/bammetrics/wgsHistogram.ssp
View file @
d5ae90cf
...
...
@@ -36,7 +36,7 @@
#end
#if (showPlot)
#{ BammetricsReport.wgsHistogramPlot(outputDir, "wgs", summary, !sampleLevel, sampleId = sampleId) }#
#{ BammetricsReport.wgsHistogramPlot(outputDir, "wgs", summary, !sampleLevel, sampleId = sampleId
, libId = libId
) }#
<div class="panel-body">
<img src="wgs.png" class="img-responsive" />
...
...
public/bammetrics/src/main/scala/nl/lumc/sasc/biopet/pipelines/bammetrics/BamMetrics.scala
View file @
d5ae90cf
...
...
@@ -186,8 +186,13 @@ class BamMetrics(val root: Configurable) extends QScript with SummaryQScript wit
object
BamMetrics
extends
PipelineCommand
{
/** Make default implementation of BamMetrics and runs script already */
def
apply
(
root
:
Configurable
,
bamFile
:
File
,
outputDir
:
File
)
:
BamMetrics
=
{
def
apply
(
root
:
Configurable
,
bamFile
:
File
,
outputDir
:
File
,
sampleId
:
Option
[
String
]
=
None
,
libId
:
Option
[
String
]
=
None
)
:
BamMetrics
=
{
val
bamMetrics
=
new
BamMetrics
(
root
)
bamMetrics
.
sampleId
=
sampleId
bamMetrics
.
libId
=
libId
bamMetrics
.
inputBam
=
bamFile
bamMetrics
.
outputDir
=
outputDir
...
...
public/bammetrics/src/main/scala/nl/lumc/sasc/biopet/pipelines/bammetrics/BammetricsReport.scala
View file @
d5ae90cf
...
...
@@ -156,14 +156,15 @@ object BammetricsReport extends ReportBuilder {
prefix
:
String
,
summary
:
Summary
,
libraryLevel
:
Boolean
=
false
,
sampleId
:
Option
[
String
]
=
None
)
:
Unit
=
{
sampleId
:
Option
[
String
]
=
None
,
libId
:
Option
[
String
]
=
None
)
:
Unit
=
{
val
tsvFile
=
new
File
(
outputDir
,
prefix
+
".tsv"
)
val
pngFile
=
new
File
(
outputDir
,
prefix
+
".png"
)
val
tsvWriter
=
new
PrintWriter
(
tsvFile
)
if
(
libraryLevel
)
{
tsvWriter
.
println
((
for
(
sample
<-
summary
.
samples
if
sampleId
.
isEmpty
||
sampleId
.
get
==
sample
;
lib
<-
summary
.
libraries
(
sample
)
lib
<-
summary
.
libraries
(
sample
)
if
libId
.
isEmpty
||
libId
.
get
==
lib
)
yield
s
"$sample-$lib"
)
.
mkString
(
"library\t"
,
"\t"
,
""
))
}
else
{
...
...
@@ -198,7 +199,7 @@ object BammetricsReport extends ReportBuilder {
if
(
libraryLevel
)
{
for
(
sample
<-
summary
.
samples
if
sampleId
.
isEmpty
||
sampleId
.
get
==
sample
;
lib
<-
summary
.
libraries
(
sample
)
lib
<-
summary
.
libraries
(
sample
)
if
libId
.
isEmpty
||
libId
.
get
==
lib
)
fill
(
sample
,
Some
(
lib
))
}
else
if
(
sampleId
.
isDefined
)
fill
(
sampleId
.
get
,
None
)
else
summary
.
samples
.
foreach
(
fill
(
_
,
None
))
...
...
@@ -208,7 +209,7 @@ object BammetricsReport extends ReportBuilder {
if
(
libraryLevel
)
{
for
(
sample
<-
summary
.
samples
if
sampleId
.
isEmpty
||
sampleId
.
get
==
sample
;
lib
<-
summary
.
libraries
(
sample
)
lib
<-
summary
.
libraries
(
sample
)
if
libId
.
isEmpty
||
libId
.
get
==
lib
)
tsvWriter
.
print
(
"\t"
+
counts
.
getOrElse
(
s
"$sample-$lib"
,
"0"
))
}
else
{
for
(
sample
<-
summary
.
samples
if
sampleId
.
isEmpty
||
sampleId
.
get
==
sample
)
{
...
...
@@ -243,14 +244,15 @@ object BammetricsReport extends ReportBuilder {
prefix
:
String
,
summary
:
Summary
,
libraryLevel
:
Boolean
=
false
,
sampleId
:
Option
[
String
]
=
None
)
:
Unit
=
{
sampleId
:
Option
[
String
]
=
None
,
libId
:
Option
[
String
]
=
None
)
:
Unit
=
{
val
tsvFile
=
new
File
(
outputDir
,
prefix
+
".tsv"
)
val
pngFile
=
new
File
(
outputDir
,
prefix
+
".png"
)
val
tsvWriter
=
new
PrintWriter
(
tsvFile
)
if
(
libraryLevel
)
{
tsvWriter
.
println
((
for
(
sample
<-
summary
.
samples
if
sampleId
.
isEmpty
||
sampleId
.
get
==
sample
;
lib
<-
summary
.
libraries
(
sample
)
lib
<-
summary
.
libraries
(
sample
)
if
libId
.
isEmpty
||
libId
.
get
==
lib
)
yield
s
"$sample-$lib"
)
.
mkString
(
"library\t"
,
"\t"
,
""
))
}
else
{
...
...
@@ -285,7 +287,7 @@ object BammetricsReport extends ReportBuilder {
if
(
libraryLevel
)
{
for
(
sample
<-
summary
.
samples
if
sampleId
.
isEmpty
||
sampleId
.
get
==
sample
;
lib
<-
summary
.
libraries
(
sample
)
lib
<-
summary
.
libraries
(
sample
)
if
libId
.
isEmpty
||
libId
.
get
==
lib
)
fill
(
sample
,
Some
(
lib
))
}
else
if
(
sampleId
.
isDefined
)
fill
(
sampleId
.
get
,
None
)
else
summary
.
samples
.
foreach
(
fill
(
_
,
None
))
...
...
@@ -295,8 +297,10 @@ object BammetricsReport extends ReportBuilder {
if
(
libraryLevel
)
{
for
(
sample
<-
summary
.
samples
if
sampleId
.
isEmpty
||
sampleId
.
get
==
sample
;
lib
<-
summary
.
libraries
(
sample
)
)
tsvWriter
.
print
(
"\t"
+
counts
.
getOrElse
(
s
"$sample-$lib"
,
"0"
))
lib
<-
summary
.
libraries
(
sample
)
if
libId
.
isEmpty
||
libId
.
get
==
lib
)
{
tsvWriter
.
print
(
"\t"
+
counts
.
getOrElse
(
s
"$sample-$lib"
,
"0"
))
}
}
else
{
for
(
sample
<-
summary
.
samples
if
sampleId
.
isEmpty
||
sampleId
.
get
==
sample
)
{
tsvWriter
.
print
(
"\t"
+
counts
.
getOrElse
(
sample
,
"0"
))
...
...
public/biopet-utils/src/main/scala/nl/lumc/sasc/biopet/utils/rscript/LinePlot.scala
View file @
d5ae90cf
...
...
@@ -48,5 +48,5 @@ class LinePlot(val root: Configurable) extends Rscript {
ylabel
.
map
(
Seq
(
"--ylabel"
,
_
)).
getOrElse
(
Seq
())
++
llabel
.
map
(
Seq
(
"--llabel"
,
_
)).
getOrElse
(
Seq
())
++
title
.
map
(
Seq
(
"--title"
,
_
)).
getOrElse
(
Seq
())
++
(
if
(
removeZero
)
Seq
(
"--removeZero"
)
else
Seq
())
(
if
(
removeZero
)
Seq
(
"--removeZero"
,
"true"
)
else
Seq
())
}
public/carp/src/main/scala/nl/lumc/sasc/biopet/pipelines/carp/Carp.scala
View file @
d5ae90cf
...
...
@@ -107,7 +107,7 @@ class Carp(val root: Configurable) extends QScript with MultiSampleQScript with
add
(
merge
)
}
val
bamMetrics
=
BamMetrics
(
qscript
,
bamFile
,
new
File
(
sampleDir
,
"metrics"
))
val
bamMetrics
=
BamMetrics
(
qscript
,
bamFile
,
new
File
(
sampleDir
,
"metrics"
)
,
sampleId
=
Some
(
sampleId
)
)
addAll
(
bamMetrics
.
functions
)
addSummaryQScript
(
bamMetrics
)
addAll
(
Bam2Wig
(
qscript
,
bamFile
).
functions
)
...
...
public/carp/src/main/scala/nl/lumc/sasc/biopet/pipelines/carp/CarpReport.scala
View file @
d5ae90cf
...
...
@@ -76,7 +76,7 @@ object CarpReport extends MultisampleReportBuilder {
),
List
(
"Alignment"
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/bammetrics/alignmentSummary.ssp"
,
if
(
summary
.
libraries
(
sampleId
).
size
>
1
)
Map
(
"showPlot"
->
true
)
else
Map
()),
"
Preprocessing
"
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/bammetrics/alignmentSummary.ssp"
,
Map
(
"sampleLevel"
->
true
)),
"
Merged
"
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/bammetrics/alignmentSummary.ssp"
,
Map
(
"sampleLevel"
->
true
)),
"QC reads"
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepReadSummary.ssp"
),
"QC bases"
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepBaseSummary.ssp"
)
),
args
)
...
...
public/flexiprep/src/main/resources/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepBaseSummary.ssp
View file @
d5ae90cf
...
...
@@ -129,7 +129,7 @@
#if (read == "R2") </tr><tr> #end
#{
val beforeTotal = summary.getLibraryValue(sample, libId, "flexiprep", "stats", "seqstat_" + read, "bases", "num_total").getOrElse(0).toString.toLong
val afterTotal = summary.getLibraryValue(sample, libId, "flexiprep", "stats", "seqstat_" + read + "_
after
", "bases", "num_total").getOrElse(0).toString.toLong
val afterTotal = summary.getLibraryValue(sample, libId, "flexiprep", "stats", "seqstat_" + read + "_
qc
", "bases", "num_total").getOrElse(0).toString.toLong
}#
<td>${read}</td>
<td>${beforeTotal}</td>
...
...
public/flexiprep/src/main/resources/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepReadSummary.ssp
View file @
d5ae90cf
...
...
@@ -133,7 +133,7 @@
#if (read == "R2") </tr><tr> #end
#{
val beforeTotal = summary.getLibraryValue(sample, libId, "flexiprep", "stats", "seqstat_" + read, "reads", "num_total")
val afterTotal = summary.getLibraryValue(sample, libId, "flexiprep", "stats", "seqstat_" + read + "_
after
", "reads", "num_total")
val afterTotal = summary.getLibraryValue(sample, libId, "flexiprep", "stats", "seqstat_" + read + "_
qc
", "reads", "num_total")
val clippingDiscardedToShort = summary.getLibraryValue(sample, libId, "flexiprep", "stats", "clipping_" + read, "num_reads_discarded_too_short").getOrElse(0).toString.toLong
val clippingDiscardedToLong = summary.getLibraryValue(sample, libId, "flexiprep", "stats", "clipping_" + read, "num_reads_discarded_too_long").getOrElse(0).toString.toLong
val trimmingDiscarded = summary.getLibraryValue(sample, libId, "flexiprep", "stats", "trimming", "num_reads_discarded_" + read).getOrElse(0).toString.toLong
...
...
public/flexiprep/src/main/scala/nl/lumc/sasc/biopet/pipelines/flexiprep/Flexiprep.scala
View file @
d5ae90cf
...
...
@@ -218,6 +218,7 @@ class Flexiprep(val root: Configurable) extends QScript with SummaryQScript with
fqSync
.
outputFastq1
=
swapExt
(
outDir
,
R1
,
R1_ext
,
".sync"
+
R1_ext
)
fqSync
.
outputFastq2
=
swapExt
(
outDir
,
R2
.
get
,
R2_ext
,
".sync"
+
R2_ext
)
fqSync
.
outputStats
=
swapExt
(
outDir
,
R1
,
R1_ext
,
".sync.stats"
)
fqSync
.
isIntermediate
=
true
fqSync
.
deps
:::=
deps
add
(
fqSync
)
addSummarizable
(
fqSync
,
"fastq_sync"
)
...
...
public/flexiprep/src/main/scala/nl/lumc/sasc/biopet/pipelines/flexiprep/FlexiprepReport.scala
View file @
d5ae90cf
...
...
@@ -95,7 +95,7 @@ object FlexiprepReport extends ReportBuilder {
def
getLine
(
summary
:
Summary
,
sample
:
String
,
lib
:
String
)
:
String
=
{
val
beforeTotal
=
new
SummaryValue
(
List
(
"flexiprep"
,
"stats"
,
"seqstat_"
+
read
,
"reads"
,
"num_total"
),
summary
,
Some
(
sample
),
Some
(
lib
)).
value
.
getOrElse
(
0
).
toString
.
toLong
val
afterTotal
=
new
SummaryValue
(
List
(
"flexiprep"
,
"stats"
,
"seqstat_"
+
read
+
"_
after
"
,
"reads"
,
"num_total"
),
val
afterTotal
=
new
SummaryValue
(
List
(
"flexiprep"
,
"stats"
,
"seqstat_"
+
read
+
"_
qc
"
,
"reads"
,
"num_total"
),
summary
,
Some
(
sample
),
Some
(
lib
)).
value
.
getOrElse
(
0
).
toString
.
toLong
val
clippingDiscardedToShort
=
new
SummaryValue
(
List
(
"flexiprep"
,
"stats"
,
"clipping_"
+
read
,
"num_reads_discarded_too_short"
),
summary
,
Some
(
sample
),
Some
(
lib
)).
value
.
getOrElse
(
0
).
toString
.
toLong
...
...
@@ -152,7 +152,7 @@ object FlexiprepReport extends ReportBuilder {
def
getLine
(
summary
:
Summary
,
sample
:
String
,
lib
:
String
)
:
String
=
{
val
beforeTotal
=
new
SummaryValue
(
List
(
"flexiprep"
,
"stats"
,
"seqstat_"
+
read
,
"bases"
,
"num_total"
),
summary
,
Some
(
sample
),
Some
(
lib
)).
value
.
getOrElse
(
0
).
toString
.
toLong
val
afterTotal
=
new
SummaryValue
(
List
(
"flexiprep"
,
"stats"
,
"seqstat_"
+
read
+
"_
after
"
,
"bases"
,
"num_total"
),
val
afterTotal
=
new
SummaryValue
(
List
(
"flexiprep"
,
"stats"
,
"seqstat_"
+
read
+
"_
qc
"
,
"bases"
,
"num_total"
),
summary
,
Some
(
sample
),
Some
(
lib
)).
value
.
getOrElse
(
0
).
toString
.
toLong
val
sb
=
new
StringBuffer
()
...
...
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