Skip to content

Instantly share code, notes, and snippets.

@cmungall
Created November 18, 2022 00:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmungall/5ffe90b9d56dd1b6117fd5bc18625933 to your computer and use it in GitHub Desktop.
Save cmungall/5ffe90b9d56dd1b6117fd5bc18625933 to your computer and use it in GitHub Desktop.
Fetching definitions with OAK

Using OAK to retrieve definitions

For more OAK examples, see

Setup

$ pip install oaklib
$ alias cl="runoak -i sqlite:obo:cl"

Basic lookup

This uses the sqlite version of CL. Note the first time this is executed there will be a lag

$ cl definitions CL:0000540 CL:0000099
id definition
CL:0000540 The basic cellular unit of nervous tissue. Each neuron consists of a body, an axon, and dendrites. Their purpose is to receive, conduct, and transmit impulses in the nervous system.
CL:0000099 Most generally any neuron which is not motor or sensory. Interneurons may also refer to neurons whose axons remain within a particular brain region as contrasted with projection neurons which have axons projecting to other brain regions.
$ cl definitions CL:0000540 CL:0000099 -O yaml
definition: The basic cellular unit of nervous tissue. Each neuron consists of a body,
  an axon, and dendrites. Their purpose is to receive, conduct, and transmit impulses
  in the nervous system.
id: CL:0000540

---
definition: Most generally any neuron which is not motor or sensory. Interneurons
  may also refer to neurons whose axons remain within a particular brain region as
  contrasted with projection neurons which have axons projecting to other brain regions.
id: CL:0000099

Queries

To get definitions for ALL neurons (truncated):

cl definitions .desc//p=i CL:0000540 | head -20
id definition
CL:0000705 None
CL:4023094 A pyramidal neuron which has a distinctive tuft formation, distal from the soma.
CL:4023108 A magnocellular neurosecretory cell that is capable of producing and secreting oxytocin.
CL:1000606 None
CL:1000380 A type I vestibular sensory cell that is part of the epithelium of macula of saccule of membranous labyrinth.
CL:1001582 Neuron of lateral ventricle.
CL:0000555 None
CL:4023128 a KDNy neuron that is located in the rostral periventricular region of the third ventricle.
CL:2000049 Any pyramidal cell that is part of a primary motor cortex.
CL:0000119 Large intrinsic neuron located in the granule layer of the cerebellar cortex that extends its dendrites into the molecular layer where they receive contact from parallel fibers. The axon of the Golgi cell ramifies densely in the granule layer and enters into a complex arrangement with mossy fiber terminals and granule cell dendrites to form the cerebellar glomerulus. Llinas, Walton and Lang. In The Synaptic Organization of the Brain. 5th ed. 2004.
CL:0000687 None
CL:0001031 Granule cell that is part of the cerebellum.
CL:4023027 A sst GABAergic cortical interneuron with a soma found in L5 and possesses 'T-shaped' Martinotti morphologies with local axonal plexus in L5a and translaminar axons restricted to the uppermost part of L1. They show low-threshold spiking patterns with strong rebound firing, and inhibit the L1 apical tuft of nearby pyramidal cells.
CL:4023009 A glutamatergic neuron located in the cerebral cortex that projects to structures not derived from telencephalon.
CL:0010022 A neuron that has its soma in the heart.
CL:0000287 None
CL:0000488 A photoreceptor cell that detects visible light.
CL:4023169 A neuron that is responsible for sensation in the face or motor functions such as biting and chewing. Trigeminal neurons extend a single axon shaft along the lateral white matter of the hindbrain and spinal cord. The highly branched axons innervate the integument of the head.
CL:0005007 Kolmer-Agduhr neurons are ciliated GABAergic neurons that contact the central canal of the spinal cord and have ipsilateral ascending axons.

Using a SPARQL endpoint

Ontobee

$ runoak -i ontobee:cl definitions CL:0000540

This should give the same answer as above (though in theory the backends may be out of sync with the latest version)

Ubergraph

$ runoak -i ubergraph:cl definitions CL:0000540

again, same results.

This is just to demonstrate backend neutrality

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment