Skip to content

Commit 73f7506

Browse files
committed
Minor cleanup
1 parent 00f1e84 commit 73f7506

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/pyobo/sources/rhea.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""Converter for Rhea."""
44

55
import logging
6-
from typing import Dict, Iterable, Optional
6+
from typing import TYPE_CHECKING, Dict, Iterable, Optional
77

88
import bioversions
99
import pystow
@@ -21,6 +21,9 @@
2121
)
2222
from pyobo.utils.path import ensure_df
2323

24+
if TYPE_CHECKING:
25+
import rdflib
26+
2427
__all__ = [
2528
"RheaGetter",
2629
]
@@ -124,8 +127,7 @@ def iter_terms(version: str, force: bool = False) -> Iterable[Term]:
124127
?compound rh:chebi|rh:underlyingChebi|(rh:reactivePart/rh:chebi) ?chebi .
125128
}
126129
"""
127-
results = graph.query(sparql)
128-
for master_rhea_id, side_uri, chebi_uri in results:
130+
for master_rhea_id, side_uri, chebi_uri in graph.query(sparql):
129131
master_rhea_id = str(master_rhea_id)
130132
chebi_reference = Reference(
131133
prefix="chebi", identifier=chebi_uri[len("http://purl.obolibrary.org/obo/CHEBI_") :]
@@ -161,7 +163,7 @@ def iter_terms(version: str, force: bool = False) -> Iterable[Term]:
161163
("macie", "rhea2macie", None),
162164
("metacyc", "rhea2metacyc", None),
163165
("go", "rhea2go", None), # TODO what is the relationship?
164-
("go", "rhea2uniprot", enabled_by),
166+
("uniprot", "rhea2uniprot", enabled_by),
165167
]:
166168
xref_df = ensure_df(
167169
PREFIX,
@@ -188,7 +190,7 @@ def iter_terms(version: str, force: bool = False) -> Iterable[Term]:
188190

189191
ec_df = ensure_df(
190192
PREFIX,
191-
url=f"ftp://ftp.expasy.org/databases/rhea/tsv/rhea-ec-iubmb.tsv",
193+
url="ftp://ftp.expasy.org/databases/rhea/tsv/rhea-ec-iubmb.tsv",
192194
version=version,
193195
force=force,
194196
)

0 commit comments

Comments
 (0)