This package reads ontologies in OBO format and parses terms into a list in R. It could be used to find where in the tree a specific term is located, and has functionality to map cross-references (such as ICD9, ICD10, OMIM, SNOMED, whatever cross-reference is in the database) to an ontology identifier.
Below is a small demo on how it could be used. For this example, Disease Ontology was used, but it should work with any ontology saved in the OBO format (haven’t tested yet, though).
First, load package into R:
if(!"devtools" %in% installed.packages()) install.packages("devtools")
if(!"oboe" %in% installed.packages()) devtools::install_github("dlindholm/oboe")
library("oboe")
## Loading required package: parallel
Then read OBO file, in this case from an URL to get the latest disease ontology database, but this could of course also be a local file:
doid <- read_obo("http://purl.obolibrary.org/obo/doid.obo")
This parses the OBO file into a list:
head(doid)
## [[1]]
## [[1]]$id
## [1] "DOID:0001816"
##
## [[1]]$name
## [1] "angiosarcoma"
##
## [[1]]$alt_id
## [1] "DOID:267" "DOID:4508"
##
## [[1]]$def
## [1] "A malignant Vascular tumor that results_in rapidly proliferating, extensively infiltrating anaplastic cells derived_from blood vessels and derived_from the lining of irregular blood-filled spaces. [url:http\\://emedicine.medscape.com/article/276512-overview, url:http\\://en.wikipedia.org/wiki/Hemangiosarcoma, url:http\\://www.ncbi.nlm.nih.gov/pubmed/23327728]"
##
## [[1]]$subset
## [1] "NCIthesaurus"
##
## [[1]]$synonym
## [1] "hemangiosarcoma EXACT []"
##
## [[1]]$xref
## [1] "MSH:D006394" "NCI:C3088"
## [3] "NCI:C9275" "SNOMEDCT_US_2016_03_01:33176006"
## [5] "SNOMEDCT_US_2016_03_01:39000009" "SNOMEDCT_US_2016_03_01:403977003"
## [7] "UMLS_CUI:C0018923" "UMLS_CUI:C0854893"
##
## [[1]]$is_a
## [1] "DOID:1115 ! sarcoma"
##
##
## [[2]]
## [[2]]$id
## [1] "DOID:0002116"
##
## [[2]]$name
## [1] "pterygium"
##
## [[2]]$synonym
## [1] "surfer's eye EXACT []"
##
## [[2]]$xref
## [1] "ICD10CM:H11.0" "ICD10CM:H11.00"
## [3] "ICD10CM:H11.009" "ICD9CM:372.4"
## [5] "ICD9CM:372.40" "MSH:D011625"
## [7] "SNOMEDCT_US_2016_03_01:155165000" "SNOMEDCT_US_2016_03_01:193879003"
## [9] "SNOMEDCT_US_2016_03_01:193884009" "SNOMEDCT_US_2016_03_01:77489003"
## [11] "UMLS_CUI:C0033999"
##
## [[2]]$is_a
## [1] "DOID:10124 ! corneal disease"
##
## [[2]]$created_by
## [1] "laronhughes"
##
## [[2]]$creation_date
## [1] "2010-06-30T02:44:30Z"
##
##
## [[3]]
## [[3]]$id
## [1] "DOID:0014667"
##
## [[3]]$name
## [1] "disease of metabolism"
##
## [[3]]$def
## [1] "A disease that involving errors in metabolic processes of building or degradation of molecules. [url:http\\://www.ncbi.nlm.nih.gov/books/NBK22259/]"
##
## [[3]]$subset
## [1] "NCIthesaurus"
##
## [[3]]$synonym
## [1] "metabolic disease EXACT [SNOMEDCT_2005_07_31:75934005]"
##
## [[3]]$xref
## [1] "ICD10CM:E88.9" "ICD9CM:277.9"
## [3] "MSH:D008659" "NCI:C3235"
## [5] "SNOMEDCT_US_2016_03_01:154733004" "SNOMEDCT_US_2016_03_01:190961002"
## [7] "SNOMEDCT_US_2016_03_01:267456000" "SNOMEDCT_US_2016_03_01:30390004"
## [9] "SNOMEDCT_US_2016_03_01:75934005" "UMLS_CUI:C0025517"
##
## [[3]]$is_a
## [1] "DOID:4 ! disease"
##
##
## [[4]]
## [[4]]$id
## [1] "DOID:0050001"
##
## [[4]]$name
## [1] "Actinomadura madurae infectious disease"
##
## [[4]]$subset
## [1] "gram-positive_bacterial_infectious_disease"
##
## [[4]]$is_obsolete
## [1] "true"
##
##
## [[5]]
## [[5]]$id
## [1] "DOID:0050002"
##
## [[5]]$name
## [1] "Actinomadura pelletieri infectious disease"
##
## [[5]]$subset
## [1] "gram-positive_bacterial_infectious_disease"
##
## [[5]]$is_obsolete
## [1] "true"
##
##
## [[6]]
## [[6]]$id
## [1] "DOID:0050003"
##
## [[6]]$name
## [1] "Streptomyces somaliensis infectious disease"
##
## [[6]]$subset
## [1] "gram-positive_bacterial_infectious_disease"
##
## [[6]]$is_obsolete
## [1] "true"
You could then remove the obsolete terms:
doid <- remove_obsolete(doid)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.