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 – Path to an ontology file.

  • import_depth – The maximum depth of imports to resolve in the ontology tree.

  • timeout – The timeout in seconds to use when performing network I/O.

  • threads – The number of threads to use when parsing.

  • url – The url of ontology.

  • prefix – Dev only -> prefix for get_term.

Attributes

import_depth: int#
timeout: int#
imports: Dict[str, Ontology]#
path: Optional[str]#
handle: Optional[BinaryIO]#

Methods

get_term(term)#

Search an ontology by its id.

write_obo()#

Write ontology to dynamicdir/{filename}.obo file.