{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Visualizing time series metabolome profile\n", "\n", "by Kozo Nishida (Riken, Japan)\n", "\n", "\n", "## Software Requirments\n", "\n", "Please install the following software packages to run this workflow:\n", "\n", "* [KEGGscape](http://apps.cytoscape.org/apps/keggscape)\n", "* [enhancedGraphics](http://apps.cytoscape.org/apps/enhancedgraphics)\n", "\n", "\n", "### Background\n", "This is a sample workflow to automate complex Cytoscape data integaration/visualization process. Please read the following document for more background: \n", "\n", "* https://github.com/idekerlab/KEGGscape/wiki/How-to-visualize-time-series-metabolome-profile\n" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import json\n", "import requests\n", "import pandas as pd\n", "\n", "PORT_NUMBER = 1234\n", "BASE_URL = \"http://localhost:\" + str(PORT_NUMBER) + \"/v1/\"\n", "HEADERS = {'Content-Type': 'application/json'}" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Load a KGML pathway data file from KEGG REST API" ] }, { "cell_type": "code", "execution_count": 11, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Pathway SUID = 71718\n" ] } ], "source": [ "pathway_location = \"http://rest.kegg.jp/get/ath00020/kgml\"\n", "res1 = requests.post(BASE_URL + \"networks?source=url\", data=json.dumps([pathway_location]), headers=HEADERS)\n", "result = json.loads(res1.content)\n", "pathway_suid = result[0][\"networkSUID\"][0]\n", "\n", "print(\"Pathway SUID = \" + str(pathway_suid))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Load table data file as Pandas DataFrame" ] }, { "cell_type": "code", "execution_count": 12, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\n", " | Metabolite | \n", "KEGG | \n", "ld20t14 | \n", "ld20t16 | \n", "ld20t20 | \n", "ld20t24 | \n", "ld20t28 | \n", "ld20t32 | \n", "ld20t36 | \n", "ld20t40 | \n", "ld20t44 | \n", "ld20t48 | \n", "ld20t52 | \n", "ld20t56 | \n", "ld20t60 | \n", "ld20t64 | \n", "ld20t68 | \n", "ld20t72 | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "Alanine | \n", "C00041 | \n", "-0.051007 | \n", "0.040631 | \n", "-0.165335 | \n", "-0.126382 | \n", "-0.093879 | \n", "-0.102625 | \n", "0.009509 | \n", "0.051824 | \n", "-0.137530 | \n", "-0.140400 | \n", "-0.116827 | \n", "-0.060302 | \n", "0.027001 | \n", "0.081365 | \n", "-0.060153 | \n", "-0.097988 | \n", "
1 | \n", "Valine | \n", "C00183 | \n", "-0.025403 | \n", "-0.003585 | \n", "-0.058986 | \n", "-0.069280 | \n", "-0.129784 | \n", "-0.092210 | \n", "0.009129 | \n", "-0.068003 | \n", "-0.105905 | \n", "-0.097984 | \n", "-0.095181 | \n", "-0.021911 | \n", "-0.021224 | \n", "-0.028314 | \n", "-0.032834 | \n", "-0.025435 | \n", "
2 | \n", "Leucine | \n", "C00123 | \n", "-0.005918 | \n", "0.058287 | \n", "-0.049900 | \n", "-0.075853 | \n", "-0.098339 | \n", "-0.003847 | \n", "0.056037 | \n", "-0.104399 | \n", "-0.122298 | \n", "-0.098051 | \n", "-0.082529 | \n", "0.027760 | \n", "-0.006289 | \n", "-0.048610 | \n", "-0.042620 | \n", "-0.000897 | \n", "
3 | \n", "Isoleucine | \n", "C00407 | \n", "0.079870 | \n", "0.101324 | \n", "-0.103993 | \n", "-0.041534 | \n", "-0.020148 | \n", "0.066486 | \n", "0.091006 | \n", "-0.027547 | \n", "-0.193494 | \n", "-0.144676 | \n", "-0.015375 | \n", "0.070540 | \n", "0.118164 | \n", "0.013795 | \n", "-0.060418 | \n", "-0.042314 | \n", "
4 | \n", "Glycine | \n", "C00037 | \n", "-0.056155 | \n", "-0.185757 | \n", "-0.857195 | \n", "-0.725952 | \n", "-0.051028 | \n", "0.069038 | \n", "0.042867 | \n", "0.098185 | \n", "-0.445921 | \n", "-0.893788 | \n", "-0.201299 | \n", "0.000000 | \n", "-0.064322 | \n", "-0.090597 | \n", "-0.637518 | \n", "-0.874438 | \n", "