Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
David Hoksza
bh19-rare-diseases
Commits
8b895c49
Commit
8b895c49
authored
Nov 22, 2019
by
David Hoksza
Browse files
fix wrong number of reported removed snps
parent
96764ee7
Changes
1
Hide whitespace changes
Inline
Side-by-side
associations/minerva_variants.py
View file @
8b895c49
...
...
@@ -25,7 +25,15 @@ def get_dbsnp(ids: List[str]) -> List[Dict]:
logging
.
info
(
"Retrieved data from myvariant API"
)
if
res
.
status_code
==
requests
.
codes
.
ok
:
content
=
json
.
loads
(
res
.
text
)
cnt
=
0
for
res
in
content
:
genes
=
res
[
"dbsnp"
][
"gene"
]
if
not
isinstance
(
genes
,
list
):
genes
=
[
genes
]
cnt
+=
len
(
genes
)
if
"dbnsfp"
not
in
res
\
or
"uniprot"
not
in
res
[
"dbnsfp"
]
\
or
"aa"
not
in
res
[
"dbnsfp"
]
:
...
...
@@ -48,7 +56,6 @@ def get_dbsnp(ids: List[str]) -> List[Dict]:
# uniprot_acc = uniprot_ids.pop()
uniprot_acc
=
uniprot_ids
.
pop
()
aa
=
res
[
"dbnsfp"
][
"aa"
]
aas
=
aa
if
isinstance
(
aa
,
list
)
else
[
aa
]
#we can hav multiple aa mappings if there is a splice site
...
...
@@ -57,11 +64,6 @@ def get_dbsnp(ids: List[str]) -> List[Dict]:
if
"ref"
not
in
aa
:
continue
genes
=
res
[
"dbsnp"
][
"gene"
]
if
not
isinstance
(
genes
,
list
):
genes
=
[
genes
]
for
gene
in
genes
:
position
=
str
(
res
[
"hg19"
][
"start"
])
...
...
@@ -118,7 +120,7 @@ def get_dbsnp(ids: List[str]) -> List[Dict]:
"uniprot_acc"
:
uniprot_acc
})
logging
.
info
(
"Skipped {} variants out of {}"
.
format
(
len
(
content
)
-
len
(
snps
),
len
(
content
)
))
logging
.
info
(
"Skipped {} variants out of {}"
.
format
(
cnt
-
len
(
snps
),
cnt
))
return
snps
...
...
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