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
e972a0d1
Commit
e972a0d1
authored
Mar 02, 2016
by
Peter van 't Hof
Browse files
Merge branch 'fix-278' into 'develop'
Added fix mpileup for bcftools fixes #278 See merge request !326
parents
0b8f1ada
fdfcf218
Changes
7
Hide whitespace changes
Inline
Side-by-side
public/biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/extensions/PythonCommandLineFunction.scala
View file @
e972a0d1
...
...
@@ -24,7 +24,7 @@ trait PythonCommandLineFunction extends BiopetCommandLineFunction {
@Input
(
doc
=
"Python script"
,
required
=
false
)
var
python_script
:
File
=
_
executable
=
config
(
"exe"
,
default
=
"python"
,
submodule
=
"python"
)
executable
=
config
(
"exe"
,
default
=
"python"
,
submodule
=
"python"
,
freeVar
=
false
)
protected
var
python_script_name
:
String
=
_
...
...
public/biopet-extensions/src/main/resources/nl/lumc/sasc/biopet/extensions/samtools/fix_iupac_mpileup.py
0 → 100644
View file @
e972a0d1
#!/usr/bin/env python
#
# Biopet is built on top of GATK Queue for building bioinformatic
# pipelines. It is mainly intended to support LUMC SHARK cluster which is running
# SGE. But other types of HPC that are supported by GATK Queue (such as PBS)
# should also be able to execute Biopet tools and pipelines.
#
# Copyright 2014 Sequencing Analysis Support Core - Leiden University Medical Center
#
# Contact us at: sasc@lumc.nl
#
# A dual licensing mode is applied. The source code within this project that are
# not part of GATK Queue is freely available for non-commercial use under an AGPL
# license; For commercial users or users who do not want to follow the AGPL
# license, please contact us to obtain a separate license.
#
from
__future__
import
print_function
__author__
=
"Peter van 't Hof"
import
sys
import
re
upacPatern
=
re
.
compile
(
r
'[RYKMSWBDHV]'
)
if
__name__
==
"__main__"
:
for
line
in
sys
.
stdin
:
l
=
line
.
strip
().
split
(
"
\t
"
)
if
len
(
l
)
>=
3
:
l
[
3
]
=
upacPatern
.
sub
(
"N"
,
l
[
3
])
print
(
"
\t
"
.
join
(
map
(
str
,
l
)))
public/biopet-extensions/src/main/resources/nl/lumc/sasc/biopet/extensions/varscan/fix_mpileup.py
View file @
e972a0d1
...
...
@@ -33,7 +33,9 @@ if __name__ == "__main__":
"""
for
line
in
sys
.
stdin
:
l
=
line
.
strip
().
split
(
"
\t
"
)
if
l
[
3
]
==
"0"
:
l
[
2
]
=
upacPatern
.
sub
(
"N"
,
l
[
2
])
if
len
(
l
)
<
4
or
l
[
3
]
==
"0"
:
# no alignment to this position
print
(
"
\t
"
.
join
(
map
(
str
,
l
)))
continue
...
...
@@ -49,5 +51,4 @@ if __name__ == "__main__":
if
new_size
==
0
:
l
[
5
]
=
""
l
[
2
]
=
upacPatern
.
sub
(
"N"
,
l
[
2
])
print
(
"
\t
"
.
join
(
map
(
str
,
l
)))
public/biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/samtools/FixMpileup.scala
0 → 100644
View file @
e972a0d1
package
nl.lumc.sasc.biopet.extensions.samtools
import
nl.lumc.sasc.biopet.core.extensions.PythonCommandLineFunction
import
nl.lumc.sasc.biopet.utils.config.Configurable
/**
* Created by sajvanderzeeuw on 19-1-16.
*/
class
FixMpileup
(
val
root
:
Configurable
)
extends
PythonCommandLineFunction
{
setPythonScript
(
"fix_iupac_mpileup.py"
,
"/nl/lumc/sasc/biopet/extensions/samtools/"
)
def
cmdLine
=
getPythonCommand
}
public/biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/samtools/SamtoolsMpileup.scala
View file @
e972a0d1
...
...
@@ -37,6 +37,7 @@ class SamtoolsMpileup(val root: Configurable) extends Samtools with Reference {
var
disableBaq
:
Boolean
=
config
(
"disable_baq"
,
default
=
false
)
var
u
:
Boolean
=
config
(
"u"
,
default
=
false
)
var
v
:
Boolean
=
config
(
"u"
,
default
=
false
)
var
minMapQuality
:
Option
[
Int
]
=
config
(
"min_map_quality"
)
var
minBaseQuality
:
Option
[
Int
]
=
config
(
"min_base_quality"
)
var
depth
:
Option
[
Int
]
=
config
(
"depth"
)
...
...
@@ -57,6 +58,7 @@ class SamtoolsMpileup(val root: Configurable) extends Samtools with Reference {
conditional
(
outputMappingQuality
,
"-s"
)
+
conditional
(
disableBaq
,
"-B"
)
+
conditional
(
u
,
"-u"
)
+
conditional
(
v
,
"-v"
)
+
(
if
(
outputAsStsout
)
""
else
required
(
"-o"
,
output
))
+
(
if
(
inputAsStdin
)
"-"
else
repeat
(
input
))
}
...
...
public/shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/variantcallers/Bcftools.scala
View file @
e972a0d1
...
...
@@ -2,7 +2,7 @@ package nl.lumc.sasc.biopet.pipelines.shiva.variantcallers
import
nl.lumc.sasc.biopet.extensions.Tabix
import
nl.lumc.sasc.biopet.extensions.bcftools.BcftoolsCall
import
nl.lumc.sasc.biopet.extensions.samtools.SamtoolsMpileup
import
nl.lumc.sasc.biopet.extensions.samtools.
{
FixMpileup
,
SamtoolsMpileup
}
import
nl.lumc.sasc.biopet.utils.config.Configurable
/** default mode of bcftools */
...
...
@@ -14,6 +14,7 @@ class Bcftools(val root: Configurable) extends Variantcaller {
val
mp
=
new
SamtoolsMpileup
(
this
)
mp
.
input
=
inputBams
.
values
.
toList
mp
.
u
=
true
mp
.
v
=
true
mp
.
reference
=
referenceFasta
()
val
bt
=
new
BcftoolsCall
(
this
)
...
...
@@ -21,7 +22,7 @@ class Bcftools(val root: Configurable) extends Variantcaller {
bt
.
v
=
true
bt
.
c
=
true
add
(
mp
|
bt
>
outputFile
)
add
(
mp
|
new
FixMpileup
(
this
)
|
bt
>
outputFile
)
add
(
Tabix
(
this
,
outputFile
))
}
}
public/shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/variantcallers/BcftoolsSingleSample.scala
View file @
e972a0d1
package
nl.lumc.sasc.biopet.pipelines.shiva.variantcallers
import
java.io.File
import
nl.lumc.sasc.biopet.extensions.
{
Ln
,
Tabix
}
import
nl.lumc.sasc.biopet.extensions.bcftools.
{
BcftoolsMerge
,
BcftoolsCall
}
import
nl.lumc.sasc.biopet.extensions.samtools.SamtoolsMpileup
import
nl.lumc.sasc.biopet.extensions.samtools.
{
FixMpileup
,
SamtoolsMpileup
}
import
nl.lumc.sasc.biopet.utils.config.Configurable
/** default mode of bcftools */
...
...
@@ -17,6 +15,7 @@ class BcftoolsSingleSample(val root: Configurable) extends Variantcaller {
val
mp
=
new
SamtoolsMpileup
(
this
)
mp
.
input
:+=
inputBam
mp
.
u
=
true
mp
.
v
=
true
mp
.
reference
=
referenceFasta
()
val
bt
=
new
BcftoolsCall
(
this
)
...
...
@@ -25,7 +24,7 @@ class BcftoolsSingleSample(val root: Configurable) extends Variantcaller {
bt
.
c
=
true
bt
.
output
=
new
File
(
outputDir
,
sample
+
".vcf.gz"
)
add
(
mp
|
bt
)
add
(
mp
|
new
FixMpileup
(
this
)
|
bt
)
add
(
Tabix
(
this
,
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