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
e7ed7e5f
Commit
e7ed7e5f
authored
Apr 08, 2015
by
Sander Bollen
Browse files
camelCase for arguments in VcfFilter. See issue #153
parent
23c3057d
Changes
2
Hide whitespace changes
Inline
Side-by-side
docs/tools/VcfFilter.md
View file @
e7ed7e5f
...
...
@@ -42,7 +42,7 @@ Usage: VcfFilter [options]
Filter when there are only ref calls
--filterNoCalls
Filter when there are only no calls
--minQual
s
core <value>
--minQual
S
core <value>
Min qual score
~~~
...
...
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/VcfFilter.scala
View file @
e7ed7e5f
...
...
@@ -59,14 +59,14 @@ object VcfFilter extends ToolCommand {
case
class
Args
(
inputVcf
:
File
=
null
,
outputVcf
:
File
=
null
,
invertedOutputVcf
:
Option
[
File
]
=
None
,
minQual
s
core
:
Option
[
Double
]
=
None
,
minQual
S
core
:
Option
[
Double
]
=
None
,
minSampleDepth
:
Int
=
-
1
,
minTotalDepth
:
Int
=
-
1
,
minAlternateDepth
:
Int
=
-
1
,
minSamplesPass
:
Int
=
0
,
minBamAlternateDepth
:
Int
=
0
,
mustHaveVariant
:
List
[
String
]
=
Nil
,
de
n
ovoInSample
:
String
=
null
,
de
N
ovoInSample
:
String
=
null
,
diffGenotype
:
List
[(
String
,
String
)]
=
Nil
,
filterHetVarToHomVar
:
List
[(
String
,
String
)]
=
Nil
,
filterRefCalls
:
Boolean
=
false
,
...
...
@@ -98,8 +98,8 @@ object VcfFilter extends ToolCommand {
opt
[
Int
](
"minBamAlternateDepth"
)
unbounded
()
valueName
(
"<int>"
)
action
{
(
x
,
c
)
=>
c
.
copy
(
minBamAlternateDepth
=
x
)
}
// TODO: Convert this to more generic filter
opt
[
String
](
"de
n
ovoInSample"
)
maxOccurs
(
1
)
unbounded
()
valueName
(
"<sample>"
)
action
{
(
x
,
c
)
=>
c
.
copy
(
de
n
ovoInSample
=
x
)
opt
[
String
](
"de
N
ovoInSample"
)
maxOccurs
(
1
)
unbounded
()
valueName
(
"<sample>"
)
action
{
(
x
,
c
)
=>
c
.
copy
(
de
N
ovoInSample
=
x
)
}
text
(
"Only show variants that contain unique alleles in complete set for given sample"
)
opt
[
String
](
"mustHaveVariant"
)
unbounded
()
valueName
(
"<sample>"
)
action
{
(
x
,
c
)
=>
c
.
copy
(
mustHaveVariant
=
x
::
c
.
mustHaveVariant
)
...
...
@@ -118,13 +118,13 @@ object VcfFilter extends ToolCommand {
opt
[
Unit
](
"filterNoCalls"
)
unbounded
()
action
{
(
x
,
c
)
=>
c
.
copy
(
filterNoCalls
=
true
)
}
text
(
"Filter when there are only no calls"
)
opt
[
Double
](
"minQual
s
core"
)
unbounded
()
action
{
(
x
,
c
)
=>
c
.
copy
(
minQual
s
core
=
Some
(
x
))
opt
[
Double
](
"minQual
S
core"
)
unbounded
()
action
{
(
x
,
c
)
=>
c
.
copy
(
minQual
S
core
=
Some
(
x
))
}
text
(
"Min qual score"
)
opt
[
String
](
"id"
)
unbounded
()
action
{
(
x
,
c
)
=>
c
.
copy
(
iDset
=
c
.
iDset
+
x
)
}
text
(
"Id that may pass the filter"
)
opt
[
File
](
"id
-f
ile"
)
unbounded
()
action
{
(
x
,
c
)
=>
opt
[
File
](
"id
F
ile"
)
unbounded
()
action
{
(
x
,
c
)
=>
c
.
copy
(
iDset
=
c
.
iDset
++
Source
.
fromFile
(
x
).
getLines
())
}
text
(
"File that contain list of IDs to get from vcf file"
)
}
...
...
@@ -183,8 +183,8 @@ object VcfFilter extends ToolCommand {
}
def
minQualscore
(
record
:
VariantContext
)
:
Boolean
=
{
if
(
commandArgs
.
minQual
s
core
.
isEmpty
)
return
true
record
.
getPhredScaledQual
>=
commandArgs
.
minQual
s
core
.
get
if
(
commandArgs
.
minQual
S
core
.
isEmpty
)
return
true
record
.
getPhredScaledQual
>=
commandArgs
.
minQual
S
core
.
get
}
def
filterRefCalls
(
record
:
VariantContext
)
:
Boolean
=
{
...
...
@@ -263,10 +263,10 @@ object VcfFilter extends ToolCommand {
}
def
denovoInSample
(
record
:
VariantContext
)
:
Boolean
=
{
if
(
commandArgs
.
de
n
ovoInSample
==
null
)
return
true
val
genotype
=
record
.
getGenotype
(
commandArgs
.
de
n
ovoInSample
)
if
(
commandArgs
.
de
N
ovoInSample
==
null
)
return
true
val
genotype
=
record
.
getGenotype
(
commandArgs
.
de
N
ovoInSample
)
for
(
allele
<-
genotype
.
getAlleles
if
allele
.
isNonReference
)
{
for
(
g
<-
record
.
getGenotypes
if
g
.
getSampleName
!=
commandArgs
.
de
n
ovoInSample
)
{
for
(
g
<-
record
.
getGenotypes
if
g
.
getSampleName
!=
commandArgs
.
de
N
ovoInSample
)
{
if
(
g
.
getAlleles
.
exists
(
_
.
basesMatch
(
allele
)))
return
false
}
}
...
...
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