{
"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",
" ID | Name | Description | Tags | Author | Created | Updated (Biologic) | Updated (Knowledge Base) | \n",
"
\n",
" \n",
" \n",
" 2309 | EGFR & ErbB Signaling | The epidermal growth factor receptor (EGFR) signaling... | Epidermal growth factor, Mammalian, Rac, Cdc42, EGFR | R Samaga et. al. | 2013-12-19 18:12:48 | 2018-04-15 09:15:58 | 2017-07-17 16:50:24 |
5128 | Lac Operon | Our model includes the two main glucose control mecha... | bistability, lac operon, E. coli | Veliz-Cuba A and Stingler B. | 2016-11-08 10:38:26 | 2016-12-19 15:58:31 | 2016-12-06 12:28:14 |
10248 | Bacteriophages in Cheese Production - Single Vat 2 (I... | | | Audrey Crowther | 2017-10-13 13:22:29 | 2018-11-14 20:20:09 | 2017-10-13 13:22:29 |
141066 | Simulating the Behavior of Cellular Respiration (Atte... | The purpose of this learning module is to explore the... | | | 2020-10-01 21:29:07 | 2020-10-01 21:29:22 | 2020-10-01 21:29:07 |
2314 | IL-6 Signalling | The pro-inflammatory cytokines interleukin 1 (IL-1) a... | IL-6, Interleukin, Inflammatory response | Ryll A et. al. | 2014-01-11 00:01:02 | 2017-05-18 13:46:50 | 2017-05-18 14:36:14 |
\n",
" \n",
"
\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",
" ID | Name | Description | Tags | Author | Created | Updated (Biologic) | Updated (Knowledge Base) | \n",
"
\n",
" \n",
" \n",
" 16659 | Modeling Light Reactions and Dark Reactions in Photos... | | | | 2018-09-04 10:50:18 | 2018-10-18 15:09:36 | 2018-09-13 11:41:51 |
1557 | Signal Transduction in Fibroblasts | This model represents a set of generic, commonly expr... | Signal transduction, Epidermal growth factor, EGFR, G... | | 2011-06-06 19:53:13 | 2016-01-22 07:08:46 | 2017-11-29 12:07:57 |
6678 | CD4+ T cell Differentiation | The model includes 38 components and 96 biochemical i... | T helper cell, differentiation | | 2017-02-16 12:52:40 | 2018-04-12 16:18:24 | 2018-04-12 14:19:55 |
2329 | Apoptosis Network | To understand the design principles of the molecular ... | Cell apoptosis, Apoptotic, Programmed cell death, Sig... | Mai, Z & Liu, H | 2014-02-01 14:41:22 | 2017-10-13 16:16:10 | 2017-10-13 16:16:10 |
17433 | Simulating the Behavior of Cellular Respiration | The purpose of this learning module is to explore the... | | | 2018-09-14 16:16:12 | 2020-10-26 18:40:54 | 2018-09-14 16:16:12 |
105759 | New Model 2 | | | | 2020-03-12 14:29:21 | 2020-03-12 14:29:21 | |
105758 | New Model 1 | | | | 2020-03-12 14:29:21 | 2020-03-12 14:29:21 | |
8227 | T-LGL Survival Network 2011 Reduced Network | The 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:32 | 2017-07-20 16:59:45 | 2017-07-20 16:56:54 |
2084 | Death Receptor Signaling | Cytokines such as TNF and FASL can trigger death or s... | death receptor, cell fate | L Calzone et. al. | 2013-04-15 10:28:57 | 2016-01-22 07:08:46 | |
2341 | Body Segmentation in Drosophila 2013 | Drosophila melanogaster, body segmentation | | M Marques-Pita & LM Rocha | 2014-02-17 13:34:20 | 2017-07-19 12:29:55 | |
153639 | Computational Modeling Lesson Structure | | | | 2020-10-19 15:48:31 | 2020-11-03 19:50:37 | 2020-10-19 15:48:31 |
36647 | Cell Cycle Regulation - Investigation 1 | This is a model of a cell and then (if that cell divi... | | | 2019-02-14 09:24:56 | 2019-02-18 12:37:31 | 2019-02-14 09:24:56 |
121641 | Introduction to Food Web Dynamics_Incubator20 | The purpose of this learning module is to expore how ... | | | 2020-06-20 21:39:25 | 2020-06-21 16:05:10 | 2020-06-20 21:39:25 |
36652 | Cell Cycle Tumorigenesis - Investigation 2 | This is a model of a cell and then (if that cell divi... | | | 2019-02-14 11:51:42 | 2019-02-18 13:46:20 | 2019-02-14 11:51:42 |
1582 | Signaling in Macrophage Activation | BACKGROUND: The complex yet flexible cellular respon... | Macrophage, signal transduction, interleukins | S Raza et. al. | 2011-09-06 15:26:55 | 2016-01-22 07:08:46 | |
\n",
" \n",
"
\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",
" ID | Name | Description | Tags | Author | Created | Updated (Biologic) | Updated (Knowledge Base) | \n",
"
\n",
" \n",
" \n",
" 2404 | Budding Yeast Cell Cycle | It has been suggested that irreducible sets of states... | | RG Todd & T Helikar | 2014-05-30 08:49:37 | 2016-01-22 07:08:46 | |
2423 | Budding Yeast Cell Cycle 2009 | Abstract The budding yeast Saccharomyces cerevisiae i... | | DJ Irons | 2014-06-18 11:38:15 | 2016-03-29 23:24:54 | |
2396 | Mammalian Cell Cycle 2006 | Motivation: To understand the behaviour of complex bi... | Mammalian, Cell cycle, Regulatory network | A Fauré et. al. | 2014-05-13 18:38:11 | 2017-07-19 12:04:56 | 2016-03-29 09:14:55 |
\n",
" \n",
"
\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",
" ID\n",
" \n",
" | \n",
" \n",
" 5128\n",
" | \n",
"
\n",
" \n",
" \n",
" \n",
" Name\n",
" \n",
" | \n",
" \n",
" Lac Operon\n",
" | \n",
"
\n",
" \n",
" \n",
" \n",
" Memory Address\n",
" \n",
" | \n",
" \n",
" 0x010e5fde50\n",
" | \n",
"
\n",
" \n",
" \n",
" \n",
" Number of Versions\n",
" \n",
" | \n",
" \n",
" 1\n",
" | \n",
"
\n",
" \n",
" \n",
" \n",
" Versions\n",
" \n",
" | \n",
" \n",
" [<BooleanModel -18759 version 1 at 0x010f859510>]\n",
" | \n",
"
\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
}