Skip to content

Commit

Permalink
Update wikipathways download
Browse files Browse the repository at this point in the history
Closes #133
  • Loading branch information
cthoyt committed Jul 26, 2022
1 parent 47ace15 commit bc2ba33
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/pyobo/sources/wikipathways.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""Converter for WikiPathways."""

import logging
import urllib.error
from typing import Iterable

from .gmt_utils import parse_wikipathways_gmt
Expand Down Expand Up @@ -37,6 +38,7 @@
("Rattus_norvegicus", "10116"),
("Saccharomyces_cerevisiae", "4932"),
("Sus_scrofa", "9823"),
("Solanum_lycopersicum", "4081"),
]


Expand All @@ -62,8 +64,11 @@ def iter_terms(version: str) -> Iterable[Term]:

for species_code, taxonomy_id in _PATHWAY_INFO:
url = f"{base_url}-{species_code}.gmt"
path = ensure_path(PREFIX, url=url, version=version)

try:
path = ensure_path(PREFIX, url=url, version=version)
except urllib.error.HTTPError as e:
logger.warning("HTTP %s error when downloading WikiPathways file %s", e.code, url)
continue
species_code = species_code.replace("_", " ")
taxonomy_name = SPECIES_REMAPPING.get(species_code, species_code)

Expand Down

0 comments on commit bc2ba33

Please sign in to comment.