get_ontology

get_ontology(prefix, *, force=False, force_process=False, strict=False, version=None, robot_check=True, upgrade=True, cache=True, use_tqdm=True)[source]

Get the OBO for a given graph.

Parameters:
  • prefix (str) – The prefix of the ontology to look up

  • version (str | None) – The pre-looked-up version of the ontology

  • force (bool) – Download the data again

  • force_process (bool) – Should the OBO cache be rewritten? Automatically set to true if force is true

  • strict (bool) – Should CURIEs be treated strictly? If true, raises exceptions on invalid/malformed

  • robot_check (bool) – If set to false, will send the --check=false command to ROBOT to disregard malformed ontology components. Necessary to load some ontologies like VO.

  • upgrade (bool) – If set to true, will automatically upgrade relationships, such as obo:chebi#part_of to BFO:0000051

  • cache (bool) – Should cached objects be written? defaults to True

  • use_tqdm (bool)

Returns:

An OBO object

Return type:

Obo

Alternate usage if you have a custom url

from pystow.utils import download
from pyobo import Obo, from_obo_path

url = ...
obo_path = ...
download(url=url, path=path)
obo = from_obo_path(path)