Skip to content

Commit

Permalink
Support UniProt accessions with "submittedName"
Browse files Browse the repository at this point in the history
  • Loading branch information
huiwenke authored and sreenathnair committed Apr 17, 2023
1 parent 2bad139 commit 0677911
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions bio3dbeacons/cli/ciftojson/ciftojson.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,16 @@ def add_extra_uniprot_info(self):
namespace = "{http://uniprot.org/uniprot}"
# fetch accession related data
ac_id = xml_root.find(f"./{namespace}entry/{namespace}name").text
description = xml_root.find(
f"./{namespace}entry/{namespace}protein/{namespace}recommendedName"
f"/{namespace}fullName"
).text
try:
description = xml_root.find(
f"./{namespace}entry/{namespace}protein/{namespace}recommendedName"
f"/{namespace}fullName"
).text
except:
description = xml_root.find(
f"./{namespace}entry/{namespace}protein/{namespace}submittedName"
f"/{namespace}fullName"
).text

# fetch gene related data
gene = xml_root.find(
Expand Down

0 comments on commit 0677911

Please sign in to comment.