{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## Explore Mappings (xrefs) from Uberon\n", "\n", "Draft notebook showing the xref graph functionality of OntoBio" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "## First fetch ontology\n", "from ontobio.ontol_factory import OntologyFactory\n", "\n", "ofactory = OntologyFactory()\n", "ont = ofactory.create(\"uberon\") ## Connect remotely to Uberon over SPARQL\n", "##\n", "## Note: Jupyter may show '*' to indicate kernel busy while this is being\n", "## fetched - should only take a few seconds. Wait before proceeding" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'UBERON:0006956'" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "## select a class\n", "[cls] = ont.search(\"buccal mucosa\")\n", "cls" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['FMA:59785',\n", " 'http://linkedlifedata.com/resource/umls/id/C1578559',\n", " 'UMLS:C1578559',\n", " 'http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#C12505',\n", " 'CALOHA:TS-2349',\n", " 'http://www.snomedbrowser.com/Codes/Details/16811007',\n", " 'BTO:0003833']" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "## Get xrefs for a class\n", "ont.xrefs(cls)" ] }, { "cell_type": "code", "execution_count": 64, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "100535" ] }, "execution_count": 64, "metadata": {}, "output_type": "execute_result" } ], "source": [ "## Get a networkx graph object\n", "xg = ont.xref_graph\n", "len(xg.edges())" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['FMA:59785',\n", " 'UMLS:C1578559',\n", " 'UMLS:C1578559',\n", " 'NCIT:C12505',\n", " 'CALOHA:TS-2349',\n", " 'SCTID:16811007',\n", " 'BTO:0003833']" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "## Hacky convenience function to deal with URL xrefs\n", "## TODO: use prefixcommons\n", "\n", "def contract_xref(x):\n", " x = x.replace('http://linkedlifedata.com/resource/umls/id/','UMLS:')\n", " x = x.replace('http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#', 'NCIT:')\n", " x = x.replace('http://www.snomedbrowser.com/Codes/Details/', 'SCTID:')\n", " return x\n", "\n", "[contract_xref(x) for x in ont.xrefs(cls)]" ] }, { "cell_type": "code", "execution_count": 54, "metadata": {}, "outputs": [], "source": [ "## Prepare to make a DataFrame\n", "## Each item is a class\n", "## Each column is a database\n", "import pandas as pd\n", "items = []\n", "for c in ont.nodes():\n", " label = ont.label(c)\n", " d = dict(id=c, label=label)\n", " items.append(d)\n", " for x in ont.xrefs(c):\n", " toks = contract_xref(x).split(\":\")\n", " if len(toks) == 2:\n", " d[toks[0]] = toks[1]\n", " \n" ] }, { "cell_type": "code", "execution_count": 55, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
AAOABAAEOAEO_RETIREDANISEEDBAMSBILABILSBMBSA...XtroDOZFAZFA_RETIREDZFSgalenhttphttpsncithesaurusnodeIDspan
idlabel
UBERON:3010014inguinal glands...
UBERON:2000723obsolete slow muscle cell somite 5...0000723
UBERON:0000113post-juvenile adult stage0000113...0000044
UBERON:0006590remnant of embryonic structure...
UBERON:0024559obsolete predominantly gray regional part of habenula...
UBERON:2001409infraorbital 4...0001409
UBERON:0005587rhombomere 7 roof plate...0000951
UBERON:4300088metapterygium bone...
UBERON:0023317obsolete regional part of ventral cochlear nucleus...
UBERON:0002929dentate gyrus pyramidal layer...
UBERON:0000011parasympathetic nervous system0010488...0001575//en.wikipedia.org/wiki/Parasympathetic_nervou...
UBERON:0000325gastric gland...
UBERON:0010884forelimb bone pre-cartilage condensation...
UBERON:0002693occipitotemporal sulcusotsTel-Cx-OTS...//braininfo.rprc.washington.edu/centraldirecto...
UBERON:0001536left common carotid artery plus branches...//en.wikipedia.org/wiki/Left_common_carotid_ar...
UBERON:0004773superior eyelid tarsus...//en.wikipedia.org/wiki/Tarsus_%28eyelids%29
UBERON:0009138right common cardinal vein...
UBERON:0001440forelimb skeleton0000202...
UBERON:0006813nasal skeleton0000320...
UBERON:0005373spinal cord dorsal columndc...//braininfo.rprc.washington.edu/centraldirecto...
\n", "

20 rows × 98 columns

\n", "
" ], "text/plain": [ " AAO \\\n", "id label \n", "UBERON:3010014 inguinal glands \n", "UBERON:2000723 obsolete slow muscle cell somite 5 \n", "UBERON:0000113 post-juvenile adult stage \n", "UBERON:0006590 remnant of embryonic structure \n", "UBERON:0024559 obsolete predominantly gray regional part of ha... \n", "UBERON:2001409 infraorbital 4 \n", "UBERON:0005587 rhombomere 7 roof plate \n", "UBERON:4300088 metapterygium bone \n", "UBERON:0023317 obsolete regional part of ventral cochlear nucleus \n", "UBERON:0002929 dentate gyrus pyramidal layer \n", "UBERON:0000011 parasympathetic nervous system 0010488 \n", "UBERON:0000325 gastric gland \n", "UBERON:0010884 forelimb bone pre-cartilage condensation \n", "UBERON:0002693 occipitotemporal sulcus \n", "UBERON:0001536 left common carotid artery plus branches \n", "UBERON:0004773 superior eyelid tarsus \n", "UBERON:0009138 right common cardinal vein \n", "UBERON:0001440 forelimb skeleton 0000202 \n", "UBERON:0006813 nasal skeleton 0000320 \n", "UBERON:0005373 spinal cord dorsal column \n", "\n", " ABA AEO \\\n", "id label \n", "UBERON:3010014 inguinal glands \n", "UBERON:2000723 obsolete slow muscle cell somite 5 \n", "UBERON:0000113 post-juvenile adult stage \n", "UBERON:0006590 remnant of embryonic structure \n", "UBERON:0024559 obsolete predominantly gray regional part of ha... \n", "UBERON:2001409 infraorbital 4 \n", "UBERON:0005587 rhombomere 7 roof plate \n", "UBERON:4300088 metapterygium bone \n", "UBERON:0023317 obsolete regional part of ventral cochlear nucleus \n", "UBERON:0002929 dentate gyrus pyramidal layer \n", "UBERON:0000011 parasympathetic nervous system \n", "UBERON:0000325 gastric gland \n", "UBERON:0010884 forelimb bone pre-cartilage condensation \n", "UBERON:0002693 occipitotemporal sulcus \n", "UBERON:0001536 left common carotid artery plus branches \n", "UBERON:0004773 superior eyelid tarsus \n", "UBERON:0009138 right common cardinal vein \n", "UBERON:0001440 forelimb skeleton \n", "UBERON:0006813 nasal skeleton \n", "UBERON:0005373 spinal cord dorsal column \n", "\n", " AEO_RETIRED \\\n", "id label \n", "UBERON:3010014 inguinal glands \n", "UBERON:2000723 obsolete slow muscle cell somite 5 \n", "UBERON:0000113 post-juvenile adult stage \n", "UBERON:0006590 remnant of embryonic structure \n", "UBERON:0024559 obsolete predominantly gray regional part of ha... \n", "UBERON:2001409 infraorbital 4 \n", "UBERON:0005587 rhombomere 7 roof plate \n", "UBERON:4300088 metapterygium bone \n", "UBERON:0023317 obsolete regional part of ventral cochlear nucleus \n", "UBERON:0002929 dentate gyrus pyramidal layer \n", "UBERON:0000011 parasympathetic nervous system \n", "UBERON:0000325 gastric gland \n", "UBERON:0010884 forelimb bone pre-cartilage condensation \n", "UBERON:0002693 occipitotemporal sulcus \n", "UBERON:0001536 left common carotid artery plus branches \n", "UBERON:0004773 superior eyelid tarsus \n", "UBERON:0009138 right common cardinal vein \n", "UBERON:0001440 forelimb skeleton \n", "UBERON:0006813 nasal skeleton \n", "UBERON:0005373 spinal cord dorsal column \n", "\n", " ANISEED \\\n", "id label \n", "UBERON:3010014 inguinal glands \n", "UBERON:2000723 obsolete slow muscle cell somite 5 \n", "UBERON:0000113 post-juvenile adult stage \n", "UBERON:0006590 remnant of embryonic structure \n", "UBERON:0024559 obsolete predominantly gray regional part of ha... \n", "UBERON:2001409 infraorbital 4 \n", "UBERON:0005587 rhombomere 7 roof plate \n", "UBERON:4300088 metapterygium bone \n", "UBERON:0023317 obsolete regional part of ventral cochlear nucleus \n", "UBERON:0002929 dentate gyrus pyramidal layer \n", "UBERON:0000011 parasympathetic nervous system \n", "UBERON:0000325 gastric gland \n", "UBERON:0010884 forelimb bone pre-cartilage condensation \n", "UBERON:0002693 occipitotemporal sulcus \n", "UBERON:0001536 left common carotid artery plus branches \n", "UBERON:0004773 superior eyelid tarsus \n", "UBERON:0009138 right common cardinal vein \n", "UBERON:0001440 forelimb skeleton \n", "UBERON:0006813 nasal skeleton \n", "UBERON:0005373 spinal cord dorsal column \n", "\n", " BAMS BILA \\\n", "id label \n", "UBERON:3010014 inguinal glands \n", "UBERON:2000723 obsolete slow muscle cell somite 5 \n", "UBERON:0000113 post-juvenile adult stage \n", "UBERON:0006590 remnant of embryonic structure \n", "UBERON:0024559 obsolete predominantly gray regional part of ha... \n", "UBERON:2001409 infraorbital 4 \n", "UBERON:0005587 rhombomere 7 roof plate \n", "UBERON:4300088 metapterygium bone \n", "UBERON:0023317 obsolete regional part of ventral cochlear nucleus \n", "UBERON:0002929 dentate gyrus pyramidal layer \n", "UBERON:0000011 parasympathetic nervous system \n", "UBERON:0000325 gastric gland \n", "UBERON:0010884 forelimb bone pre-cartilage condensation \n", "UBERON:0002693 occipitotemporal sulcus ots \n", "UBERON:0001536 left common carotid artery plus branches \n", "UBERON:0004773 superior eyelid tarsus \n", "UBERON:0009138 right common cardinal vein \n", "UBERON:0001440 forelimb skeleton \n", "UBERON:0006813 nasal skeleton \n", "UBERON:0005373 spinal cord dorsal column dc \n", "\n", " BILS \\\n", "id label \n", "UBERON:3010014 inguinal glands \n", "UBERON:2000723 obsolete slow muscle cell somite 5 \n", "UBERON:0000113 post-juvenile adult stage 0000113 \n", "UBERON:0006590 remnant of embryonic structure \n", "UBERON:0024559 obsolete predominantly gray regional part of ha... \n", "UBERON:2001409 infraorbital 4 \n", "UBERON:0005587 rhombomere 7 roof plate \n", "UBERON:4300088 metapterygium bone \n", "UBERON:0023317 obsolete regional part of ventral cochlear nucleus \n", "UBERON:0002929 dentate gyrus pyramidal layer \n", "UBERON:0000011 parasympathetic nervous system \n", "UBERON:0000325 gastric gland \n", "UBERON:0010884 forelimb bone pre-cartilage condensation \n", "UBERON:0002693 occipitotemporal sulcus \n", "UBERON:0001536 left common carotid artery plus branches \n", "UBERON:0004773 superior eyelid tarsus \n", "UBERON:0009138 right common cardinal vein \n", "UBERON:0001440 forelimb skeleton \n", "UBERON:0006813 nasal skeleton \n", "UBERON:0005373 spinal cord dorsal column \n", "\n", " BM \\\n", "id label \n", "UBERON:3010014 inguinal glands \n", "UBERON:2000723 obsolete slow muscle cell somite 5 \n", "UBERON:0000113 post-juvenile adult stage \n", "UBERON:0006590 remnant of embryonic structure \n", "UBERON:0024559 obsolete predominantly gray regional part of ha... \n", "UBERON:2001409 infraorbital 4 \n", "UBERON:0005587 rhombomere 7 roof plate \n", "UBERON:4300088 metapterygium bone \n", "UBERON:0023317 obsolete regional part of ventral cochlear nucleus \n", "UBERON:0002929 dentate gyrus pyramidal layer \n", "UBERON:0000011 parasympathetic nervous system \n", "UBERON:0000325 gastric gland \n", "UBERON:0010884 forelimb bone pre-cartilage condensation \n", "UBERON:0002693 occipitotemporal sulcus Tel-Cx-OTS \n", "UBERON:0001536 left common carotid artery plus branches \n", "UBERON:0004773 superior eyelid tarsus \n", "UBERON:0009138 right common cardinal vein \n", "UBERON:0001440 forelimb skeleton \n", "UBERON:0006813 nasal skeleton \n", "UBERON:0005373 spinal cord dorsal column \n", "\n", " BSA ... \\\n", "id label ... \n", "UBERON:3010014 inguinal glands ... \n", "UBERON:2000723 obsolete slow muscle cell somite 5 ... \n", "UBERON:0000113 post-juvenile adult stage ... \n", "UBERON:0006590 remnant of embryonic structure ... \n", "UBERON:0024559 obsolete predominantly gray regional part of ha... ... \n", "UBERON:2001409 infraorbital 4 ... \n", "UBERON:0005587 rhombomere 7 roof plate ... \n", "UBERON:4300088 metapterygium bone ... \n", "UBERON:0023317 obsolete regional part of ventral cochlear nucleus ... \n", "UBERON:0002929 dentate gyrus pyramidal layer ... \n", "UBERON:0000011 parasympathetic nervous system ... \n", "UBERON:0000325 gastric gland ... \n", "UBERON:0010884 forelimb bone pre-cartilage condensation ... \n", "UBERON:0002693 occipitotemporal sulcus ... \n", "UBERON:0001536 left common carotid artery plus branches ... \n", "UBERON:0004773 superior eyelid tarsus ... \n", "UBERON:0009138 right common cardinal vein ... \n", "UBERON:0001440 forelimb skeleton ... \n", "UBERON:0006813 nasal skeleton ... \n", "UBERON:0005373 spinal cord dorsal column ... \n", "\n", " XtroDO \\\n", "id label \n", "UBERON:3010014 inguinal glands \n", "UBERON:2000723 obsolete slow muscle cell somite 5 \n", "UBERON:0000113 post-juvenile adult stage \n", "UBERON:0006590 remnant of embryonic structure \n", "UBERON:0024559 obsolete predominantly gray regional part of ha... \n", "UBERON:2001409 infraorbital 4 \n", "UBERON:0005587 rhombomere 7 roof plate \n", "UBERON:4300088 metapterygium bone \n", "UBERON:0023317 obsolete regional part of ventral cochlear nucleus \n", "UBERON:0002929 dentate gyrus pyramidal layer \n", "UBERON:0000011 parasympathetic nervous system \n", "UBERON:0000325 gastric gland \n", "UBERON:0010884 forelimb bone pre-cartilage condensation \n", "UBERON:0002693 occipitotemporal sulcus \n", "UBERON:0001536 left common carotid artery plus branches \n", "UBERON:0004773 superior eyelid tarsus \n", "UBERON:0009138 right common cardinal vein \n", "UBERON:0001440 forelimb skeleton \n", "UBERON:0006813 nasal skeleton \n", "UBERON:0005373 spinal cord dorsal column \n", "\n", " ZFA \\\n", "id label \n", "UBERON:3010014 inguinal glands \n", "UBERON:2000723 obsolete slow muscle cell somite 5 0000723 \n", "UBERON:0000113 post-juvenile adult stage \n", "UBERON:0006590 remnant of embryonic structure \n", "UBERON:0024559 obsolete predominantly gray regional part of ha... \n", "UBERON:2001409 infraorbital 4 0001409 \n", "UBERON:0005587 rhombomere 7 roof plate 0000951 \n", "UBERON:4300088 metapterygium bone \n", "UBERON:0023317 obsolete regional part of ventral cochlear nucleus \n", "UBERON:0002929 dentate gyrus pyramidal layer \n", "UBERON:0000011 parasympathetic nervous system 0001575 \n", "UBERON:0000325 gastric gland \n", "UBERON:0010884 forelimb bone pre-cartilage condensation \n", "UBERON:0002693 occipitotemporal sulcus \n", "UBERON:0001536 left common carotid artery plus branches \n", "UBERON:0004773 superior eyelid tarsus \n", "UBERON:0009138 right common cardinal vein \n", "UBERON:0001440 forelimb skeleton \n", "UBERON:0006813 nasal skeleton \n", "UBERON:0005373 spinal cord dorsal column \n", "\n", " ZFA_RETIRED \\\n", "id label \n", "UBERON:3010014 inguinal glands \n", "UBERON:2000723 obsolete slow muscle cell somite 5 \n", "UBERON:0000113 post-juvenile adult stage \n", "UBERON:0006590 remnant of embryonic structure \n", "UBERON:0024559 obsolete predominantly gray regional part of ha... \n", "UBERON:2001409 infraorbital 4 \n", "UBERON:0005587 rhombomere 7 roof plate \n", "UBERON:4300088 metapterygium bone \n", "UBERON:0023317 obsolete regional part of ventral cochlear nucleus \n", "UBERON:0002929 dentate gyrus pyramidal layer \n", "UBERON:0000011 parasympathetic nervous system \n", "UBERON:0000325 gastric gland \n", "UBERON:0010884 forelimb bone pre-cartilage condensation \n", "UBERON:0002693 occipitotemporal sulcus \n", "UBERON:0001536 left common carotid artery plus branches \n", "UBERON:0004773 superior eyelid tarsus \n", "UBERON:0009138 right common cardinal vein \n", "UBERON:0001440 forelimb skeleton \n", "UBERON:0006813 nasal skeleton \n", "UBERON:0005373 spinal cord dorsal column \n", "\n", " ZFS \\\n", "id label \n", "UBERON:3010014 inguinal glands \n", "UBERON:2000723 obsolete slow muscle cell somite 5 \n", "UBERON:0000113 post-juvenile adult stage 0000044 \n", "UBERON:0006590 remnant of embryonic structure \n", "UBERON:0024559 obsolete predominantly gray regional part of ha... \n", "UBERON:2001409 infraorbital 4 \n", "UBERON:0005587 rhombomere 7 roof plate \n", "UBERON:4300088 metapterygium bone \n", "UBERON:0023317 obsolete regional part of ventral cochlear nucleus \n", "UBERON:0002929 dentate gyrus pyramidal layer \n", "UBERON:0000011 parasympathetic nervous system \n", "UBERON:0000325 gastric gland \n", "UBERON:0010884 forelimb bone pre-cartilage condensation \n", "UBERON:0002693 occipitotemporal sulcus \n", "UBERON:0001536 left common carotid artery plus branches \n", "UBERON:0004773 superior eyelid tarsus \n", "UBERON:0009138 right common cardinal vein \n", "UBERON:0001440 forelimb skeleton \n", "UBERON:0006813 nasal skeleton \n", "UBERON:0005373 spinal cord dorsal column \n", "\n", " galen \\\n", "id label \n", "UBERON:3010014 inguinal glands \n", "UBERON:2000723 obsolete slow muscle cell somite 5 \n", "UBERON:0000113 post-juvenile adult stage \n", "UBERON:0006590 remnant of embryonic structure \n", "UBERON:0024559 obsolete predominantly gray regional part of ha... \n", "UBERON:2001409 infraorbital 4 \n", "UBERON:0005587 rhombomere 7 roof plate \n", "UBERON:4300088 metapterygium bone \n", "UBERON:0023317 obsolete regional part of ventral cochlear nucleus \n", "UBERON:0002929 dentate gyrus pyramidal layer \n", "UBERON:0000011 parasympathetic nervous system \n", "UBERON:0000325 gastric gland \n", "UBERON:0010884 forelimb bone pre-cartilage condensation \n", "UBERON:0002693 occipitotemporal sulcus \n", "UBERON:0001536 left common carotid artery plus branches \n", "UBERON:0004773 superior eyelid tarsus \n", "UBERON:0009138 right common cardinal vein \n", "UBERON:0001440 forelimb skeleton \n", "UBERON:0006813 nasal skeleton \n", "UBERON:0005373 spinal cord dorsal column \n", "\n", " http \\\n", "id label \n", "UBERON:3010014 inguinal glands \n", "UBERON:2000723 obsolete slow muscle cell somite 5 \n", "UBERON:0000113 post-juvenile adult stage \n", "UBERON:0006590 remnant of embryonic structure \n", "UBERON:0024559 obsolete predominantly gray regional part of ha... \n", "UBERON:2001409 infraorbital 4 \n", "UBERON:0005587 rhombomere 7 roof plate \n", "UBERON:4300088 metapterygium bone \n", "UBERON:0023317 obsolete regional part of ventral cochlear nucleus \n", "UBERON:0002929 dentate gyrus pyramidal layer \n", "UBERON:0000011 parasympathetic nervous system //en.wikipedia.org/wiki/Parasympathetic_nervou... \n", "UBERON:0000325 gastric gland \n", "UBERON:0010884 forelimb bone pre-cartilage condensation \n", "UBERON:0002693 occipitotemporal sulcus //braininfo.rprc.washington.edu/centraldirecto... \n", "UBERON:0001536 left common carotid artery plus branches //en.wikipedia.org/wiki/Left_common_carotid_ar... \n", "UBERON:0004773 superior eyelid tarsus //en.wikipedia.org/wiki/Tarsus_%28eyelids%29 \n", "UBERON:0009138 right common cardinal vein \n", "UBERON:0001440 forelimb skeleton \n", "UBERON:0006813 nasal skeleton \n", "UBERON:0005373 spinal cord dorsal column //braininfo.rprc.washington.edu/centraldirecto... \n", "\n", " https \\\n", "id label \n", "UBERON:3010014 inguinal glands \n", "UBERON:2000723 obsolete slow muscle cell somite 5 \n", "UBERON:0000113 post-juvenile adult stage \n", "UBERON:0006590 remnant of embryonic structure \n", "UBERON:0024559 obsolete predominantly gray regional part of ha... \n", "UBERON:2001409 infraorbital 4 \n", "UBERON:0005587 rhombomere 7 roof plate \n", "UBERON:4300088 metapterygium bone \n", "UBERON:0023317 obsolete regional part of ventral cochlear nucleus \n", "UBERON:0002929 dentate gyrus pyramidal layer \n", "UBERON:0000011 parasympathetic nervous system \n", "UBERON:0000325 gastric gland \n", "UBERON:0010884 forelimb bone pre-cartilage condensation \n", "UBERON:0002693 occipitotemporal sulcus \n", "UBERON:0001536 left common carotid artery plus branches \n", "UBERON:0004773 superior eyelid tarsus \n", "UBERON:0009138 right common cardinal vein \n", "UBERON:0001440 forelimb skeleton \n", "UBERON:0006813 nasal skeleton \n", "UBERON:0005373 spinal cord dorsal column \n", "\n", " ncithesaurus \\\n", "id label \n", "UBERON:3010014 inguinal glands \n", "UBERON:2000723 obsolete slow muscle cell somite 5 \n", "UBERON:0000113 post-juvenile adult stage \n", "UBERON:0006590 remnant of embryonic structure \n", "UBERON:0024559 obsolete predominantly gray regional part of ha... \n", "UBERON:2001409 infraorbital 4 \n", "UBERON:0005587 rhombomere 7 roof plate \n", "UBERON:4300088 metapterygium bone \n", "UBERON:0023317 obsolete regional part of ventral cochlear nucleus \n", "UBERON:0002929 dentate gyrus pyramidal layer \n", "UBERON:0000011 parasympathetic nervous system \n", "UBERON:0000325 gastric gland \n", "UBERON:0010884 forelimb bone pre-cartilage condensation \n", "UBERON:0002693 occipitotemporal sulcus \n", "UBERON:0001536 left common carotid artery plus branches \n", "UBERON:0004773 superior eyelid tarsus \n", "UBERON:0009138 right common cardinal vein \n", "UBERON:0001440 forelimb skeleton \n", "UBERON:0006813 nasal skeleton \n", "UBERON:0005373 spinal cord dorsal column \n", "\n", " nodeID span \n", "id label \n", "UBERON:3010014 inguinal glands \n", "UBERON:2000723 obsolete slow muscle cell somite 5 \n", "UBERON:0000113 post-juvenile adult stage \n", "UBERON:0006590 remnant of embryonic structure \n", "UBERON:0024559 obsolete predominantly gray regional part of ha... \n", "UBERON:2001409 infraorbital 4 \n", "UBERON:0005587 rhombomere 7 roof plate \n", "UBERON:4300088 metapterygium bone \n", "UBERON:0023317 obsolete regional part of ventral cochlear nucleus \n", "UBERON:0002929 dentate gyrus pyramidal layer \n", "UBERON:0000011 parasympathetic nervous system \n", "UBERON:0000325 gastric gland \n", "UBERON:0010884 forelimb bone pre-cartilage condensation \n", "UBERON:0002693 occipitotemporal sulcus \n", "UBERON:0001536 left common carotid artery plus branches \n", "UBERON:0004773 superior eyelid tarsus \n", "UBERON:0009138 right common cardinal vein \n", "UBERON:0001440 forelimb skeleton \n", "UBERON:0006813 nasal skeleton \n", "UBERON:0005373 spinal cord dorsal column \n", "\n", "[20 rows x 98 columns]" ] }, "execution_count": 55, "metadata": {}, "output_type": "execute_result" } ], "source": [ "## Make dataframe\n", "df = pd.DataFrame.from_records(items, index=['id','label'])\n", "df=df.fillna('')\n", "df[0:20]" ] }, { "cell_type": "code", "execution_count": 60, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "id label \n", "UBERON:3010014 inguinal glands \n", "UBERON:2000723 obsolete slow muscle cell somite 5 \n", "UBERON:0000113 post-juvenile adult stage \n", "UBERON:0006590 remnant of embryonic structure \n", "UBERON:0024559 obsolete predominantly gray regional part of habenula \n", "UBERON:2001409 infraorbital 4 \n", "UBERON:0005587 rhombomere 7 roof plate \n", "UBERON:4300088 metapterygium bone \n", "UBERON:0023317 obsolete regional part of ventral cochlear nucleus \n", "UBERON:0002929 dentate gyrus pyramidal layer \n", "UBERON:0000011 parasympathetic nervous system C12764\n", "UBERON:0000325 gastric gland \n", "UBERON:0010884 forelimb bone pre-cartilage condensation \n", "UBERON:0002693 occipitotemporal sulcus \n", "UBERON:0001536 left common carotid artery plus branches C32956\n", "UBERON:0004773 superior eyelid tarsus \n", "UBERON:0009138 right common cardinal vein \n", "UBERON:0001440 forelimb skeleton \n", "UBERON:0006813 nasal skeleton \n", "UBERON:0005373 spinal cord dorsal column C33355\n", "Name: NCIT, dtype: object" ] }, "execution_count": 60, "metadata": {}, "output_type": "execute_result" } ], "source": [ "## Fetch sample of NCIT mappings\n", "df['NCIT'][0:20]" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.5.2" } }, "nbformat": 4, "nbformat_minor": 2 }