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
Mutalyzer
mutalyzer2
Commits
0ff4864f
Commit
0ff4864f
authored
Aug 21, 2019
by
Mihai
Browse files
Add support for NCBI E-utilities API key
parent
97a6309c
Changes
2
Hide whitespace changes
Inline
Side-by-side
mutalyzer/Retriever.py
View file @
0ff4864f
...
...
@@ -47,6 +47,8 @@ class Retriever(object):
if
not
os
.
path
.
isdir
(
settings
.
CACHE_DIR
):
os
.
mkdir
(
settings
.
CACHE_DIR
)
Entrez
.
email
=
settings
.
EMAIL
if
hasattr
(
settings
,
'ENTREZ_API_KEY'
):
Entrez
.
api_key
=
settings
.
ENTREZ_API_KEY
self
.
file_type
=
None
def
_name_to_file
(
self
,
name
):
...
...
mutalyzer/ncbi.py
View file @
0ff4864f
...
...
@@ -77,6 +77,8 @@ def _get_link_from_ncbi(source_db, target_db, match_link_name,
# below, so we cannot move to `accession.version` here. This is fine for
# now, but should be reconsidered at some point.
Entrez
.
email
=
settings
.
EMAIL
if
hasattr
(
settings
,
'ENTREZ_API_KEY'
):
Entrez
.
api_key
=
settings
.
ENTREZ_API_KEY
# If we are currently strictly matching on version, we can try again if
# no result is found. Otherwise, we just report failure.
...
...
@@ -343,6 +345,8 @@ def _get_snp_from_ncbi(rsid):
:return: response_text(str)
"""
Entrez
.
email
=
settings
.
EMAIL
if
hasattr
(
settings
,
'ENTREZ_API_KEY'
):
Entrez
.
api_key
=
settings
.
ENTREZ_API_KEY
try
:
response
=
Entrez
.
efetch
(
db
=
'snp'
,
id
=
rsid
[
2
:],
retmode
=
'xml'
)
...
...
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