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
d6d834e6
Commit
d6d834e6
authored
Feb 26, 2015
by
Peter van 't Hof
Browse files
Fix multiple bugs
parent
7f15bd0b
Changes
1
Hide whitespace changes
Inline
Side-by-side
public/shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaVariantcallingTrait.scala
View file @
d6d834e6
...
...
@@ -4,6 +4,7 @@ import java.io.File
import
nl.lumc.sasc.biopet.core.
{
PipelineCommand
,
SampleLibraryTag
}
import
nl.lumc.sasc.biopet.core.summary.SummaryQScript
import
nl.lumc.sasc.biopet.extensions.gatk.CombineVariants
import
nl.lumc.sasc.biopet.tools.
{
VcfFilter
,
MpileupToVcf
}
import
nl.lumc.sasc.biopet.utils.ConfigUtils
import
org.broadinstitute.gatk.utils.commandline.Input
...
...
@@ -19,30 +20,45 @@ trait ShivaVariantcallingTrait extends SummaryQScript with SampleLibraryTag {
@Input
(
doc
=
"Bam files (should be deduped bams)"
,
shortName
=
"BAM"
,
required
=
true
)
var
inputBams
:
List
[
File
]
=
Nil
def
init
:
Unit
=
{
var
namePrefix
:
String
=
""
def
init
:
Unit
=
{
if
(!
namePrefix
.
isEmpty
&&
!
namePrefix
.
endsWith
(
"."
))
namePrefix
+=
"."
}
def
biopetScript
:
Unit
=
{
val
cv
=
new
CombineVariants
(
qscript
)
cv
.
outputFile
=
new
File
(
outputDir
,
namePrefix
+
".final.vcf.gz"
)
for
(
caller
<-
callers
)
{
caller
.
addJobs
()
cv
.
addInput
(
caller
.
outputFile
,
caller
.
name
)
}
add
(
cv
)
addSummaryJobs
}
def
callers
=
List
(
new
RawVcf
).
filter
(
_
.
use
)
trait
Variantcaller
{
val
name
:
String
def
outputDir
=
new
File
(
qscript
.
outputDir
,
name
)
val
defaultUse
:
Boolean
val
use
:
Boolean
=
config
(
"use_"
+
name
,
default
=
defaultUse
)
val
defaultPrio
:
Int
val
prio
:
Int
=
config
(
"prio_"
+
name
,
default
=
defaultPrio
)
def
addJobs
()
:
File
protected
val
defaultUse
:
Boolean
lazy
val
use
:
Boolean
=
config
(
"use_"
+
name
,
default
=
defaultUse
)
protected
val
defaultPrio
:
Int
lazy
val
prio
:
Int
=
config
(
"prio_"
+
name
,
default
=
defaultPrio
)
def
addJobs
()
def
outputFile
:
File
}
class
RawVcf
extends
Variantcaller
{
val
name
=
"raw"
val
defaultPrio
=
999
val
defaultUse
=
true
protected
val
defaultPrio
=
999
protected
val
defaultUse
=
true
def
outputFile
=
new
File
(
outputDir
,
namePrefix
+
"raw.vcf.gz"
)
def
addJobs
()
:
File
=
{
def
addJobs
()
{
val
rawFiles
=
inputBams
.
map
(
bamFile
=>
{
val
m2v
=
new
MpileupToVcf
(
qscript
)
m2v
.
inputBam
=
bamFile
...
...
@@ -63,8 +79,10 @@ trait ShivaVariantcallingTrait extends SummaryQScript with SampleLibraryTag {
vcfFilter
.
outputVcf
})
//TODO: Combine variants
null
val
cv
=
new
CombineVariants
(
qscript
)
cv
.
inputFiles
=
rawFiles
cv
.
outputFile
=
outputFile
add
(
cv
)
}
}
...
...
Write
Preview
Markdown
is supported
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