Access ontologies: cell type, tissue, disease, phenotype#

When it comes to ontology defined vocabularies, such as cell type, tissue, disease, and phenotype, the entity class extends to have the ontology accessible via {entity}.ontology

import bionty as bt
/home/runner/work/bionty/bionty/.nox/build-package-bionty/lib/python3.9/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html
  from .autonotebook import tqdm as notebook_tqdm

All available ontologies and their versions can be printed with:

bt.display_available_versions()
Version Ontology URL
Bionty class Source key
Species ensembl release-108 Ensembl https://ftp.ensembl.org/pub/release-108/mysql/
Gene ensembl release-108 Ensembl https://ftp.ensembl.org/pub/release-108/mysql/
ensembl release-107 Ensembl https://ftp.ensembl.org/pub/release-107/mysql/
Protein uniprot 2022-04 Uniprot https://ftp.uniprot.org/pub/databases/uniprot/...
uniprot 2022-03 Uniprot https://ftp.uniprot.org/pub/databases/uniprot/...
CellMarker cellmarker 2.0 CellMarker http://bio-bigdata.hrbmu.edu.cn/CellMarker/Cel...
CellLine clo 2022-03-21 Cell Line Ontology https://data.bioontology.org/ontologies/CLO/su...
CellType cl 2023-02-15 Cell Ontology http://purl.obolibrary.org/obo/cl/releases/202...
cl 2022-08-16 Cell Ontology http://purl.obolibrary.org/obo/cl/releases/202...
ca 2022-12-16 Human Cell Atlas Ontology https://www.ebi.ac.uk/ols/ontologies/hcao/down...
Tissue uberon 2023-02-14 Uberon multi-species anatomy ontology http://purl.obolibrary.org/obo/uberon/releases...
uberon 2022-08-19 Uberon multi-species anatomy ontology http://purl.obolibrary.org/obo/uberon/releases...
Disease mondo 2023-02-06 Mondo Disease Ontology http://purl.obolibrary.org/obo/mondo/releases/...
mondo 2022-10-11 Mondo Disease Ontology http://purl.obolibrary.org/obo/mondo/releases/...
doid 2023-01-30 Human Disease Ontology http://purl.obolibrary.org/obo/doid/releases/2...
Readout efo 3.48.0 The Experimental Factor Ontology http://www.ebi.ac.uk/efo/releases/v3.48.0/efo.owl
Phenotype hp 2023-01-27 Human Phenotype Ontology https://github.com/obophenotype/human-phenotyp...
Pathway go 2023-05-10 Gene Ontology https://data.bioontology.org/ontologies/GO/sub...
pw 7.78 Pathway Ontology https://data.bioontology.org/ontologies/PW/dow...
BFXPipeline lamin 1.0.0 Bioinformatics Pipeline s3://bionty-assets/bfxpipelines.json
Drug dron 2023-03-10 Drug Ontology https://data.bioontology.org/ontologies/DRON/s...

The currently used versions can be shown with:

bt.display_active_versions()
Source key Version
Bionty class
Species ensembl release-108
Gene ensembl release-108
Protein uniprot 2022-04
CellMarker cellmarker 2.0
CellLine clo 2022-03-21
CellType cl 2023-02-15
Tissue uberon 2023-02-14
Disease mondo 2023-02-06
Readout efo 3.48.0
Phenotype hp 2023-01-27
Pathway go 2023-05-10
BFXPipeline lamin 1.0.0
Drug dron 2023-03-10

Cell Type#

Here we look at cell type as an example:

