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
c081ba52
Commit
c081ba52
authored
Apr 16, 2015
by
Peter van 't Hof
Browse files
added target pcr metrics
parent
19c9f1fb
Changes
3
Hide whitespace changes
Inline
Side-by-side
public/bammetrics/src/main/scala/nl/lumc/sasc/biopet/pipelines/bammetrics/BamMetrics.scala
View file @
c081ba52
...
...
@@ -18,9 +18,9 @@ package nl.lumc.sasc.biopet.pipelines.bammetrics
import
nl.lumc.sasc.biopet.core.summary.SummaryQScript
import
nl.lumc.sasc.biopet.scripts.CoverageStats
import
org.broadinstitute.gatk.queue.QScript
import
nl.lumc.sasc.biopet.core.
{
SampleLibraryTag
,
BiopetQScript
,
PipelineCommand
}
import
nl.lumc.sasc.biopet.core.
{
SampleLibraryTag
,
PipelineCommand
}
import
java.io.File
import
nl.lumc.sasc.biopet.tools.
{
BedToInterval
,
BiopetFlagstat
}
import
nl.lumc.sasc.biopet.tools.BiopetFlagstat
import
nl.lumc.sasc.biopet.core.config.Configurable
import
nl.lumc.sasc.biopet.extensions.bedtools.
{
BedtoolsCoverage
,
BedtoolsIntersect
}
import
nl.lumc.sasc.biopet.extensions.picard._
...
...
@@ -103,7 +103,9 @@ class BamMetrics(val root: Configurable) extends QScript with SummaryQScript wit
List
(
ampIntervals
),
ampIntervals
::
roiIntervals
.
map
(
_
.
intervals
),
outputDir
)
add
(
chsMetrics
)
//TODO: target pcr metrics
val
pcrMetrics
=
CollectTargetedPcrMetrics
(
this
,
inputBam
,
ampIntervals
,
ampIntervals
::
roiIntervals
.
map
(
_
.
intervals
),
outputDir
)
add
(
pcrMetrics
)
Intervals
(
ampliconBedFile
,
ampIntervals
)
}
...
...
@@ -133,7 +135,7 @@ class BamMetrics(val root: Configurable) extends QScript with SummaryQScript wit
val
coverageFile
=
new
File
(
targetDir
,
inputBam
.
getName
.
stripSuffix
(
".bam"
)
+
".coverage"
)
//FIXME:should use piping
add
(
BedtoolsCoverage
(
this
,
inputBam
,
intervals
.
bed
,
coverageFile
,
true
),
true
)
add
(
BedtoolsCoverage
(
this
,
inputBam
,
intervals
.
bed
,
coverageFile
,
depth
=
true
),
isIntermediate
=
true
)
add
(
CoverageStats
(
this
,
coverageFile
,
targetDir
))
}
...
...
@@ -148,8 +150,8 @@ object BamMetrics extends PipelineCommand {
bamMetrics
.
inputBam
=
bamFile
bamMetrics
.
outputDir
=
outputDir
bamMetrics
.
init
bamMetrics
.
biopetScript
return
bamMetrics
bamMetrics
.
init
()
bamMetrics
.
biopetScript
()
bamMetrics
}
}
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/picard/CalculateHsMetrics.scala
View file @
c081ba52
...
...
@@ -61,13 +61,17 @@ class CalculateHsMetrics(val root: Configurable) extends Picard {
object
CalculateHsMetrics
{
/** Returns default CalculateHsMetrics */
def
apply
(
root
:
Configurable
,
input
:
File
,
baitIntervals
:
List
[
File
],
targetIntervals
:
List
[
File
],
outputDir
:
File
)
:
CalculateHsMetrics
=
{
def
apply
(
root
:
Configurable
,
input
:
File
,
baitIntervals
:
List
[
File
],
targetIntervals
:
List
[
File
],
outputDir
:
File
)
:
CalculateHsMetrics
=
{
val
calculateHsMetrics
=
new
CalculateHsMetrics
(
root
)
calculateHsMetrics
.
input
=
input
calculateHsMetrics
.
baitIntervals
=
baitIntervals
calculateHsMetrics
.
targetIntervals
=
targetIntervals
calculateHsMetrics
.
output
=
new
File
(
outputDir
,
input
.
getName
.
stripSuffix
(
".bam"
)
+
".
capm
etrics"
)
calculateHsMetrics
.
perTargetCoverage
=
new
File
(
outputDir
,
input
.
getName
.
stripSuffix
(
".bam"
)
+
".per_target_coverage"
)
return
calculateHsMetrics
calculateHsMetrics
.
output
=
new
File
(
outputDir
,
input
.
getName
.
stripSuffix
(
".bam"
)
+
".
HsM
etrics"
)
calculateHsMetrics
.
perTargetCoverage
=
new
File
(
outputDir
,
input
.
getName
.
stripSuffix
(
".bam"
)
+
".
HsMetrics.
per_target_coverage"
)
calculateHsMetrics
}
}
\ No newline at end of file
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/picard/CollectTargetedPcrMetrics.scala
0 → 100644
View file @
c081ba52
package
nl.lumc.sasc.biopet.extensions.picard
import
java.io.File
import
nl.lumc.sasc.biopet.core.config.Configurable
import
org.broadinstitute.gatk.utils.commandline.
{
Argument
,
Output
,
Input
}
/**
* Created by pjvan_thof on 4/16/15.
*/
class
CollectTargetedPcrMetrics
(
val
root
:
Configurable
)
extends
Picard
{
javaMainClass
=
new
picard
.
analysis
.
directed
.
CollectTargetedPcrMetrics
().
getClass
.
getName
@Input
(
doc
=
"The input SAM or BAM files to analyze. Must be coordinate sorted."
,
required
=
true
)
var
input
:
File
=
_
@Input
(
doc
=
"AMPLICON_INTERVALS"
,
required
=
true
)
var
ampliconIntervals
:
File
=
_
@Input
(
doc
=
"TARGET_INTERVALS"
,
required
=
true
)
var
targetIntervals
:
List
[
File
]
=
Nil
@Output
(
doc
=
"The output file to write statistics to"
,
required
=
true
)
var
output
:
File
=
_
@Output
(
doc
=
"PER_TARGET_COVERAGE"
,
required
=
false
)
var
perTargetCoverage
:
File
=
_
@Argument
(
doc
=
"METRIC_ACCUMULATION_LEVEL"
,
required
=
false
)
var
metricAccumulationLevel
:
List
[
String
]
=
config
(
"metricaccumulationlevel"
,
default
=
Nil
)
@Argument
(
doc
=
"CUSTOM_AMPLICON_SET_NAME"
,
required
=
false
)
var
customAmpliconSetName
:
Option
[
String
]
=
config
(
"custom_amplicon_set_name"
)
override
def
commandLine
=
super
.
commandLine
+
required
(
"INPUT="
,
input
,
spaceSeparated
=
false
)
+
required
(
"OUTPUT="
,
output
,
spaceSeparated
=
false
)
+
repeat
(
"METRIC_ACCUMULATION_LEVEL="
,
metricAccumulationLevel
,
spaceSeparated
=
false
)
+
required
(
"AMPLICON_INTERVALS="
,
ampliconIntervals
,
spaceSeparated
=
false
)
+
repeat
(
"TARGET_INTERVALS="
,
targetIntervals
,
spaceSeparated
=
false
)
+
optional
(
"PER_TARGET_COVERAGE="
,
perTargetCoverage
,
spaceSeparated
=
false
)
+
optional
(
"CUSTOM_AMPLICON_SET_NAME="
,
customAmpliconSetName
,
spaceSeparated
=
false
)
}
object
CollectTargetedPcrMetrics
{
def
apply
(
root
:
Configurable
,
input
:
File
,
ampliconIntervals
:
File
,
targetIntervals
:
List
[
File
],
outputDir
:
File
)
:
CollectTargetedPcrMetrics
=
{
val
pcrMetrics
=
new
CollectTargetedPcrMetrics
(
root
)
pcrMetrics
.
input
=
input
pcrMetrics
.
ampliconIntervals
=
ampliconIntervals
pcrMetrics
.
targetIntervals
=
targetIntervals
pcrMetrics
.
output
=
new
File
(
outputDir
,
input
.
getName
.
stripSuffix
(
".bam"
)
+
".TargetedPcrMetrics"
)
pcrMetrics
.
perTargetCoverage
=
new
File
(
outputDir
,
input
.
getName
.
stripSuffix
(
".bam"
)
+
".TargetedPcrMetrics.per_target_coverage"
)
pcrMetrics
}
}
\ No newline at end of file
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