{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## BioModels\n", "\n", "In this tutorial, we will attempt to import models from [BioModels](https://www.ebi.ac.uk/biomodels) into your account on [Cell Collective](https://cellcollective.org).\n", "\n", "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": [ "Let's import the **[Hamey2017 - Blood stem cell regulatory network](https://www.ebi.ac.uk/biomodels/MODEL1610060000)** from BioModels into Cell Collective.\n", "\n", "You can use the `read_id` routine from `ccapi.services.biomodels` to import a model into [Cell Collective](https://cellcollective.org) using a [BioModels](https://www.ebi.ac.uk/biomodels) identifier." ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "from ccapi.services.biomodels import read_id" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Pass a valid `client` object and a valid BioModels ID." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "ename": "NameError", "evalue": "name 'read_id' is not defined", "output_type": "error", "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mmodel\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mread_id\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mclient\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"e_coli_core\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msave\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mTrue\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2\u001b[0m \u001b[0mmodel\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;31mNameError\u001b[0m: name 'read_id' is not defined" ] } ], "source": [ "model = read_id(client, \"e_coli_core\", save = True)\n", "model" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You can view details about this model by accessing the default version." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This can also be viewed on the UI." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "![]()" ] } ], "metadata": { "file_extension": ".py", "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" }, "mimetype": "text/x-python", "name": "python", "npconvert_exporter": "python", "pygments_lexer": "ipython3", "version": 3 }, "nbformat": 4, "nbformat_minor": 2 }