Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vtools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
7
Issues
7
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Klinische Genetica
capture-lumc
vtools
Commits
232151a2
Commit
232151a2
authored
Oct 11, 2019
by
van den Berg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add minimal logging to vtools
parent
ec9bba93
Pipeline
#2770
failed with stage
in 24 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
1 deletion
+32
-1
vtools/cli.py
vtools/cli.py
+19
-1
vtools/evaluate.py
vtools/evaluate.py
+13
-0
No files found.
vtools/cli.py
View file @
232151a2
...
...
@@ -7,6 +7,7 @@ vtools.cli
:license: MIT
"""
import
json
import
logging
import
click
from
cyvcf2
import
VCF
,
Writer
...
...
@@ -15,6 +16,13 @@ from .filter import FilterParams, FilterClass, Filterer
from
.stats
import
Stats
from
.gcoverage
import
RefRecord
,
region_coverages
# Create logger and console handler
logger
=
logging
.
getLogger
(
'vtools'
)
formatter
=
logging
.
Formatter
(
'%(name)s - %(message)s'
)
ch
=
logging
.
StreamHandler
()
ch
.
setFormatter
(
formatter
)
logger
.
addHandler
(
ch
)
@
click
.
command
()
@
click
.
option
(
"-c"
,
"--call-vcf"
,
type
=
click
.
Path
(
exists
=
True
),
...
...
@@ -36,8 +44,18 @@ from .gcoverage import RefRecord, region_coverages
@
click
.
option
(
"-dc"
,
"--discordant"
,
type
=
click
.
Path
(
writable
=
True
),
help
=
"Path to output discordant VCF file"
,
required
=
False
)
@
click
.
option
(
"--log"
,
type
=
click
.
Choice
([
'debug'
,
'info'
,
'warning'
,
'error'
,
'critical'
]),
default
=
'info'
)
def
evaluate_cli
(
call_vcf
,
positive_vcf
,
call_samples
,
positive_samples
,
stats
,
discordant
):
discordant
,
log
):
# Set the level for the logger and the handler
logger
.
setLevel
(
log
.
upper
())
ch
.
setLevel
(
log
.
upper
())
logger
.
debug
(
'Ontbuggen'
)
logger
.
info
(
'informatie'
)
logger
.
warning
(
'waarschuwing'
)
logger
.
error
(
'fout'
)
logger
.
critical
(
'kritiek'
)
c_vcf
=
VCF
(
call_vcf
,
gts012
=
True
)
p_vcf
=
VCF
(
positive_vcf
,
gts012
=
True
)
st
,
disc
=
site_concordancy
(
c_vcf
,
p_vcf
,
call_samples
,
...
...
vtools/evaluate.py
View file @
232151a2
...
...
@@ -7,6 +7,7 @@ vtools.evaluate
:license: MIT
"""
from
typing
import
List
,
Dict
import
logging
from
cyvcf2
import
VCF
...
...
@@ -42,6 +43,14 @@ def site_concordancy(call_vcf: VCF,
"het_concordant": 0, "sites_considered": 0,
"total_sites": 0}
"""
logger
=
logging
.
getLogger
(
'vtools.evaluate'
)
logger
.
debug
(
'Ontbuggen'
)
logger
.
info
(
'informatie'
)
logger
.
warning
(
'waarschuwing'
)
logger
.
error
(
'fout'
)
logger
.
critical
(
'kritiek'
)
if
len
(
positive_samples
)
!=
len
(
call_samples
):
raise
ValueError
(
"Lists of samples must have same size"
)
...
...
@@ -70,6 +79,7 @@ def site_concordancy(call_vcf: VCF,
pos_record
.
end
)
it
=
call_vcf
(
query_str
)
same
=
[]
for
it_record
in
it
:
...
...
@@ -79,6 +89,9 @@ def site_concordancy(call_vcf: VCF,
and
it_record
.
ALT
==
pos_record
.
ALT
):
same
.
append
(
it_record
)
logger
.
debug
(
'{} is excluded'
.
format
(
query_str
))
else
:
logger
.
debug
(
'{} is included'
.
format
(
query_str
))
if
len
(
same
)
!=
1
:
continue
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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