{ "cells": [ { "cell_type": "markdown", "id": "0f6c4513", "metadata": {}, "source": [ "# OAK obsoletes 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 `obsoletes` command, which shows all obsolete entities in an ontology,\n", "plus associated metadata\n", "\n", "## Help Option\n", "\n", "You can get help on any OAK command using `--help`" ] }, { "cell_type": "code", "execution_count": 1, "id": "65db4b53", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Usage: runoak obsoletes [OPTIONS] [TERMS]...\n", "\n", " Shows all obsolete entities.\n", "\n", " Example:\n", "\n", " runoak -i obolibrary:go.obo obsoletes\n", "\n", " To exclude *merged terms*, use the ``--no-include-merged`` flag\n", "\n", " Example:\n", "\n", " runoak -i obolibrary:go.obo obsoletes --no-include-merged\n", "\n", " To show migration relationships, use the ``--show-migration-relationships``\n", " flag\n", "\n", " Example:\n", "\n", " runoak -i obolibrary:go.obo obsoletes --show-migration-relationships\n", "\n", " You can also specify terms to show obsoletes for:\n", "\n", " Example:\n", "\n", " runoak -i obolibrary:go.obo obsoletes --show-migration-relationships\n", " GO:0000187 GO:0000188\n", "\n", "Options:\n", " --include-merged / --no-include-merged\n", " Include merged terms in output [default:\n", " include-merged]\n", " --show-migration-relationships / --no-show-migration-relationships\n", " Show migration relationships (e.g.\n", " replaced_by, consider) [default: no-show-\n", " migration-relationships]\n", " -O, --output-type [obo|obojson|ofn|rdf|json|yaml|fhirjson|csv|nl]\n", " Desired output type\n", " -o, --output FILENAME Output file, e.g. obo file\n", " --help Show this message and exit.\n" ] } ], "source": [ "!runoak obsoletes --help" ] }, { "cell_type": "code", "execution_count": 5, "id": "803bc7b6", "metadata": {}, "outputs": [], "source": [ "alias cl runoak -i sqlite:obo:cl" ] }, { "cell_type": "code", "execution_count": 7, "id": "97e6e346", "metadata": {}, "outputs": [], "source": [ "cl obsoletes > output/cl-obsoletes.tsv" ] }, { "cell_type": "code", "execution_count": 8, "id": "c93883a0", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "id\tlabel\r", "\r\n", "CL:0000002\tobsolete immortal cell line cell\r", "\r\n", "CL:0000004\tobsolete cell by organism\r", "\r\n", "CL:0000009\tobsolete fusiform initial\r", "\r\n", "CL:0000012\tobsolete cell by class\r", "\r\n", "CL:0000013\tobsolete dentine secreting cell\r", "\r\n", "CL:0000045\tobsolete thymus processed stem cell\r", "\r\n", "CL:0000046\tobsolete bursa processed stem cell\r", "\r\n", "CL:0000063\tobsolete cell by histology\r", "\r\n", "CL:0000070\tobsolete epithelial cell of gland\r", "\r\n" ] } ], "source": [ "!head output/cl-obsoletes.tsv" ] }, { "cell_type": "code", "execution_count": 9, "id": "22c0636b", "metadata": {}, "outputs": [], "source": [ "cl obsoletes --show-migration-relationships > output/cl-obsoletes-full.tsv" ] }, { "cell_type": "code", "execution_count": 10, "id": "7b49fb37", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "id\tlabel\tIAO:0100001\toio:consider\r", "\r\n", "CL:0000002\tobsolete immortal cell line cell\t['CLO:0000019']\t[]\r", "\r\n", "CL:0000004\tobsolete cell by organism\t[]\t['CL:0000000', 'CL:0000003', 'CL:0001034']\r", "\r\n", "CL:0000009\tobsolete fusiform initial\t['PO:0000079']\t[]\r", "\r\n", "CL:0000012\tobsolete cell by class\t[]\t['CL:0000000', 'CL:0000003', 'CL:0001034']\r", "\r\n", "CL:0000013\tobsolete dentine secreting cell\t[]\t['CL:0000140']\r", "\r\n", "CL:0000045\tobsolete thymus processed stem cell\t[]\t[]\r", "\r\n", "CL:0000046\tobsolete bursa processed stem cell\t[]\t[]\r", "\r\n", "CL:0000063\tobsolete cell by histology\t[]\t['CL:0000000', 'CL:0000003', 'CL:0001034']\r", "\r\n", "CL:0000070\tobsolete epithelial cell of gland\t[]\t[]\r", "\r\n" ] } ], "source": [ "!head output/cl-obsoletes-full.tsv" ] }, { "cell_type": "code", "execution_count": null, "id": "1017c2b6", "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 }