{ "cells": [ { "cell_type": "markdown", "id": "738137ef", "metadata": {}, "source": [ "# OAK logical-definitions command\n", "\n", "This notebook is intended as a supplement to the [main OAK CLI docs](https://incatools.github.io/ontology-access-kit/cli.html).\n", "\n", "This notebook provides examples for the `logical-definitions` command, which can be used to **lookup and summarize logical defs**\n", "\n", "For more on logical definitions, see [Logical Definitions](https://incatools.github.io/ontology-access-kit/guide/logical-definitions.html) in the OAK guide.\n", "\n", "## Help Option\n", "\n", "You can get help on any OAK command using `--help`" ] }, { "cell_type": "code", "execution_count": 1, "id": "838586ce", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Usage: runoak logical-definitions [OPTIONS] [TERMS]...\r\n", "\r\n", " Show all logical definitions for a term or terms.\r\n", "\r\n", " To show all logical definitions in an ontology, pass the \".all\" query term\r\n", "\r\n", " Example; first create an alias:\r\n", "\r\n", " alias pato=\"runoak -i obo:sqlite:pato\"\r\n", "\r\n", " Then run the query:\r\n", "\r\n", " pato logical-definitions .all\r\n", "\r\n", " By default, \".all\" will query all axioms for all terms including merged\r\n", " terms; to restrict to only the current terms, use an ID query:\r\n", "\r\n", " pato logical-definitions i^PATO\r\n", "\r\n", " You can also restrict to branches:\r\n", "\r\n", " pato logical-definitions .desc//p=i \"physical object quality\"\r\n", "\r\n", " By default, the output is a subset of OboGraph datamodel rendered as YAML,\r\n", " e.g.\r\n", "\r\n", " definedClassId: PATO:0045071 genusIds: - PATO:0001439\r\n", " restrictions: - fillerId: PATO:0000461 propertyId: RO:0015010\r\n", "\r\n", " You can also specify CSV to generate a flattened form of this.\r\n", "\r\n", " Example:\r\n", "\r\n", " pato logical-definitions .all --output-type csv\r\n", "\r\n", " You can optionally choose to \"--matrix-axes\" to transform the output to a\r\n", " matrix form. This is a comma-separated pair of axes, where each element is a\r\n", " logical definition element type: \"f\" for filler, \"p\" for predicate, \"g\" for\r\n", " genus, \"d\" for defined class.\r\n", "\r\n", " Example:\r\n", "\r\n", " - Each property/predicate is a column - For repeated properties, columns of\r\n", " the form prop_1, prop_2, ... are generated\r\n", "\r\n", " Example:\r\n", "\r\n", " pato logical-definitions .all --matrix-axes d,p --output-type csv\r\n", "\r\n", " This will generate a row for each defined class with a logical definition,\r\n", " with columns for each predicate (\"genus\" is treated as a predicate here).\r\n", "\r\n", " Limitations:\r\n", "\r\n", " Currently this only works for definitions that follow a basic genus-\r\n", " differentia pattern, which is what is currently represented in the OboGraph\r\n", " datamodel.\r\n", "\r\n", " Consider using the \"axioms\" command for inspection of complex nested OWL\r\n", " axioms.\r\n", "\r\n", " More examples:\r\n", "\r\n", " https://github.com/INCATools/ontology-access-\r\n", " kit/blob/main/notebooks/Commands/LogicalDefinitions.ipynb\r\n", "\r\n", " Python API:\r\n", "\r\n", " https://incatools.github.io/ontology-access-kit/interfaces/obograph\r\n", "\r\n", " Data model:\r\n", "\r\n", " https://w3id.org/oak/obograph\r\n", "\r\n", "Options:\r\n", " --unmelt / --no-unmelt Flatten to a wide table [default: no-\r\n", " unmelt]\r\n", " --matrix-axes TEXT If specified, transform results to matrix\r\n", " using these row and column axes. Examples:\r\n", " d,p; f,g\r\n", " -p, --predicates TEXT A comma-separated list of predicates. This\r\n", " may be a shorthand (i, p) or CURIE\r\n", " --autolabel / --no-autolabel If set, results will automatically have\r\n", " labels assigned [default: autolabel]\r\n", " -O, --output-type TEXT Desired output type\r\n", " -o, --output FILENAME Output file, e.g. obo file\r\n", " --if-absent [absent-only|present-only]\r\n", " determines behavior when the value is not\r\n", " present or is empty.\r\n", " -S, --set-value TEXT the value to set for all terms for the given\r\n", " property.\r\n", " --help Show this message and exit.\r\n" ] } ], "source": [ "!runoak logical-definitions --help" ] }, { "cell_type": "markdown", "id": "5b899d5c", "metadata": {}, "source": [ "## Set up an alias\n", "\n", "For convenience we will set up an alias for use in this notebook" ] }, { "cell_type": "code", "execution_count": 2, "id": "6050d1a5", "metadata": {}, "outputs": [], "source": [ "alias uberon runoak -i sqlite:obo:uberon" ] }, { "cell_type": "markdown", "id": "c906c109", "metadata": {}, "source": [ "## Fetching logical definitions for individual terms\n", "\n", "First we will pass in a simple list of terms to the command.\n", "\n", "Like most OAK commands, this command accepts lists of either IDs, labels, queries, or boolean combinations thereof" ] }, { "cell_type": "code", "execution_count": 3, "id": "572be78c", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "definedClassId: UBERON:0009565\r\n", "genusIds:\r\n", "- UBERON:0001705\r\n", "restrictions:\r\n", "- fillerId: UBERON:0002389\r\n", " propertyId: BFO:0000050\r\n", "\r\n", "---\r\n", "definedClassId: UBERON:0009567\r\n", "genusIds:\r\n", "- UBERON:0001705\r\n", "restrictions:\r\n", "- fillerId: UBERON:0001466\r\n", " propertyId: BFO:0000050\r\n" ] } ], "source": [ "uberon logical-definitions fingernail toenail" ] }, { "cell_type": "code", "execution_count": 4, "id": "3b3c4afa", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "definedClassId\tdefinedClassId_label\tgenusIds\tgenusIds_label\trestrictions\trestrictionsPropertyIds\trestrictionsPropertyIds_label\trestrictionsFillerIds\trestrictionsFillerIds_label\r", "\r\n", "UBERON:0009565\tnail of manual digit\tUBERON:0001705\tnail\tBFO:0000050=UBERON:0002389\tBFO:0000050\tpart of\tUBERON:0002389\tmanual digit\r", "\r\n", "UBERON:0009567\tnail of pedal digit\tUBERON:0001705\tnail\tBFO:0000050=UBERON:0001466\tBFO:0000050\tpart of\tUBERON:0001466\tpedal digit\r", "\r\n" ] } ], "source": [ "uberon logical-definitions fingernail toenail -O csv" ] }, { "cell_type": "code", "execution_count": 5, "id": "c9900ca0", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[Term]\r\n", "id: UBERON:0009565 ! nail of manual digit\r\n", "intersection_of: UBERON:0001705 ! nail\r\n", "intersection_of: BFO:0000050 UBERON:0002389 ! manual digit\r\n", "\r\n", "\r\n", "[Term]\r\n", "id: UBERON:0009567 ! nail of pedal digit\r\n", "intersection_of: UBERON:0001705 ! nail\r\n", "intersection_of: BFO:0000050 UBERON:0001466 ! pedal digit\r\n", "\r\n", "\r\n" ] } ], "source": [ "uberon logical-definitions fingernail toenail -O obo" ] }, { "cell_type": "markdown", "id": "d08c6000", "metadata": {}, "source": [ "## Matrix views\n", "\n", "We can use the `--matrix-axes` option to summarize a large collection of logical definitions as a wide table.\n", "\n", "This takes two values, separated by a comma:\n", "\n", "- d: defined_class\n", "- f: filler\n", "- g: genus\n", "- p: predicate\n", "\n", "### Define class x Predicate\n", "\n", "In the following example `d,p` will create a matrix whose rows are defined classes and whose columns are predicates" ] }, { "cell_type": "code", "execution_count": 8, "id": "ae4748a0", "metadata": {}, "outputs": [], "source": [ "uberon logical-definitions -p p .desc//p=i \"bone element\" .and .desc//p=i,p UBERON:0002544 --matrix-axes d,p -O csv -o output/uberon-digit-defs-dp.tsv" ] }, { "cell_type": "code", "execution_count": 9, "id": "dcb7bb7e", "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", "
defined_classdefined_class_labelgenusgenus_labelpart_ofpart_of_label
0UBERON:0001436phalanx of manusUBERON:0003221phalanxUBERON:0002389manual digit
1UBERON:0002234proximal phalanx of manusUBERON:0004302proximal phalanxUBERON:0002389manual digit
2UBERON:0004328proximal phalanx of manual digit 2UBERON:0004302proximal phalanxUBERON:0003622manual digit 2
3UBERON:0004329proximal phalanx of manual digit 3UBERON:0004302proximal phalanxUBERON:0003623manual digit 3
4UBERON:0004330proximal phalanx of manual digit 4UBERON:0004302proximal phalanxUBERON:0003624manual digit 4
.....................
59UBERON:0014503proximal phalanx of digit 3UBERON:0004302proximal phalanxUBERON:0006050digit 3
60UBERON:0014504proximal phalanx of digit 4UBERON:0004302proximal phalanxUBERON:0006051digit 4
61UBERON:0014505proximal phalanx of digit 5UBERON:0004302proximal phalanxUBERON:0006052digit 5
62UBERON:0004248pedal digit boneUBERON:0001474bone elementUBERON:0001466pedal digit
63UBERON:0004249manual digit boneUBERON:0001474bone elementUBERON:0002389manual digit
\n", "

64 rows × 6 columns

\n", "
" ], "text/plain": [ " defined_class defined_class_label genus \\\n", "0 UBERON:0001436 phalanx of manus UBERON:0003221 \n", "1 UBERON:0002234 proximal phalanx of manus UBERON:0004302 \n", "2 UBERON:0004328 proximal phalanx of manual digit 2 UBERON:0004302 \n", "3 UBERON:0004329 proximal phalanx of manual digit 3 UBERON:0004302 \n", "4 UBERON:0004330 proximal phalanx of manual digit 4 UBERON:0004302 \n", ".. ... ... ... \n", "59 UBERON:0014503 proximal phalanx of digit 3 UBERON:0004302 \n", "60 UBERON:0014504 proximal phalanx of digit 4 UBERON:0004302 \n", "61 UBERON:0014505 proximal phalanx of digit 5 UBERON:0004302 \n", "62 UBERON:0004248 pedal digit bone UBERON:0001474 \n", "63 UBERON:0004249 manual digit bone UBERON:0001474 \n", "\n", " genus_label part_of part_of_label \n", "0 phalanx UBERON:0002389 manual digit \n", "1 proximal phalanx UBERON:0002389 manual digit \n", "2 proximal phalanx UBERON:0003622 manual digit 2 \n", "3 proximal phalanx UBERON:0003623 manual digit 3 \n", "4 proximal phalanx UBERON:0003624 manual digit 4 \n", ".. ... ... ... \n", "59 proximal phalanx UBERON:0006050 digit 3 \n", "60 proximal phalanx UBERON:0006051 digit 4 \n", "61 proximal phalanx UBERON:0006052 digit 5 \n", "62 bone element UBERON:0001466 pedal digit \n", "63 bone element UBERON:0002389 manual digit \n", "\n", "[64 rows x 6 columns]" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import pandas as pd\n", "df = pd.read_csv(\"output/uberon-digit-defs-dp.tsv\", sep=\"\\t\")\n", "df" ] }, { "cell_type": "markdown", "id": "7448e67f", "metadata": {}, "source": [ "### Filler x Genus\n", "\n", "We can flip this around, and have each row be a filler (`f`) and each column be a genus (`g`)." ] }, { "cell_type": "code", "execution_count": 18, "id": "27ef3274", "metadata": {}, "outputs": [], "source": [ "uberon logical-definitions -p p .desc//p=i \"bone element\" .and .desc//p=i,p UBERON:0002544 --matrix-axes f,g -O csv -o output/uberon-digit-defs-fg.tsv" ] }, { "cell_type": "code", "execution_count": 19, "id": "d9357cb9", "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", "
fillerfiller_labelphalanxphalanx_labelproximal_phalanxproximal_phalanx_labelmiddle_phalanxmiddle_phalanx_labeldistal_phalanxdistal_phalanx_labelbone_elementbone_element_label
0UBERON:0002387pesUBERON:0001449phalanx of pesNaNNaNNaNNaNNaNNaNNaNNaN
1UBERON:0009563pastern region of limbUBERON:0009558pastern boneNaNNaNNaNNaNNaNNaNNaNNaN
2UBERON:0002389manual digitUBERON:0001436phalanx of manusUBERON:0002234proximal phalanx of manusUBERON:0003864middle phalanx of manusUBERON:0003865distal phalanx of manusUBERON:0004249manual digit bone
3UBERON:0003622manual digit 2UBERON:0003636manual digit 2 phalanxUBERON:0004328proximal phalanx of manual digit 2UBERON:0004320middle phalanx of manual digit 2UBERON:0004311distal phalanx of manual digit 2NaNNaN
4UBERON:0003623manual digit 3UBERON:0003637manual digit 3 phalanxUBERON:0004329proximal phalanx of manual digit 3UBERON:0004321middle phalanx of manual digit 3UBERON:0004312distal phalanx of manual digit 3NaNNaN
5UBERON:0003624manual digit 4UBERON:0003638manual digit 4 phalanxUBERON:0004330proximal phalanx of manual digit 4UBERON:0004322middle phalanx of manual digit 4UBERON:0004313distal phalanx of manual digit 4NaNNaN
6UBERON:0001463manual digit 1UBERON:0003620manual digit 1 phalanxUBERON:0004338proximal phalanx of manual digit 1NaNNaNUBERON:0004337distal phalanx of manual digit 1NaNNaN
7UBERON:0003625manual digit 5UBERON:0003639manual digit 5 phalanxUBERON:0004331proximal phalanx of manual digit 5UBERON:0004323middle phalanx of manual digit 5UBERON:0004314distal phalanx of manual digit 5NaNNaN
8UBERON:0001466pedal digitNaNNaNUBERON:0003868proximal phalanx of pesUBERON:0003866middle phalanx of pesUBERON:0003867distal phalanx of pesUBERON:0004248pedal digit bone
9UBERON:0003632pedal digit 2UBERON:0003641pedal digit 2 phalanxUBERON:0004333proximal phalanx of pedal digit 2UBERON:0004324middle phalanx of pedal digit 2UBERON:0004316distal phalanx of pedal digit 2NaNNaN
10UBERON:0003633pedal digit 3UBERON:0003642pedal digit 3 phalanxUBERON:0004334proximal phalanx of pedal digit 3UBERON:0004325middle phalanx of pedal digit 3UBERON:0004317distal phalanx of pedal digit 3NaNNaN
11UBERON:0003634pedal digit 4UBERON:0003862pedal digit 4 phalanxUBERON:0004335proximal phalanx of pedal digit 4UBERON:0004326middle phalanx of pedal digit 4UBERON:0004318distal phalanx of pedal digit 4NaNNaN
12UBERON:0003631pedal digit 1UBERON:0003640pedal digit 1 phalanxUBERON:0004332proximal phalanx of pedal digit 1NaNNaNUBERON:0004315distal phalanx of pedal digit 1NaNNaN
13UBERON:0003635pedal digit 5UBERON:0003863pedal digit 5 phalanxUBERON:0004336proximal phalanx of pedal digit 5UBERON:0004327middle phalanx of pedal digit 5UBERON:0004319distal phalanx of pedal digit 5NaNNaN
14UBERON:0012137pedal digit 7UBERON:4100009pedal digit 7 phalanxNaNNaNNaNNaNNaNNaNNaNNaN
15UBERON:0006049digit 2NaNNaNUBERON:0014502proximal phalanx of digit 2UBERON:0014488middle phalanx of digit 2UBERON:0014484distal phalanx of digit 2NaNNaN
16UBERON:0006050digit 3NaNNaNUBERON:0014503proximal phalanx of digit 3UBERON:0014489middle phalanx of digit 3UBERON:0014485distal phalanx of digit 3NaNNaN
17UBERON:0006051digit 4NaNNaNUBERON:0014504proximal phalanx of digit 4UBERON:0014490middle phalanx of digit 4UBERON:0014486distal phalanx of digit 4NaNNaN
18UBERON:0006048digit 1NaNNaNUBERON:0014501proximal phalanx of digit 1NaNNaNUBERON:0014483distal phalanx of digit 1NaNNaN
19UBERON:0006052digit 5NaNNaNUBERON:0014505proximal phalanx of digit 5UBERON:0014491middle phalanx of digit 5UBERON:0014487distal phalanx of digit 5NaNNaN
\n", "
" ], "text/plain": [ " filler filler_label phalanx \\\n", "0 UBERON:0002387 pes UBERON:0001449 \n", "1 UBERON:0009563 pastern region of limb UBERON:0009558 \n", "2 UBERON:0002389 manual digit UBERON:0001436 \n", "3 UBERON:0003622 manual digit 2 UBERON:0003636 \n", "4 UBERON:0003623 manual digit 3 UBERON:0003637 \n", "5 UBERON:0003624 manual digit 4 UBERON:0003638 \n", "6 UBERON:0001463 manual digit 1 UBERON:0003620 \n", "7 UBERON:0003625 manual digit 5 UBERON:0003639 \n", "8 UBERON:0001466 pedal digit NaN \n", "9 UBERON:0003632 pedal digit 2 UBERON:0003641 \n", "10 UBERON:0003633 pedal digit 3 UBERON:0003642 \n", "11 UBERON:0003634 pedal digit 4 UBERON:0003862 \n", "12 UBERON:0003631 pedal digit 1 UBERON:0003640 \n", "13 UBERON:0003635 pedal digit 5 UBERON:0003863 \n", "14 UBERON:0012137 pedal digit 7 UBERON:4100009 \n", "15 UBERON:0006049 digit 2 NaN \n", "16 UBERON:0006050 digit 3 NaN \n", "17 UBERON:0006051 digit 4 NaN \n", "18 UBERON:0006048 digit 1 NaN \n", "19 UBERON:0006052 digit 5 NaN \n", "\n", " phalanx_label proximal_phalanx \\\n", "0 phalanx of pes NaN \n", "1 pastern bone NaN \n", "2 phalanx of manus UBERON:0002234 \n", "3 manual digit 2 phalanx UBERON:0004328 \n", "4 manual digit 3 phalanx UBERON:0004329 \n", "5 manual digit 4 phalanx UBERON:0004330 \n", "6 manual digit 1 phalanx UBERON:0004338 \n", "7 manual digit 5 phalanx UBERON:0004331 \n", "8 NaN UBERON:0003868 \n", "9 pedal digit 2 phalanx UBERON:0004333 \n", "10 pedal digit 3 phalanx UBERON:0004334 \n", "11 pedal digit 4 phalanx UBERON:0004335 \n", "12 pedal digit 1 phalanx UBERON:0004332 \n", "13 pedal digit 5 phalanx UBERON:0004336 \n", "14 pedal digit 7 phalanx NaN \n", "15 NaN UBERON:0014502 \n", "16 NaN UBERON:0014503 \n", "17 NaN UBERON:0014504 \n", "18 NaN UBERON:0014501 \n", "19 NaN UBERON:0014505 \n", "\n", " proximal_phalanx_label middle_phalanx \\\n", "0 NaN NaN \n", "1 NaN NaN \n", "2 proximal phalanx of manus UBERON:0003864 \n", "3 proximal phalanx of manual digit 2 UBERON:0004320 \n", "4 proximal phalanx of manual digit 3 UBERON:0004321 \n", "5 proximal phalanx of manual digit 4 UBERON:0004322 \n", "6 proximal phalanx of manual digit 1 NaN \n", "7 proximal phalanx of manual digit 5 UBERON:0004323 \n", "8 proximal phalanx of pes UBERON:0003866 \n", "9 proximal phalanx of pedal digit 2 UBERON:0004324 \n", "10 proximal phalanx of pedal digit 3 UBERON:0004325 \n", "11 proximal phalanx of pedal digit 4 UBERON:0004326 \n", "12 proximal phalanx of pedal digit 1 NaN \n", "13 proximal phalanx of pedal digit 5 UBERON:0004327 \n", "14 NaN NaN \n", "15 proximal phalanx of digit 2 UBERON:0014488 \n", "16 proximal phalanx of digit 3 UBERON:0014489 \n", "17 proximal phalanx of digit 4 UBERON:0014490 \n", "18 proximal phalanx of digit 1 NaN \n", "19 proximal phalanx of digit 5 UBERON:0014491 \n", "\n", " middle_phalanx_label distal_phalanx \\\n", "0 NaN NaN \n", "1 NaN NaN \n", "2 middle phalanx of manus UBERON:0003865 \n", "3 middle phalanx of manual digit 2 UBERON:0004311 \n", "4 middle phalanx of manual digit 3 UBERON:0004312 \n", "5 middle phalanx of manual digit 4 UBERON:0004313 \n", "6 NaN UBERON:0004337 \n", "7 middle phalanx of manual digit 5 UBERON:0004314 \n", "8 middle phalanx of pes UBERON:0003867 \n", "9 middle phalanx of pedal digit 2 UBERON:0004316 \n", "10 middle phalanx of pedal digit 3 UBERON:0004317 \n", "11 middle phalanx of pedal digit 4 UBERON:0004318 \n", "12 NaN UBERON:0004315 \n", "13 middle phalanx of pedal digit 5 UBERON:0004319 \n", "14 NaN NaN \n", "15 middle phalanx of digit 2 UBERON:0014484 \n", "16 middle phalanx of digit 3 UBERON:0014485 \n", "17 middle phalanx of digit 4 UBERON:0014486 \n", "18 NaN UBERON:0014483 \n", "19 middle phalanx of digit 5 UBERON:0014487 \n", "\n", " distal_phalanx_label bone_element bone_element_label \n", "0 NaN NaN NaN \n", "1 NaN NaN NaN \n", "2 distal phalanx of manus UBERON:0004249 manual digit bone \n", "3 distal phalanx of manual digit 2 NaN NaN \n", "4 distal phalanx of manual digit 3 NaN NaN \n", "5 distal phalanx of manual digit 4 NaN NaN \n", "6 distal phalanx of manual digit 1 NaN NaN \n", "7 distal phalanx of manual digit 5 NaN NaN \n", "8 distal phalanx of pes UBERON:0004248 pedal digit bone \n", "9 distal phalanx of pedal digit 2 NaN NaN \n", "10 distal phalanx of pedal digit 3 NaN NaN \n", "11 distal phalanx of pedal digit 4 NaN NaN \n", "12 distal phalanx of pedal digit 1 NaN NaN \n", "13 distal phalanx of pedal digit 5 NaN NaN \n", "14 NaN NaN NaN \n", "15 distal phalanx of digit 2 NaN NaN \n", "16 distal phalanx of digit 3 NaN NaN \n", "17 distal phalanx of digit 4 NaN NaN \n", "18 distal phalanx of digit 1 NaN NaN \n", "19 distal phalanx of digit 5 NaN NaN " ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df = pd.read_csv(\"output/uberon-digit-defs-fg.tsv\", sep=\"\\t\")\n", "df" ] }, { "cell_type": "markdown", "id": "9b6213e2", "metadata": {}, "source": [ "Note that this view immediately shows the *density* of the lattice. We can identify what might potentially be gaps;\n", "\n", "for example, the cells for \"middle phalanx\" and digit 1 of the hand (manual) and foot (pedal) are empty. We might think\n", "this means we left out a potential term. \n", "\n", "However, this omission is actually intentional due to the lack of a middle/intermediate phalanx on the thumb / big toe:\n", " \n", "![img](https://upload.wikimedia.org/wikipedia/commons/thumb/a/ab/Scheme_human_hand_bones-en.svg/800px-Scheme_human_hand_bones-en.svg.png)\n", "\n", "(it may be the case this phalanx is present in other species, in which case a term may be added with negative taxon constraints)" ] }, { "cell_type": "markdown", "id": "78894237", "metadata": {}, "source": [ "## Analyzing and gap filling\n", "\n", "OAK has experimental features for analyzing and gap-filling logical definitions; these are not yet exposed on the command line" ] }, { "cell_type": "code", "execution_count": null, "id": "54e9d757", "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.5" } }, "nbformat": 4, "nbformat_minor": 5 }