{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# CellCollective Knowledge Base\n", "\n", "Models from [CellCollective.org](https://cellcollective.org) can be directly imported by CoLoMoTo tools (such as `bioLQM` or `Pint`) by giving their URL as the argument of the ``.load`` function, for instance, ``lqm = biolqm.load(\"https://cellcollective.org/#2329/apoptosis-network\")``.\n", "\n", "In this notebook, we show how to use the API of the `cellcollective` python module to access metadata of network species, such as UnitProt and NCBI gene identifiers." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import cellcollective" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Model loading from cellcollective.org\n", "\n", "A CellCollective model can be imported using its URL on https://cellcollective.org.\n", "Alternatively, you can also use \"cellcollective://MODEL_ID\" syntax." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ "Downloading http://api.cellcollective.org/model/export/2329?type=SBML" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "sbml = cellcollective.load(\"https://cellcollective.org/#2329/apoptosis-network\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The cellcollective python module supports basic access to the SBML-qual file, including the list of defined qualitative species:" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'A20',\n", " 'AKT',\n", " 'APC',\n", " 'Apaf1',\n", " 'Apoptosis',\n", " 'BAD',\n", " 'BID',\n", " 'BclX',\n", " 'Cas12',\n", " 'Cas3',\n", " 'Cas6',\n", " 'Cas7',\n", " 'Cas8',\n", " 'Cas9',\n", " 'DNADamageEvent',\n", " 'FADD',\n", " 'GF',\n", " 'GFR',\n", " 'IAP',\n", " 'IKK',\n", " 'IkB',\n", " 'JNK',\n", " 'JNKK',\n", " 'MEKK1',\n", " 'Mdm2',\n", " 'Mito',\n", " 'NFkB',\n", " 'NIK',\n", " 'PI3K',\n", " 'PIP2',\n", " 'PIP3',\n", " 'PTEN',\n", " 'RIP',\n", " 'TNF',\n", " 'TNFR1',\n", " 'TNFR2',\n", " 'TRADD',\n", " 'TRAF',\n", " 'TRAF2',\n", " 'cFLIP',\n", " 'p53'}" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sbml.species" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Access metadata\n", "\n", "In most models on CellCollective, authors attached to nodes several metadata, including identifiers of biological species:" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'UniProtID': 'P42574', 'GeneName': 'CASP3', 'NCBIGeneID': '836'}" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sbml.species_metadata(\"Cas3\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The link to UnitProt knowledge or NCBI gene database can be obtained as follows:" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ "[https://www.uniprot.org/uniprot/P42574](https://www.uniprot.org/uniprot/P42574)" ], "text/plain": [ "" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sbml.species_uniprotkb(\"Cas3\")" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ "[https://www.ncbi.nlm.nih.gov/gene/836](https://www.ncbi.nlm.nih.gov/gene/836)" ], "text/plain": [ "" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sbml.species_ncbi_gene(\"Cas3\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "There exists several python interfaces to programmatically query information from these databases:\n", "- using NBCI Gene ID: https://github.com/biocommons/eutils\n", "- using UniProt ID: https://github.com/jdrudolph/uniprot" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Convert to bioLQM for model analysis\n", "\n", "Finally, a CellCollective model can be imported in the `bioLQM` tool, for further processing, such as dynamical analysis and simulations." ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "lqm = cellcollective.to_biolqm(sbml)" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'A20',\n", " 'AKT',\n", " 'APC',\n", " 'Apaf1',\n", " 'Apoptosis',\n", " 'BAD',\n", " 'BID',\n", " 'BclX',\n", " 'Cas12',\n", " 'Cas3',\n", " 'Cas6',\n", " 'Cas7',\n", " 'Cas8',\n", " 'Cas9',\n", " 'DNADamageEvent',\n", " 'FADD',\n", " 'GF',\n", " 'GFR',\n", " 'IAP',\n", " 'IKK',\n", " 'IkB',\n", " 'JNK',\n", " 'JNKK',\n", " 'MEKK1',\n", " 'Mdm2',\n", " 'Mito',\n", " 'NFkB',\n", " 'NIK',\n", " 'PI3K',\n", " 'PIP2',\n", " 'PIP3',\n", " 'PTEN',\n", " 'RIP',\n", " 'TNF',\n", " 'TNFR1',\n", " 'TNFR2',\n", " 'TRADD',\n", " 'TRAF',\n", " 'TRAF2',\n", " 'cFLIP',\n", " 'p53'}" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "set([str(c) for c in lqm.getComponents()])" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python3", "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.7.4" } }, "nbformat": 4, "nbformat_minor": 2 }