-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update basic notebook to remove deprecated or updated methods, add se…
- Loading branch information
1 parent
312bae6
commit 1ac1ac4
Showing
2 changed files
with
208 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"id": "667f0480", | ||
"metadata": {}, | ||
"source": [ | ||
"## Loading from obo files using Pronto" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 15, | ||
"id": "d0255749", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from oaklib.implementations.ubergraph.ubergraph_implementation import UbergraphImplementation\n", | ||
"from oaklib.resource import OntologyResource" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "74879ed0", | ||
"metadata": {}, | ||
"source": [ | ||
"### Remote (downloading from OBO)\n", | ||
"\n", | ||
"Next we use pronto's load from obo library feature" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 17, | ||
"id": "33fd0318", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"oi = UbergraphImplementation()\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "82b8e42a", | ||
"metadata": {}, | ||
"source": [ | ||
"note this slight lag in executing the command above - while this method relieves\n", | ||
"the need to manage and synchronize files locally there is an initial network startup\n", | ||
"penalty" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 18, | ||
"id": "6bb78662", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"BFO:0000050 = ['GO:0005737']\n", | ||
"COB:0000072 = ['GO:0005737']\n", | ||
"rdfs:subClassOf = ['GO:0043231']\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"rels = oi.outgoing_relationship_map(\"GO:0005773\")\n", | ||
"for k, v in rels.items():\n", | ||
" print(f\"{k} = {v}\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 24, | ||
"id": "81adbff6", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"70.18670393071754\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"ic = oi.get_information_content(\"GO:0005773\")\n", | ||
"print(ic)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "26221506", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"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.9.13" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
Oops, something went wrong.