ct = bt.CellType()
df = ct.df()
df.head()
name definition synonyms children
ontology_id
CL:0000000 cell A Material Entity Of Anatomical Origin (Part O... None [CL:0001034, CL:0000003, CL:0001061]
CL:0000001 primary cultured cell A Cultured Cell That Is Freshly Isolated From ... primary cell culture cell|unpassaged cultured ... []
CL:0000003 native cell A Cell That Is Found In A Natural Setting, Whi... None [CL:0000039, CL:0000325, CL:0011115, CL:000021...
CL:0000005 fibroblast neural crest derived Any Fibroblast That Is Deriived From The Neura... None []
CL:0000006 neuronal receptor cell None neuronal receptor cell (sensu Animalia) [CL:0000204, CL:0000376, CL:1000082, CL:000021...

again you may look up the vocabulary using .lookup by tab completion

lookup = bt.CellType().lookup()
lookup.astrocyte
cell_type(ontology_id='CL:0000127', name='astrocyte', definition="A Class Of Large Neuroglial (Macroglial) Cells In The Central Nervous System - The Largest And Most Numerous Neuroglial Cells In The Brain And Spinal Cord. Astrocytes (From 'Star' Cells) Are Irregularly Shaped With Many Long Processes, Including Those With 'End Feet' Which Form The Glial (Limiting) Membrane And Directly And Indirectly Contribute To The Blood-Brain Barrier. They Regulate The Extracellular Ionic And Chemical Environment, And 'Reactive Astrocytes' (Along With Microglia) Respond To Injury.", synonyms='astrocytic glia', children=array(['CL:0000683', 'CL:0002603', 'CL:0002605', 'CL:0012000',
       'CL:0000645', 'CL:0002604', 'CL:0002626', 'CL:0002627',
       'CL:0000644', 'CL:0002606'], dtype=object))
lookup.astrocyte.definition
"A Class Of Large Neuroglial (Macroglial) Cells In The Central Nervous System - The Largest And Most Numerous Neuroglial Cells In The Brain And Spinal Cord. Astrocytes (From 'Star' Cells) Are Irregularly Shaped With Many Long Processes, Including Those With 'End Feet' Which Form The Glial (Limiting) Membrane And Directly And Indirectly Contribute To The Blood-Brain Barrier. They Regulate The Extracellular Ionic And Chemical Environment, And 'Reactive Astrocytes' (Along With Microglia) Respond To Injury."
lookup.astrocyte.synonyms
'astrocytic glia'
lookup.astrocyte.children
array(['CL:0000683', 'CL:0002603', 'CL:0002605', 'CL:0012000',
       'CL:0000645', 'CL:0002604', 'CL:0002626', 'CL:0002627',
       'CL:0000644', 'CL:0002606'], dtype=object)

pronto Ontology object is accessible via as .ontology

pronto_ontology = ct.ontology
pronto_ontology
Ontology('/home/runner/work/bionty/bionty/.nox/build-package-bionty/lib/python3.9/site-packages/bionty/_dynamic/human___cl___2023-02-15___CellType', timeout=100)

tissue, disease, and phenotype work similary

Tissue#

tissue = bt.Tissue()
df = tissue.df()
df.head()
name definition synonyms children
ontology_id
UBERON:0000000 processual entity An Occurrent [Span:Occurrent] That Exists In T... None [UBERON:0000104, UBERON:0035943, UBERON:0000105]
UBERON:0000002 uterine cervix Lower, Narrow Portion Of The Uterus Where It J... neck of uterus|cervix uteri|caudal segment of ... []
UBERON:0000003 naris Orifice Of The Olfactory System. The Naris Is ... None [UBERON:0010425, UBERON:0005928, UBERON:0005931]
UBERON:0000004 nose The Olfactory Organ Of Vertebrates, Consisting... peripheral olfactory organ|nasal sac|nose []
UBERON:0000005 chemosensory organ None chemosensory sensory organ [UBERON:0003212]
lookup = tissue.lookup()
lookup.kidney
tissue(ontology_id='UBERON:0002113', name='kidney', definition='A Paired Organ Of The Urinary Tract Which Has The Production Of Urine As Its Primary Function.', synonyms=None, children=array(['UBERON:0004538', 'UBERON:0000081', 'UBERON:0004539',
       'UBERON:0000082', 'UBERON:0002120', 'UBERON:0000080'], dtype=object))

Disease#

disease = bt.Disease()
df = disease.df()
df.head()
name definition synonyms children
ontology_id
MONDO:0000001 disease or disorder A Disease Is A Disposition To Undergo Patholog... medical condition|other disease|disorders|dise... [MONDO:0100336, MONDO:0005583, MONDO:0700096]
MONDO:0000004 adrenocortical insufficiency An Endocrine Or Hormonal Disorder That Occurs ... hypocortisolemia|adrenal cortical insufficienc... [MONDO:0043370, MONDO:0015129]
MONDO:0000005 alopecia, isolated None None [MONDO:0007082, MONDO:0007184, MONDO:0010410, ...
MONDO:0000009 inherited bleeding disorder, platelet-type None bleeding disorder, platelet-type [MONDO:0008552, MONDO:0012354, MONDO:0014078, ...
MONDO:0000014 colorblindness, partial None None [MONDO:0010564]
lookup = disease.lookup()
lookup.chronic_kidney_disease
disease(ontology_id='MONDO:0005300', name='chronic kidney disease', definition='Impairment Of The Renal Function Secondary To Chronic Kidney Damage Persisting For Three Or More Months.', synonyms='renal failure - chronic|chronic renal disease|kidney disease, chronic|CKD|chronic kidney disease|CKD - chronic kidney disease', children=array(['MONDO:0001184', 'MONDO:0004375', 'MONDO:0001110', 'MONDO:0005016',
       'MONDO:0024327'], dtype=object))

Phenotype#

phenotype = bt.Phenotype()
df = phenotype.df()
df.head()
name definition synonyms children
ontology_id
HP:0000001 All None None [HP:0040279, HP:0012823, HP:0032443, HP:000011...
HP:0000002 Abnormality of body height Deviation From The Norm Of Height With Respect... Abnormality of body height [HP:0004322, HP:0012772, HP:0000098]
HP:0000003 Multicystic kidney dysplasia Multicystic Dysplasia Of The Kidney Is Charact... Multicystic dysplastic kidney|Multicystic kidn... []
HP:0000005 Mode of inheritance The Pattern In Which A Particular Genetic Trai... Inheritance [HP:0001442, HP:0034335, HP:0001426, HP:003434...
HP:0000006 Autosomal dominant inheritance A Mode Of Inheritance That Is Observed For Tra... monoallelic_autosomal|Autosomal dominant []
lookup = phenotype.lookup()
lookup.Abnormal_blood_glucose_concentration
phenotype(ontology_id='HP:0011015', name='Abnormal blood glucose concentration', definition='An Abnormality Of The Concentration Of Glucose In The Blood.', synonyms='Abnormality of blood glucose concentration', children=array(['HP:0001943', 'HP:0003074'], dtype=object))

Readout#

Readout parses Experimental Factor Ontology to the following additonal categories for describing biological experiments:

  • molecule

  • instrument

  • measurement

readout = bt.Readout()
df = readout.df()
df.head()
name definition synonyms children molecule instrument measurement
ontology_id
EFO:0011021 BRCA1 mutation carier status Determination Of The Presence Or Absence Of Kn... BRCA1 carrier status|BRCA1 mutation status [] None None carrier status
EFO:0011022 BRCA2 mutation carier statu Determination Of The Presence Or Absence Of Kn... BRCA2 carrier status|BRCA2 mutation status [] None None carrier status
EFO:0700000 spatial proteomics An Assay That Allows For Visualization And Qua... None [EFO:0700001, EFO:0700002] protein assay None None
EFO:0700001 PhenoCycler-Fusion A Spatial Discovery System Where Whole-Slide S... None [] protein assay None None
EFO:0700002 PhenoCycler An Automated Fluidics System That Uses Oligonu... None [] protein assay None None
lookup = readout.lookup()

Look up a molecular readout:

lookup.single_cell_RNA_sequencing
readout(ontology_id='EFO:0008913', name='single-cell RNA sequencing', definition='A Protocol That Provides The Expression Profiles Of Single Cells Via The Isolation And Barcoding Of Single Cells And Their Rna, Reverse Transcription, Amplification, Library Generation And Sequencing.', synonyms='single-cell RNA-seq|single cell RNA sequencing|scRNA-seq|single-cell transcriptome sequencing', children=array(['EFO:0008441', 'EFO:0030059', 'EFO:0005684', 'EFO:0700003',
       'EFO:0008440', 'EFO:0700004', 'EFO:0030060', 'EFO:0005685'],
      dtype=object), molecule='RNA assay', instrument='single cell sequencing', measurement=None)

Lookup a phenotypic readout:

lookup.tumor_size
readout(ontology_id='EFO:0004134', name='tumor size', definition='The Physical Size Of A Tumor.', synonyms='size of tumor', children=array([], dtype=object), molecule=None, instrument=None, measurement='tumor size')