Skip to content
GitLab
Menu
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
f418cc1a
Commit
f418cc1a
authored
Nov 19, 2016
by
Peter van 't Hof
Browse files
Moving flagstats from bamstats to summary
parent
a2d728c3
Changes
2
Show whitespace changes
Inline
Side-by-side
bammetrics/src/main/scala/nl/lumc/sasc/biopet/pipelines/bammetrics/BamMetrics.scala
View file @
f418cc1a
...
...
@@ -82,10 +82,6 @@ class BamMetrics(val root: Configurable) extends QScript
def
biopetScript
()
{
add
(
SamtoolsFlagstat
(
this
,
inputBam
,
outputDir
))
val
biopetFlagstat
=
BiopetFlagstat
(
this
,
inputBam
,
outputDir
)
add
(
biopetFlagstat
)
addSummarizable
(
biopetFlagstat
,
"biopet_flagstat"
)
val
bamStats
=
new
BamStats
(
this
)
bamStats
.
bamFile
=
inputBam
bamStats
.
outputDir
=
new
File
(
outputDir
,
"bamstats"
)
...
...
biopet-tools-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/tools/BamStats.scala
View file @
f418cc1a
...
...
@@ -2,14 +2,18 @@ package nl.lumc.sasc.biopet.extensions.tools
import
java.io.File
import
nl.lumc.sasc.biopet.core.summary.Summarizable
import
nl.lumc.sasc.biopet.core.
{
Reference
,
ToolCommandFunction
}
import
nl.lumc.sasc.biopet.utils.ConfigUtils
import
nl.lumc.sasc.biopet.utils.config.Configurable
import
org.broadinstitute.gatk.utils.commandline.Input
import
scala.collection.JavaConversions._
/**
* Created by pjvanthof on 18/11/2016.
*/
class
BamStats
(
val
root
:
Configurable
)
extends
ToolCommandFunction
with
Reference
{
class
BamStats
(
val
root
:
Configurable
)
extends
ToolCommandFunction
with
Reference
with
Summarizable
{
def
toolObject
=
nl
.
lumc
.
sasc
.
biopet
.
tools
.
bamstats
.
BamStats
@Input
(
required
=
true
)
...
...
@@ -27,6 +31,13 @@ class BamStats(val root: Configurable) extends ToolCommandFunction with Referenc
override
def
defaultCoreMemory
=
5.0
override
def
dictRequired
=
true
def
flagstatSummaryFile
(
implicit
contig
:
Option
[
String
]
=
None
)
:
File
=
{
contig
match
{
case
Some
(
contig
)
=>
new
File
(
outputDir
,
"contigs"
+
File
.
separator
+
contig
+
File
.
separator
+
"flagstats.summary.json"
)
case
_
=>
new
File
(
outputDir
,
"flagstats.summary.json"
)
}
}
override
def
beforeGraph
()
{
super
.
beforeGraph
()
jobOutputFile
=
new
File
(
outputDir
,
".bamstats.out"
)
...
...
@@ -41,4 +52,13 @@ class BamStats(val root: Configurable) extends ToolCommandFunction with Referenc
optional
(
"--binSize"
,
binSize
)
+
optional
(
"--threadBinSize"
,
threadBinSize
)
def
summaryFiles
:
Map
[
String
,
File
]
=
Map
()
def
summaryStats
:
Map
[
String
,
Any
]
=
Map
(
"flagstats"
->
ConfigUtils
.
fileToConfigMap
(
flagstatSummaryFile
),
"flagstats_per_contig"
->
referenceDict
.
getSequences
.
map
{
c
=>
c
.
getSequenceName
->
ConfigUtils
.
fileToConfigMap
(
flagstatSummaryFile
(
Some
(
c
.
getSequenceName
)))
}.
toMap
)
}
Write
Preview
Supports
Markdown
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