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
b60bb0f4
Commit
b60bb0f4
authored
Jul 10, 2017
by
Peter van 't Hof
Browse files
Removing method
parent
43719a15
Changes
1
Hide whitespace changes
Inline
Side-by-side
shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/variantcallers/somatic/MuTect2.scala
View file @
b60bb0f4
...
...
@@ -2,7 +2,7 @@ package nl.lumc.sasc.biopet.pipelines.shiva.variantcallers.somatic
import
nl.lumc.sasc.biopet.extensions.gatk.BqsrGather
import
nl.lumc.sasc.biopet.extensions.
{
Awk
,
Tabix
,
gatk
}
import
nl.lumc.sasc.biopet.utils.config.Configurable
import
nl.lumc.sasc.biopet.utils.config.
{
ConfigValue
,
Configurable
}
class
MuTect2
(
val
parent
:
Configurable
)
extends
SomaticVariantCaller
{
...
...
@@ -12,50 +12,53 @@ class MuTect2(val parent: Configurable) extends SomaticVariantCaller {
// currently not relevant, at the moment only one somatic variant caller exists in Biopet
// and results from this won't be merged together with the results from other methods
def
defaultPrio
=
-
1
def
defaultPrio
:
Int
=
-
1
val
runConEst
=
config
(
"run_contest"
,
default
=
false
)
lazy
val
runConEst
:
Boolean
=
config
(
"run_contest"
,
default
=
false
)
def
biopetScript
()
:
Unit
=
{
for
(
pair
<-
tnPairs
)
addJobsForPair
(
pair
,
new
File
(
outputDir
,
s
"${pair.tumorSample}-${pair.normalSample}.$name.vcf.gz"
))
}
val
outputFiles
=
for
(
pair
<-
tnPairs
)
yield
{
def
addJobsForPair
(
pair
:
TumorNormalPair
,
outFile
:
File
)
:
Unit
=
{
val
muTect2
=
{
gatk
.
MuTect2
(
this
,
inputBams
(
pair
.
tumorSample
),
inputBams
(
pair
.
normalSample
),
outFile
)
}
val
outputFile
=
new
File
(
outputDir
,
s
"${pair.tumorSample}-${pair.normalSample}.$name.vcf.gz"
)
if
(
runConEst
)
{
val
namePrefix
=
outFile
.
getAbsolutePath
.
stripSuffix
(
".vcf.gz"
)
val
contEstOutput
:
File
=
new
File
(
s
"$namePrefix.contamination.txt"
)
val
contEst
=
gatk
.
ContEst
(
this
,
inputBams
(
pair
.
tumorSample
),
inputBams
(
pair
.
normalSample
),
contEstOutput
)
add
(
contEst
)
val
contaminationPerSample
:
File
=
new
File
(
s
"$namePrefix.contamination.short.txt"
)
val
awk
:
Awk
=
Awk
(
this
,
"BEGIN{OFS=\"\\t\"}{if($1 != \"name\") print $1,$4;}"
)
awk
.
input
=
contEstOutput
add
(
awk
>
contaminationPerSample
)
muTect2
.
contaminationFile
=
Some
(
contaminationPerSample
)
}
val
muTect2
=
{
gatk
.
MuTect2
(
this
,
inputBams
(
pair
.
tumorSample
),
inputBams
(
pair
.
normalSample
),
outputFile
)
}
if
(
inputBqsrFiles
.
contains
(
pair
.
tumorSample
)
&&
inputBqsrFiles
.
contains
(
pair
.
normalSample
))
{
val
gather
=
new
BqsrGather
()
gather
.
inputBqsrFiles
=
List
(
inputBqsrFiles
(
pair
.
tumorSample
),
inputBqsrFiles
(
pair
.
normalSample
))
gather
.
outputBqsrFile
=
new
File
(
swapExt
(
outFile
,
"vcf.gz"
,
"bqsr.merge"
))
add
(
gather
)
if
(
runConEst
)
{
val
namePrefix
=
outputFile
.
getAbsolutePath
.
stripSuffix
(
".vcf.gz"
)
val
contEstOutput
:
File
=
new
File
(
s
"$namePrefix.contamination.txt"
)
val
contEst
=
gatk
.
ContEst
(
this
,
inputBams
(
pair
.
tumorSample
),
inputBams
(
pair
.
normalSample
),
contEstOutput
)
add
(
contEst
)
muTect2
.
BQSR
=
Some
(
gather
.
outputBqsrFile
)
}
val
contaminationPerSample
:
File
=
new
File
(
s
"$namePrefix.contamination.short.txt"
)
val
awk
:
Awk
=
Awk
(
this
,
"BEGIN{OFS=\"\\t\"}{if($1 != \"name\") print $1,$4;}"
)
awk
.
input
=
contEstOutput
add
(
awk
>
contaminationPerSample
)
muTect2
.
contaminationFile
=
Some
(
contaminationPerSample
)
}
add
(
muTect2
)
add
(
Tabix
(
this
,
outFile
))
if
(
inputBqsrFiles
.
contains
(
pair
.
tumorSample
)
&&
inputBqsrFiles
.
contains
(
pair
.
normalSample
))
{
val
gather
=
new
BqsrGather
()
gather
.
inputBqsrFiles
=
List
(
inputBqsrFiles
(
pair
.
tumorSample
),
inputBqsrFiles
(
pair
.
normalSample
))
gather
.
outputBqsrFile
=
new
File
(
swapExt
(
outputFile
,
"vcf.gz"
,
"bqsr.merge"
))
add
(
gather
)
muTect2
.
BQSR
=
Some
(
gather
.
outputBqsrFile
)
}
// TODO: Add name change
add
(
muTect2
)
add
(
Tabix
(
this
,
outputFile
))
outputFile
}
}
}
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