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
c5773845
Commit
c5773845
authored
Apr 18, 2017
by
Peter van 't Hof
Browse files
Fixing some comments
parent
1b6fca2c
Changes
2
Hide whitespace changes
Inline
Side-by-side
shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaVariantcalling.scala
View file @
c5773845
...
...
@@ -54,7 +54,7 @@ class ShivaVariantcalling(val parent: Configurable) extends QScript
/** Executed before script */
def
init
()
:
Unit
=
{
if
(
inputBamsArg
.
nonEmpty
)
inputBams
=
BamUtils
.
sampleBamMap
(
inputBamsArg
)
if
(
genders
==
null
)
genders
=
{
if
(
Option
(
genders
).
isEmpty
)
genders
=
{
val
samples
:
Map
[
String
,
Any
]
=
config
(
"genders"
,
default
=
Map
())
samples
.
map
{
case
(
sampleName
,
gender
)
=>
...
...
shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/variantcallers/HaplotypeCallerGvcf.scala
View file @
c5773845
...
...
@@ -42,18 +42,25 @@ class HaplotypeCallerGvcf(val parent: Configurable) extends Variantcaller {
val
haploidRegionsMale
:
Option
[
File
]
=
config
(
"haploid_regions_male"
)
val
haploidRegionsFemale
:
Option
[
File
]
=
config
(
"haploid_regions_female"
)
lazy
val
refernceSize
=
referenceDict
.
getReferenceLength
lazy
val
refer
e
nceSize
=
referenceDict
.
getReferenceLength
lazy
val
fractionMale
:
Double
=
calculateFraction
(
haploidRegions
,
haploidRegionsMale
)
lazy
val
fractionFemale
:
Double
=
calculateFraction
(
haploidRegions
,
haploidRegionsFemale
)
lazy
val
fractionUnknown
:
Double
=
calculateFraction
(
haploidRegions
,
None
)
/**
* This method will calculate the fraction of the given bed files of the used reference
*
* @param file1 Bed file
* @param file2 Bed file
* @return Fraction
*/
def
calculateFraction
(
file1
:
Option
[
File
],
file2
:
Option
[
File
])
:
Double
=
{
(
file1
.
map
(
BedRecordList
.
fromFile
(
_
)),
file2
.
map
(
BedRecordList
.
fromFile
(
_
)))
match
{
case
(
Some
(
l
),
None
)
=>
l
.
length
.
toDouble
/
refernceSize
case
(
None
,
Some
(
l
))
=>
l
.
length
.
toDouble
/
refernceSize
case
(
Some
(
l
),
None
)
=>
l
.
length
.
toDouble
/
refer
e
nceSize
case
(
None
,
Some
(
l
))
=>
l
.
length
.
toDouble
/
refer
e
nceSize
case
(
Some
(
l1
),
Some
(
l2
))
=>
BedRecordList
.
fromList
(
l1
.
allRecords
++
l2
.
allRecords
).
combineOverlap
.
length
.
toDouble
/
refernceSize
BedRecordList
.
fromList
(
l1
.
allRecords
++
l2
.
allRecords
).
combineOverlap
.
length
.
toDouble
/
refer
e
nceSize
case
(
None
,
None
)
=>
0.0
}
}
...
...
@@ -65,6 +72,12 @@ class HaplotypeCallerGvcf(val parent: Configurable) extends Variantcaller {
"variant_index_parameter"
->
128000
)
)
override
def
init
()
:
Unit
=
{
super
.
init
()
if
(
genderAwareCalling
&&
haploidRegions
.
isEmpty
&&
haploidRegionsMale
.
isEmpty
&&
haploidRegionsFemale
.
isEmpty
)
logger
.
warn
(
"Gender aware variantcalling is enabled but no haploid bed files are given"
)
}
def
biopetScript
()
{
gVcfFiles
=
for
((
sample
,
inputBam
)
<-
inputBams
)
yield
{
if
(
genderAwareCalling
)
{
...
...
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