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
4ef71d0e
There was a problem fetching the pipeline summary.
Commit
4ef71d0e
authored
6 years ago
by
Sander Bollen
Browse files
Options
Downloads
Patches
Plain Diff
add cli for evaluation
parent
103371d5
No related branches found
No related tags found
No related merge requests found
Pipeline
#
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
setup.py
+2
-1
2 additions, 1 deletion
setup.py
vtools/cli.py
+29
-5
29 additions, 5 deletions
vtools/cli.py
with
31 additions
and
6 deletions
setup.py
+
2
−
1
View file @
4ef71d0e
...
...
@@ -39,7 +39,8 @@ setup(
"
console_scripts
"
:
[
"
vtools-filter = vtools.cli:filter_cli
"
,
"
vtools-stats = vtools.cli:stats_cli
"
,
"
vtools-gcoverage = vtools.cli:gcoverage_cli
"
"
vtools-gcoverage = vtools.cli:gcoverage_cli
"
,
"
vtools-evaluate = vtools.cli:evaluate_cli
"
]
},
classifiers
=
[
...
...
This diff is collapsed.
Click to expand it.
vtools/cli.py
+
29
−
5
View file @
4ef71d0e
...
...
@@ -6,12 +6,36 @@ vtools.cli
:copyright: (c) Leiden University Medical Center
:license: MIT
"""
import
json
import
click
from
cyvcf2
import
VCF
,
Writer
from
.evaluate
import
site_concordancy
from
.filter
import
FilterParams
,
FilterClass
,
Filterer
from
.stats
import
Stats
from
.gcoverage
import
RefRecord
,
region_coverages
from
.filter
import
*
from
.stats
import
*
from
.gcoverage
import
*
@click.command
()
@click.option
(
"
-c
"
,
"
--call-vcf
"
,
type
=
click
.
Path
(
exists
=
True
),
help
=
"
Path to VCF with calls to be evaluated
"
,
required
=
True
)
@click.option
(
"
-p
"
,
"
--positive-vcf
"
,
type
=
click
.
Path
(
exists
=
True
),
help
=
"
Path to VCF with known calls
"
,
required
=
True
)
@click.option
(
"
-cs
"
,
"
--call-samples
"
,
type
=
click
.
STRING
,
multiple
=
True
,
help
=
"
Sample(s) in call-vcf to consider.
"
"
May be called multiple times
"
,
required
=
True
)
@click.option
(
"
-ps
"
,
"
--positive-samples
"
,
type
=
click
.
STRING
,
multiple
=
True
,
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
):
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
))
@click.command
()
...
...
@@ -80,7 +104,7 @@ def stats_cli(input):
default
=
True
,
help
=
"
Collect metrics per exon or per transcript
"
)
def
gcoverage_cli
(
input_gvcf
,
refflat_file
,
per_exon
):
reader
=
cyvcf2
.
VCF
(
input_gvcf
)
reader
=
VCF
(
input_gvcf
)
header
=
None
with
open
(
refflat_file
)
as
handle
:
for
line
in
handle
:
...
...
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