bionty.Ontology#

class bionty.Ontology(handle=None, import_depth=-1, timeout=100, threads=None, prefix='')#

Bases: Ontology

Interface with ontologies via pronto.

Also see: https://pronto.readthedocs.io/en/stable/api/pronto.Ontology.html

Parameters:
  • handle (Union[str, Path, BinaryIO, None], default: None) – Path to an ontology source file.

  • import_depth (int, default: -1) – The maximum depth of imports to resolve in the ontology tree.

  • timeout (int, default: 100) – The timeout in seconds to use when performing network I/O.

  • threads (Optional[int], default: None) – The number of threads to use when parsing.

  • url – The url of the ontology.

  • prefix (str, default: '') – Dev only -> prefix for get_term.

Attributes

Methods

get_term(term)#

Search an ontology by its id.

to_df(source=None, include_id_prefixes=None)#

Convert pronto.Ontology to a DataFrame with columns id, name, parents.