Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SOaAS
dbxref
Commits
2a28e3c3
Commit
2a28e3c3
authored
Apr 24, 2019
by
Lukas Jelonek
Browse files
Fix bug: ec number retriever uses dbxref instead of id for identity field
parent
95aadf02
Changes
2
Hide whitespace changes
Inline
Side-by-side
dbxref/retrieve/enzyme.py
View file @
2a28e3c3
...
@@ -45,14 +45,14 @@ def retrieve(dbxrefs, basic=True, references=True):
...
@@ -45,14 +45,14 @@ def retrieve(dbxrefs, basic=True, references=True):
html
=
HTML
.
document_fromstring
(
ls
).
head
.
text_content
()
html
=
HTML
.
document_fromstring
(
ls
).
head
.
text_content
()
# when everything is fine an exception was thrown for
# when everything is fine an exception was thrown for
# the last line
# the last line
output
=
{
'd
bxref
'
:
entry
[
'dbxref'
]}
output
=
{
'
i
d'
:
entry
[
'dbxref'
]}
output
[
'message'
]
=
html
output
[
'message'
]
=
html
if
output
[
'message'
]
==
' 500 Internal Server Error '
:
if
output
[
'message'
]
==
' 500 Internal Server Error '
:
output
[
'message'
]
=
'500 Internal Server Error; probably invalid ID'
output
[
'message'
]
=
'500 Internal Server Error; probably invalid ID'
documents
.
append
(
output
)
documents
.
append
(
output
)
except
:
except
:
retrieved_entry
=
parse_flat_file
(
r
.
text
)
retrieved_entry
=
parse_flat_file
(
r
.
text
)
retrieved_entry
[
'd
bxref
'
]
=
entry
[
'dbxref'
]
retrieved_entry
[
'
i
d'
]
=
entry
[
'dbxref'
]
documents
.
append
(
retrieved_entry
)
documents
.
append
(
retrieved_entry
)
return
documents
return
documents
...
...
tests/test_retriever.py
View file @
2a28e3c3
...
@@ -4,7 +4,7 @@ from dbxref import retriever, resolver
...
@@ -4,7 +4,7 @@ from dbxref import retriever, resolver
class
TestDbxrefResolve
(
unittest
.
TestCase
):
class
TestDbxrefResolve
(
unittest
.
TestCase
):
def
test_different_case_database_prefix
(
self
):
def
test_different_case_database_prefix
(
self
):
entries
=
resolver
.
convert_to_dbxrefs
([
'PFAM:PF00002'
,
'Pfam:PF00002'
,
'pfam:PF00002'
])
entries
=
resolver
.
convert_to_dbxrefs
([
'PFAM:PF00002'
,
'Pfam:PF00002'
,
'pfam:PF00002'
,
'EC:2.7.7.1'
])
documents
=
retriever
.
retrieve
(
entries
)
documents
=
retriever
.
retrieve
(
entries
)
for
d
in
documents
:
for
d
in
documents
:
with
self
.
subTest
(
d
=
d
):
with
self
.
subTest
(
d
=
d
):
...
...
Write
Preview
Supports
Markdown
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