Skip to content

Commit

Permalink
improved region mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
haeussma committed Apr 11, 2024
1 parent 954bab4 commit 98f9db9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pyeed/fetchers/ncbiprotein.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,14 @@ def map_regions(self, seq_record: SeqRecord, protein_info: "ProteinInfo"):

regions = self.get_feature(seq_record, "region")
for region in regions:
print(region, "\n")
try:
if "db_xref" not in region.qualifiers:
db_xref = None
else:
db_xref = region.qualifiers["db_xref"][0]
if "id" in region.qualifiers:
print("there is an id")
protein_info.regions.append(
ProteinRegion(
name=region.qualifiers["region_name"][0],
Expand All @@ -195,7 +202,7 @@ def map_regions(self, seq_record: SeqRecord, protein_info: "ProteinInfo"):
)
],
note=region.qualifiers["note"][0],
cross_reference=region.qualifiers["db_xref"][0],
cross_reference=db_xref,
)
)
except KeyError:
Expand Down

0 comments on commit 98f9db9

Please sign in to comment.