Skip to content

Endpoints: Ontology

Christopher Anna edited this page Aug 8, 2018 · 2 revisions

wormbase_parasite.endpoint_groups.ontology

OntologyMixin

OntologyMixin(self, /, *args, **kwargs)

A mixin with methods for accessing the Ontology section of the Wormbase ParaSite REST API

This mixin provides access to the following endpoints:

GET /ontology/ancestors/:id
GET /ontology/ancestors/chart/:id
GET /ontology/descendants/:id
GET /ontology/id/:id
GET /ontology/name/:name

Any arguments listed with a * are required

get_ancestry

OntologyMixin.get_ancestry(self, id, ontology=None)

GET ontology/ancestors/:id

Arguments

  • id* (str): an ontology term identifier
  • ontology (str): Default: None

Example

client = wormbase_parasite.WormbaseClient()
client.get_ancestry('GO:0005667')

Returns

data (list): a list of dictionaries describing the ancestors of the given gene

See also: https://parasite.wormbase.org/rest/documentation/info/ontology_ancestors

get_ancestry_chart

OntologyMixin.get_ancestry_chart(self, id, ontology=None)

GET /ontology/ancestors/chart/:id

Arguments

  • id* (str): an ontology term identifier
  • ontology (str): Default: None

Example

client = wormbase_parasite.WormbaseClient()
client.get_ancestry_chart('GO:0005667')

Returns

data (dict): a list of dictionaries reconstructing the entire ancestry of a term from is_a and part_of relationships the ancestors of the given gene

See also: https://parasite.wormbase.org/rest/documentation/info/ontology_ancestors_chart

get_descendants

OntologyMixin.get_descendants(self, id, closest_term=False, ontology=None, subset=None, zero_distance=False)

GET /ontology/descendants/:id

Arguments

  • id* (str): an ontology term identifier
  • closest_term (boolean): Default: False
  • ontology (str): Default: None
  • subset (str): Default: None
  • zero_distance (boolean): Default: False

Example

client = wormbase_parasite.WormbaseClient()
client.get_descendants('GO:0005667')

Returns

data (list): a list of dictionaries representing the data returned by the API

See also: https://parasite.wormbase.org/rest-10/documentation/info/ontology_descendants

get_ontology_by_id

OntologyMixin.get_ontology_by_id(self, id, relation=False, simple=False)

GET ontology/id/:id

Arguments

  • id* (str): an ontology term identifier
  • relation (str): Default: None
  • simple (boolean): Default: False

Example

client = wormbase_parasite.WormbaseClient()
client.get_ontology_by_id('GO:0005667')

Returns

data (dict): a dictionary representing the data returned by the API

See also: https://parasite.wormbase.org/rest/documentation/info/ontology_id

get_ontology_by_name

OntologyMixin.get_ontology_by_name(self, name, ontology=None, relation=None, simple=False)

GET ontology/id/:id

Arguments

  • name* (str): an ontology name. SQL wildcards are supported
  • ontology (str): Default: None
  • relation (str): Default: None
  • simple (boolean): Default: False

Example

client = wormbase_parasite.WormbaseClient()
client.get_ontology_by_name('transcription factor complex')

Returns

data (dict): a dictionary representing the data returned by the API

See also: https://parasite.wormbase.org/rest/documentation/info/ontology_name

Clone this wiki locally