Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
biopet.biopet
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirrors
biopet.biopet
Commits
9e565c2f
Commit
9e565c2f
authored
10 years ago
by
Peter van 't Hof
Browse files
Options
Downloads
Patches
Plain Diff
Added useIndelRealigner and useBaseRecalibration option
parent
1f294e54
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/pipelines/gatk/GatkVariantcalling.scala
+20
-7
20 additions, 7 deletions
.../lumc/sasc/biopet/pipelines/gatk/GatkVariantcalling.scala
with
20 additions
and
7 deletions
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/pipelines/gatk/GatkVariantcalling.scala
+
20
−
7
View file @
9e565c2f
...
...
@@ -41,12 +41,20 @@ class GatkVariantcalling(val root: Configurable) extends QScript with BiopetQScr
var
useHaplotypecaller
:
Option
[
Boolean
]
=
config
(
"use_haplotypecaller"
,
default
=
true
)
var
useUnifiedGenotyper
:
Option
[
Boolean
]
=
config
(
"use_unifiedgenotyper"
,
default
=
false
)
var
useAllelesOption
:
Option
[
Boolean
]
=
config
(
"use_alleles_option"
,
default
=
false
)
var
useIndelRealigner
:
Boolean
=
config
(
"use_indel_realign"
,
default
=
true
)
var
useBaseRecalibration
:
Boolean
=
config
(
"use_base_recalibration"
,
default
=
true
)
def
init
()
{
if
(
outputName
==
null
&&
sampleID
!=
null
)
outputName
=
sampleID
else
if
(
outputName
==
null
)
outputName
=
"noname"
if
(
outputDir
==
null
)
throw
new
IllegalStateException
(
"Missing Output directory on gatk module"
)
else
if
(!
outputDir
.
endsWith
(
"/"
))
outputDir
+=
"/"
val
baseRecalibrator
=
new
BaseRecalibrator
(
this
)
if
(
useBaseRecalibration
&&
baseRecalibrator
.
knownSites
.
isEmpty
)
{
logger
.
warn
(
"No Known site found, skipping base recalibration"
)
useBaseRecalibration
=
false
}
}
private
def
doublePreProces
(
files
:
List
[
File
])
:
List
[
File
]
=
{
...
...
@@ -54,11 +62,10 @@ class GatkVariantcalling(val root: Configurable) extends QScript with BiopetQScr
if
(
files
.
isEmpty
)
throw
new
IllegalStateException
(
"Files can't be empty"
)
if
(!
doublePreProces
.
get
)
return
files
val
markDub
=
MarkDuplicates
(
this
,
files
,
new
File
(
outputDir
+
outputName
+
".dedup.bam"
))
if
(
dbsnp
!=
null
)
{
add
(
markDub
,
isIntermediate
=
true
)
add
(
markDub
,
isIntermediate
=
useIndelRealigner
)
if
(
useIndelRealigner
)
{
List
(
addIndelRealign
(
markDub
.
output
,
outputDir
,
isIntermediate
=
false
))
}
else
{
add
(
markDub
,
isIntermediate
=
true
)
List
(
markDub
.
output
)
}
}
...
...
@@ -67,8 +74,14 @@ class GatkVariantcalling(val root: Configurable) extends QScript with BiopetQScr
scriptOutput
.
bamFiles
=
if
(
preProcesBams
.
get
)
{
var
bamFiles
:
List
[
File
]
=
Nil
for
(
inputBam
<-
inputBams
)
{
var
bamFile
=
addIndelRealign
(
inputBam
,
outputDir
)
bamFiles
:+=
addBaseRecalibrator
(
bamFile
,
outputDir
,
isIntermediate
=
bamFiles
.
size
>
1
)
var
bamFile
=
inputBam
if
(
useIndelRealigner
)
{
bamFile
=
addIndelRealign
(
bamFile
,
outputDir
,
isIntermediate
=
useBaseRecalibration
)
}
if
(
useBaseRecalibration
)
{
bamFile
=
addBaseRecalibrator
(
bamFile
,
outputDir
,
isIntermediate
=
bamFiles
.
size
>
1
)
}
bamFiles
:+=
bamFile
}
doublePreProces
(
bamFiles
)
}
else
if
(
inputBams
.
size
>
1
&&
doublePreProces
.
get
)
{
...
...
@@ -188,7 +201,7 @@ class GatkVariantcalling(val root: Configurable) extends QScript with BiopetQScr
}
def
addBaseRecalibrator
(
inputBam
:
File
,
dir
:
String
,
isIntermediate
:
Boolean
=
false
)
:
File
=
{
val
baseRecalibrator
=
BaseRecalibrator
(
this
,
inputBam
,
swapExt
(
dir
,
inputBam
,
".bam"
,
".baserecal"
))
//with gatkArguments {
val
baseRecalibrator
=
BaseRecalibrator
(
this
,
inputBam
,
swapExt
(
dir
,
inputBam
,
".bam"
,
".baserecal"
))
if
(
baseRecalibrator
.
knownSites
.
isEmpty
)
{
logger
.
warn
(
"No Known site found, skipping base recalibration, file: "
+
inputBam
)
...
...
@@ -196,7 +209,7 @@ class GatkVariantcalling(val root: Configurable) extends QScript with BiopetQScr
}
add
(
baseRecalibrator
)
val
baseRecalibratorAfter
=
BaseRecalibrator
(
this
,
inputBam
,
swapExt
(
dir
,
inputBam
,
".bam"
,
".baserecal.after"
))
//with gatkArguments {
val
baseRecalibratorAfter
=
BaseRecalibrator
(
this
,
inputBam
,
swapExt
(
dir
,
inputBam
,
".bam"
,
".baserecal.after"
))
baseRecalibratorAfter
.
BQSR
=
baseRecalibrator
.
o
add
(
baseRecalibratorAfter
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment