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
f1599432
Commit
f1599432
authored
Oct 16, 2015
by
Sander van der Zeeuw
Browse files
added tabix to bcftools output
parent
d9f7d56f
Changes
2
Hide whitespace changes
Inline
Side-by-side
public/biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/Tabix.scala
View file @
f1599432
...
...
@@ -35,10 +35,9 @@ class Tabix(val root: Configurable) extends BiopetCommandLineFunction {
@Output
(
doc
=
"Output (for region query)"
,
required
=
false
)
var
outputQuery
:
File
=
null
@Output
(
doc
=
"Output (for indexing)"
,
required
=
false
)
// NOTE: it's a def since we can't change the index name ~ it's always input_name + .tbi
lazy
val
outputIndex
:
File
=
{
require
(
input
!=
null
,
"Input must be defined"
)
new
File
(
input
.
toString
+
".tbi"
)
def
outputIndex
:
File
=
{
require
(
input
!=
null
,
"Input should be defined"
)
new
File
(
input
.
getAbsolutePath
+
".tbi"
)
}
@Argument
(
doc
=
"Regions to query"
,
required
=
false
)
...
...
@@ -70,7 +69,8 @@ class Tabix(val root: Configurable) extends BiopetCommandLineFunction {
p
match
{
case
Some
(
fmt
)
=>
require
(
validFormats
.
contains
(
fmt
),
"-p flag must be one of "
+
validFormats
.
mkString
(
", "
))
case
None
=>
;
outputFiles
:+=
outputIndex
case
None
=>
}
}
...
...
@@ -96,3 +96,19 @@ class Tabix(val root: Configurable) extends BiopetCommandLineFunction {
else
baseCommand
}
}
object
Tabix
{
def
apply
(
root
:
Configurable
,
input
:
File
)
=
{
val
tabix
=
new
Tabix
(
root
)
tabix
.
input
=
input
tabix
.
p
=
tabix
.
input
.
getName
match
{
case
s
if
s
.
endsWith
(
".vcf.gz"
)
=>
Some
(
"vcf"
)
case
s
if
s
.
endsWith
(
".bed.gz"
)
=>
Some
(
"bed"
)
case
s
if
s
.
endsWith
(
".sam.gz"
)
=>
Some
(
"sam"
)
case
s
if
s
.
endsWith
(
".gff.gz"
)
=>
Some
(
"gff"
)
case
s
if
s
.
endsWith
(
".psltbl.gz"
)
=>
Some
(
"psltbl"
)
case
_
=>
throw
new
IllegalArgumentException
(
"Unknown file type"
)
}
tabix
}
}
\ No newline at end of file
public/shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaVariantcallingTrait.scala
View file @
f1599432
...
...
@@ -163,7 +163,6 @@ trait ShivaVariantcallingTrait extends SummaryQScript with SampleLibraryTag with
val
mp
=
new
SamtoolsMpileup
(
qscript
)
mp
.
input
=
inputBams
mp
.
u
=
true
//TODO: proper piping should be implemented
mp
.
reference
=
referenceFasta
()
val
bt
=
new
BcftoolsCall
(
qscript
)
...
...
@@ -172,6 +171,7 @@ trait ShivaVariantcallingTrait extends SummaryQScript with SampleLibraryTag with
bt
.
c
=
true
add
(
mp
|
bt
>
outputFile
)
add
(
Tabix
(
qscript
,
outputFile
))
}
}
...
...
@@ -197,6 +197,7 @@ trait ShivaVariantcallingTrait extends SummaryQScript with SampleLibraryTag with
bt
.
output
=
new
File
(
outputDir
,
inputBam
.
getName
+
".vcf.gz"
)
add
(
mp
|
bt
)
add
(
Tabix
(
qscript
,
bt
.
output
))
bt
.
output
}
...
...
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