Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vtools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Klinische Genetica
capture-lumc
vtools
Commits
ec9bba93
Unverified
Commit
ec9bba93
authored
5 years ago
by
Redmar van den Berg
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request
#1
from LUMC/devel
Devel
parents
72dae189
70d3ac7f
No related branches found
No related tags found
3 merge requests
!6
Merge testing into master
,
!5
Merge new testing code into devel
,
!4
Add output of discordant variants
Pipeline
#2855
passed
5 years ago
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+2
-0
2 additions, 0 deletions
README.md
vtools/cli.py
+18
-3
18 additions, 3 deletions
vtools/cli.py
vtools/evaluate.py
+8
-1
8 additions, 1 deletion
vtools/evaluate.py
with
28 additions
and
4 deletions
README.md
+
2
−
0
View file @
ec9bba93
...
...
@@ -154,6 +154,8 @@ Options:
called multiple
times
[
required]
-ps
,
--positive-samples
TEXT Sample
(
s
)
in
positive-vcf to consider. May be
called multiple
times
[
required]
-s
,
--stats
PATH Path to output stats json file
-dc
,
--discordant
PATH Path to output discordant VCF file
--help
Show this message and exit.
```
...
...
This diff is collapsed.
Click to expand it.
vtools/cli.py
+
18
−
3
View file @
ec9bba93
...
...
@@ -31,11 +31,26 @@ from .gcoverage import RefRecord, region_coverages
help
=
"
Sample(s) in positive-vcf to consider.
"
"
May be called multiple times
"
,
required
=
True
)
def
evaluate_cli
(
call_vcf
,
positive_vcf
,
call_samples
,
positive_samples
):
@click.option
(
"
-s
"
,
"
--stats
"
,
type
=
click
.
Path
(
writable
=
True
),
help
=
"
Path to output stats json file
"
,
default
=
'
-
'
)
@click.option
(
"
-dc
"
,
"
--discordant
"
,
type
=
click
.
Path
(
writable
=
True
),
help
=
"
Path to output discordant VCF file
"
,
required
=
False
)
def
evaluate_cli
(
call_vcf
,
positive_vcf
,
call_samples
,
positive_samples
,
stats
,
discordant
):
c_vcf
=
VCF
(
call_vcf
,
gts012
=
True
)
p_vcf
=
VCF
(
positive_vcf
,
gts012
=
True
)
evaluated
=
site_concordancy
(
c_vcf
,
p_vcf
,
call_samples
,
positive_samples
)
print
(
json
.
dumps
(
evaluated
))
st
,
disc
=
site_concordancy
(
c_vcf
,
p_vcf
,
call_samples
,
positive_samples
)
# Write the stats json file
with
click
.
open_file
(
stats
,
'
w
'
)
as
fout
:
print
(
json
.
dumps
(
st
),
file
=
fout
)
# If specified, write the discordant variants
if
discordant
:
with
click
.
open_file
(
discordant
,
'
w
'
)
as
fout
:
for
record
in
disc
:
print
(
record
,
file
=
fout
,
end
=
''
)
@click.command
()
...
...
This diff is collapsed.
Click to expand it.
vtools/evaluate.py
+
8
−
1
View file @
ec9bba93
...
...
@@ -60,6 +60,8 @@ def site_concordancy(call_vcf: VCF,
"
alleles_no_call
"
:
0
,
"
alleles_low_qual
"
:
0
}
discordant_count
=
0
discordant_records
=
list
()
for
pos_record
in
positive_vcf
:
d
[
'
total_sites
'
]
+=
1
query_str
=
"
{0}:{1}-{2}
"
.
format
(
...
...
@@ -130,4 +132,9 @@ def site_concordancy(call_vcf: VCF,
# the same has no call in one or more of the VCF files
d
[
'
alleles_no_call
'
]
+=
2
return
d
# The current variant is discordant
if
d
[
'
alleles_discordant
'
]
>
discordant_count
:
discordant_count
=
d
[
'
alleles_discordant
'
]
discordant_records
.
append
(
call_record
)
return
d
,
discordant_records
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment