{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "### Loading Models" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In order to fetch models from **Cell Collective**, simply use the `client.get` (resource) function with the resource name as the parameter." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Begin by importing the ccapi module into your workspace." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import ccapi" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now, let’s try creating a client object in order to interact with services provided by [Cell Collective](https://cellcollective.org)." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "client = ccapi.Client()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Authenticate your client using a ***password flow type authentication*** scheme.\n", "\n", "**NOTE**: *Before you can authenticate using ccapi, you must first register an application of the appropriate type on [Cell Collective](https://cellcollective.org). If you do not require a user context, it is read only.*" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "client.auth(email = \"test@cellcollective.org\", password = \"test\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Fetch all models." ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
IDNameDescriptionTagsAuthorCreatedUpdated (Biologic)Updated (Knowledge Base)
2309EGFR & ErbB SignalingThe epidermal growth factor receptor (EGFR) signaling...Epidermal growth factor, Mammalian, Rac, Cdc42, EGFRR Samaga et. al.2013-12-19 18:12:482018-04-15 09:15:582017-07-17 16:50:24
5128Lac OperonOur model includes the two main glucose control mecha...bistability, lac operon, E. coliVeliz-Cuba A and Stingler B.2016-11-08 10:38:262016-12-19 15:58:312016-12-06 12:28:14
10248Bacteriophages in Cheese Production - Single Vat 2 (I...Audrey Crowther2017-10-13 13:22:292018-11-14 20:20:092017-10-13 13:22:29
141066Simulating the Behavior of Cellular Respiration (Atte...The purpose of this learning module is to explore the...2020-10-01 21:29:072020-10-01 21:29:222020-10-01 21:29:07
2314IL-6 SignallingThe pro-inflammatory cytokines interleukin 1 (IL-1) a...IL-6, Interleukin, Inflammatory responseRyll A et. al.2014-01-11 00:01:022017-05-18 13:46:502017-05-18 14:36:14
\n", " " ], "text/plain": [ "[,\n", " ,\n", " ,\n", " ,\n", " ]" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "models = client.get(\"model\")\n", "models" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Paginating through Models\n", "\n", "By default, a `client.get` attempts to fetch you a maximum of 5 resources. In order to fetch more resources, you can paginate as follows:" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
IDNameDescriptionTagsAuthorCreatedUpdated (Biologic)Updated (Knowledge Base)
16659Modeling Light Reactions and Dark Reactions in Photos...2018-09-04 10:50:182018-10-18 15:09:362018-09-13 11:41:51
1557Signal Transduction in FibroblastsThis model represents a set of generic, commonly expr...Signal transduction, Epidermal growth factor, EGFR, G...2011-06-06 19:53:132016-01-22 07:08:462017-11-29 12:07:57
6678CD4+ T cell DifferentiationThe model includes 38 components and 96 biochemical i...T helper cell, differentiation2017-02-16 12:52:402018-04-12 16:18:242018-04-12 14:19:55
2329Apoptosis NetworkTo understand the design principles of the molecular ...Cell apoptosis, Apoptotic, Programmed cell death, Sig...Mai, Z & Liu, H2014-02-01 14:41:222017-10-13 16:16:102017-10-13 16:16:10
17433Simulating the Behavior of Cellular RespirationThe purpose of this learning module is to explore the...2018-09-14 16:16:122020-10-26 18:40:542018-09-14 16:16:12
105759New Model 22020-03-12 14:29:212020-03-12 14:29:21
105758New Model 12020-03-12 14:29:212020-03-12 14:29:21
8227T-LGL Survival Network 2011 Reduced NetworkThe blood cancer T cell large granular lymphocyte (T-...T-LGL leukemia, SMAD, discrete dynamic model, nuclear...A Saddatpour et. al.2017-07-20 11:02:322017-07-20 16:59:452017-07-20 16:56:54
2084Death Receptor SignalingCytokines such as TNF and FASL can trigger death or s...death receptor, cell fateL Calzone et. al.2013-04-15 10:28:572016-01-22 07:08:46
2341Body Segmentation in Drosophila 2013Drosophila melanogaster, body segmentationM Marques-Pita & LM Rocha2014-02-17 13:34:202017-07-19 12:29:55
153639Computational Modeling Lesson Structure2020-10-19 15:48:312020-11-03 19:50:372020-10-19 15:48:31
36647Cell Cycle Regulation - Investigation 1This is a model of a cell and then (if that cell divi...2019-02-14 09:24:562019-02-18 12:37:312019-02-14 09:24:56
121641Introduction to Food Web Dynamics_Incubator20The purpose of this learning module is to expore how ...2020-06-20 21:39:252020-06-21 16:05:102020-06-20 21:39:25
36652Cell Cycle Tumorigenesis - Investigation 2This is a model of a cell and then (if that cell divi...2019-02-14 11:51:422019-02-18 13:46:202019-02-14 11:51:42
1582Signaling in Macrophage Activation BACKGROUND: The complex yet flexible cellular respon...Macrophage, signal transduction, interleukinsS Raza et. al.2011-09-06 15:26:552016-01-22 07:08:46
\n", " " ], "text/plain": [ "[,\n", " ,\n", " ,\n", " ,\n", " ,\n", " ,\n", " ,\n", " ,\n", " ,\n", " ,\n", " ,\n", " ,\n", " ,\n", " ,\n", " ]" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "models = client.get(\"model\", since = 6, size = 15)\n", "models" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Searching Models\n", "\n", "Use the `client.search` method with the resource name as the first parameter and the query as the second parameter. For instance, let's search for models with species `Cdc20` within it." ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
IDNameDescriptionTagsAuthorCreatedUpdated (Biologic)Updated (Knowledge Base)
2404Budding Yeast Cell CycleIt has been suggested that irreducible sets of states...RG Todd & T Helikar2014-05-30 08:49:372016-01-22 07:08:46
2423Budding Yeast Cell Cycle 2009Abstract The budding yeast Saccharomyces cerevisiae i...DJ Irons2014-06-18 11:38:152016-03-29 23:24:54
2396Mammalian Cell Cycle 2006Motivation: To understand the behaviour of complex bi...Mammalian, Cell cycle, Regulatory networkA Fauré et. al.2014-05-13 18:38:112017-07-19 12:04:562016-03-29 09:14:55
\n", " " ], "text/plain": [ "[,\n", " ,\n", " ]" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "models = client.search(\"model\", \"Cdc20\")\n", "models" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Querying through Models" ] }, { "cell_type": "code", "execution_count": 7, "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", " ID\n", " \n", " \n", " 5128\n", "
\n", " \n", " Name\n", " \n", " \n", " Lac Operon\n", "
\n", " \n", " Memory Address\n", " \n", " \n", " 0x010e5fde50\n", "
\n", " \n", " Number of Versions\n", " \n", " \n", " 1\n", "
\n", " \n", " Versions\n", " \n", " \n", " [<BooleanModel -18759 version 1 at 0x010f859510>]\n", "
" ], "text/plain": [ "" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "models = client.get(\"model\")\n", "model = models.get_by_id(5128)\n", "model" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "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.7.6" } }, "nbformat": 4, "nbformat_minor": 2 }