Skip to content

Commit

Permalink
Merge pull request #21 from TheJacksonLaboratory/release_v0.1.4
Browse files Browse the repository at this point in the history
Release v0.1.4
  • Loading branch information
ielis authored Apr 14, 2023
2 parents 171cdd6 + 9c1d10e commit 12104ff
Show file tree
Hide file tree
Showing 15 changed files with 531 additions and 128 deletions.
131 changes: 51 additions & 80 deletions notebooks/Tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
{
"cell_type": "markdown",
"id": "6e41fb89-d16e-427f-8e53-ec92710af8c8",
"metadata": {},
"metadata": {
"tags": []
},
"source": [
"# Load HPO\n",
"\n",
Expand All @@ -49,7 +51,7 @@
"from hpotk.ontology import Ontology\n",
"from hpotk.ontology.load.obographs import load_ontology\n",
"\n",
"o: Ontology = load_ontology('https://raw.githubusercontent.com/obophenotype/human-phenotype-ontology/master/hp.json')"
"o: Ontology = load_ontology('http://purl.obolibrary.org/obo/hp.json')"
]
},
{
Expand All @@ -65,7 +67,9 @@
{
"cell_type": "markdown",
"id": "a98ea987-741a-42fa-8ae1-5924d77647ff",
"metadata": {},
"metadata": {
"tags": []
},
"source": [
"# Ontology data model and functionality\n",
"\n",
Expand All @@ -77,8 +81,11 @@
" - `name`, `str` (e.g. `Arachnodactyly`)\n",
" - `is_current`/`is_obsolete`, whether or not the concept has been obsoleted\n",
" - `alt_term_ids`, a sequence of obsolete `TermId`s that represented the term previously\n",
"- `hpotk.model.Term` - the complete info regarding the ontology concept. The `Term` has all attributes of the `MinimalTerm` plus `definition` and `comment`\n",
"\n",
"- `hpotk.model.Term` - the complete info regarding the ontology concept. The `Term` has all attributes of the `MinimalTerm` plus the following:\n",
" - `definition` - an optional description of the term in slightly more verbiage\n",
" - `comment` - additional comment (optional)\n",
" - `synonyms` - alternative designations of the `Term` (optional)\n",
" - `xrefs` - a sequence of cross-references between the `Term` and concepts from different databases\n",
"- `hpotk.ontology.MinimalOntology` - the container for ontology data that uses `MinimalTerm`s\n",
"- `hpotk.ontology.Ontology` - the ontology data container that contains `Term`s\n",
"- `hpotk.graph.OntologyGraph` - a specification of graph for storing the ontology concept hierarchy and the required graph functionality. As long as the graph implements the methods, it can work with the rest of the toolkit framework\n",
Expand Down Expand Up @@ -132,7 +139,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Term(identifier=HP:0000001, name=\"All\", definition=None, comment=Root of all terms in the Human Phenotype Ontology., is_obsolete=False, alt_term_ids=\"[]\")\n"
"Term(identifier=HP:0000001, name=\"All\", definition=None, comment=Root of all terms in the Human Phenotype Ontology., synonyms=None, xrefs=[DefaultTermId(idx=4, value=UMLS:C0444868)], is_obsolete=False, alt_term_ids=\"[]\")\n"
]
}
],
Expand All @@ -157,7 +164,7 @@
{
"data": {
"text/plain": [
"16874"
"17138"
]
},
"execution_count": 4,
Expand Down Expand Up @@ -252,7 +259,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Term(identifier=HP:0001166, name=\"Arachnodactyly\", definition=Abnormally long and slender fingers (\"spider fingers\")., comment=None, is_obsolete=False, alt_term_ids=\"[DefaultTermId(idx=2, value=HP:0001505)]\")\n"
"Term(identifier=HP:0001166, name=\"Arachnodactyly\", definition=Abnormally long and slender fingers (\"spider fingers\")., comment=None, synonyms=[Synonym(name=\"Long slender fingers\", category=SynonymCategory.EXACT, synonym_type=SynonymType.LAYPERSON_TERM, xrefs=\"None\"), Synonym(name=\"Long, slender fingers\", category=SynonymCategory.EXACT, synonym_type=None, xrefs=\"None\"), Synonym(name=\"Spider fingers\", category=SynonymCategory.EXACT, synonym_type=SynonymType.LAYPERSON_TERM, xrefs=\"None\")], xrefs=[DefaultTermId(idx=3, value=MSH:D054119), DefaultTermId(idx=11, value=SNOMEDCT_US:62250003), DefaultTermId(idx=4, value=UMLS:C0003706)], is_obsolete=False, alt_term_ids=\"[DefaultTermId(idx=2, value=HP:0001505)]\")\n"
]
}
],
Expand All @@ -261,42 +268,6 @@
"print(arachnodactyly)"
]
},
{
"cell_type": "markdown",
"id": "68f50a4f-bef6-4cfc-afbe-ebeb1dbdc298",
"metadata": {},
"source": [
"As described above, each term has:\n",
"- `identifier` - a `hpotk.model.TermId` corresponding to term's CURIE \n",
"- `name` - term's name (e.g. *\"Hypertension\"*)\n",
"- `alt_term_ids` - alternative term IDs - term ids of obsoleted terms that have been replaced by this term\n",
"- `is_obsolete` - obsoletion status"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "b9285dbf-4248-4fe1-821c-732dfe1c90f8",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"ID: HP:0001166\n",
"Name: Arachnodactyly\n",
"Alt ids: ['HP:0001505']\n",
"Is obsolete: False\n"
]
}
],
"source": [
"print(f'ID: {arachnodactyly.identifier.value}')\n",
"print(f'Name: {arachnodactyly.name}')\n",
"print(f'Alt ids: {[str(at) for at in arachnodactyly.alt_term_ids]}')\n",
"print(f'Is obsolete: {arachnodactyly.is_obsolete}')"
]
},
{
"cell_type": "markdown",
"id": "70d5ee3d-2329-4094-8b9a-1c09dde7147f",
Expand All @@ -307,7 +278,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 9,
"id": "7763a3f8-9487-4ccc-ac20-06333fe3fd37",
"metadata": {},
"outputs": [],
Expand All @@ -331,7 +302,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 10,
"id": "fd90ffa7-9cd4-4557-8c36-e7c1ba7b5c64",
"metadata": {},
"outputs": [
Expand All @@ -344,21 +315,21 @@
"HP:0001238 - Slender finger\n",
"\n",
"#################### Ancestors ##################\n",
"HP:0000118 - Phenotypic abnormality\n",
"HP:0000924 - Abnormality of the skeletal system\n",
"HP:0000001 - All\n",
"HP:0040064 - Abnormality of limbs\n",
"HP:0002817 - Abnormality of the upper limb\n",
"HP:0040068 - Abnormality of limb bone\n",
"HP:0011842 - Abnormal skeletal morphology\n",
"HP:0011844 - Abnormal appendicular skeleton morphology\n",
"HP:0001167 - Abnormal finger morphology\n",
"HP:0033127 - Abnormality of the musculoskeletal system\n",
"HP:0100807 - Long fingers\n",
"HP:0001167 - Abnormality of finger\n",
"HP:0000001 - All\n",
"HP:0011844 - Abnormal appendicular skeleton morphology\n",
"HP:0001238 - Slender finger\n",
"HP:0002813 - Abnormality of limb bone morphology\n",
"HP:0000118 - Phenotypic abnormality\n",
"HP:0001155 - Abnormality of the hand\n",
"HP:0033127 - Abnormality of the musculoskeletal system\n",
"HP:0002817 - Abnormality of the upper limb\n",
"HP:0011297 - Abnormal digit morphology\n",
"HP:0002813 - Abnormality of limb bone morphology\n",
"HP:0040064 - Abnormality of limbs\n",
"HP:0001238 - Slender finger\n"
"HP:0011842 - Abnormal skeletal morphology\n"
]
}
],
Expand Down Expand Up @@ -386,7 +357,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 11,
"id": "e74d9f8c-20af-4a1d-a8b2-81ec90708b30",
"metadata": {
"tags": []
Expand All @@ -397,8 +368,8 @@
"output_type": "stream",
"text": [
"#################### Children ####################\n",
"HP:0001166 - Arachnodactyly\n",
"HP:0001182 - Tapered finger\n",
"HP:0001166 - Arachnodactyly\n",
"\n",
"#################### Descendants #################\n",
"HP:0006216 - Single interphalangeal crease of fifth finger\n",
Expand Down Expand Up @@ -439,7 +410,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 12,
"id": "3b2f58cc-e008-4153-96b5-1abbd4db9e47",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -487,7 +458,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 13,
"id": "0e668a54-c146-47be-921e-72ab29ee7d28",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -531,7 +502,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 14,
"id": "b575229e-1c08-4d02-aaa3-012c9a8c80bd",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -571,7 +542,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 15,
"id": "654026c8-0e98-45ee-b245-0fa72f8498c3",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -616,7 +587,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 16,
"id": "215903d1-5c3f-4b0f-8fa0-486ef272f5a8",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -645,7 +616,7 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 17,
"id": "0b1e1b30-e70e-4ec9-89c9-5c702d24ea25",
"metadata": {},
"outputs": [
Expand All @@ -672,7 +643,7 @@
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": 18,
"id": "5c4bf517-3e4c-4444-9ada-8bdd9cdcbbbe",
"metadata": {
"tags": []
Expand All @@ -684,7 +655,7 @@
"HpoFrequency(identifier=HP:0040283, lower_bound=0.05, upper_bound=0.29)"
]
},
"execution_count": 19,
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -705,7 +676,7 @@
},
{
"cell_type": "code",
"execution_count": 20,
"execution_count": 19,
"id": "03e7bc93-a58e-422e-a9e1-b04f40956dfb",
"metadata": {
"tags": []
Expand All @@ -728,7 +699,7 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 20,
"id": "7daaab3e-6ead-4230-88d5-b8c080b3730b",
"metadata": {
"tags": []
Expand Down Expand Up @@ -759,7 +730,7 @@
},
{
"cell_type": "code",
"execution_count": 22,
"execution_count": 21,
"id": "d7bf2281-d8ed-4373-b094-ef7df0c60aa8",
"metadata": {
"tags": []
Expand Down Expand Up @@ -790,7 +761,7 @@
},
{
"cell_type": "code",
"execution_count": 23,
"execution_count": 22,
"id": "2ddccd09-43d8-448d-8df1-f55ae8eeb658",
"metadata": {
"tags": []
Expand Down Expand Up @@ -821,7 +792,7 @@
},
{
"cell_type": "code",
"execution_count": 24,
"execution_count": 23,
"id": "0c183a9c-802b-43a1-8bf9-b0e81e5a26f1",
"metadata": {
"tags": []
Expand Down Expand Up @@ -867,7 +838,7 @@
},
{
"cell_type": "code",
"execution_count": 25,
"execution_count": 24,
"id": "9b5e5216-abde-4b8e-888b-fd12b43ce92e",
"metadata": {
"tags": []
Expand All @@ -876,10 +847,10 @@
{
"data": {
"text/plain": [
"'Parsed 12606 diseases'"
"'Parsed 12429 diseases'"
]
},
"execution_count": 25,
"execution_count": 24,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -905,7 +876,7 @@
},
{
"cell_type": "code",
"execution_count": 26,
"execution_count": 25,
"id": "b4303dc6-a653-4720-8a50-0600d655b679",
"metadata": {
"tags": []
Expand All @@ -915,7 +886,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"HpoDisease(identifier=OMIM:203400, name=Corticosterone methyloxidase type I deficiency, n_annotations=12)\n"
"HpoDisease(identifier=OMIM:619340, name=Developmental and epileptic encephalopathy 96, n_annotations=9)\n"
]
}
],
Expand All @@ -933,7 +904,7 @@
},
{
"cell_type": "code",
"execution_count": 27,
"execution_count": 26,
"id": "45035d68-baad-4e69-ab51-5e9c9e0aad86",
"metadata": {
"tags": []
Expand All @@ -943,7 +914,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"OMIM:203400\n"
"OMIM:619340\n"
]
}
],
Expand All @@ -962,7 +933,7 @@
},
{
"cell_type": "code",
"execution_count": 28,
"execution_count": 27,
"id": "e061b854-2218-4355-8a9f-d6ef9988f588",
"metadata": {
"tags": []
Expand Down Expand Up @@ -995,7 +966,7 @@
},
{
"cell_type": "code",
"execution_count": 29,
"execution_count": 28,
"id": "2faad640-4765-49c5-9eba-535018782e5b",
"metadata": {
"tags": []
Expand Down
2 changes: 1 addition & 1 deletion recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% set name = "hpo-toolkit" %}
{% set version = "0.1.3post0" %}
{% set version = "0.1.4" %}

package:
name: {{ name|lower }}
Expand Down
2 changes: 1 addition & 1 deletion src/hpotk/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.1.3post0"
__version__ = "0.1.4"

from . import model
from . import constants
Expand Down
Loading

0 comments on commit 12104ff

Please sign in to comment.