Skip to content

Instantly share code, notes, and snippets.

@kozo2
Last active July 8, 2023 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kozo2/a76d96a2ff21cddf2c1a313e63ee31df to your computer and use it in GitHub Desktop.
Save kozo2/a76d96a2ff21cddf2c1a313e63ee31df to your computer and use it in GitHub Desktop.
pywikipathways

pywikipathways and py4cytoscape

by Kozo Nishida, Barry Demchak, Alexander Pico

pywikipathways 0.0.2
py4cytoscape 0.0.10

WikiPathways is a well-known repository for biological pathways that provides unique tools to the research community for content creation, editing and utilization [@Pico2008].

Python is a powerful programming language and environment for statistical and exploratory data analysis.

pywikipathways leverages the WikiPathways API to communicate between Python and WikiPathways, allowing any pathway to be queried, interrogated and downloaded in both data and image formats. Queries are typically performed based on “Xrefs”, standardized identifiers for genes, proteins and metabolites. Once you can identified a pathway, you can use the WPID (WikiPathways identifier) to make additional queries.

py4cytoscape leverages the CyREST API to provide a number of functions related to network visualization and analysis.

Prerequisites

In addition to this pywikipathways package, you’ll also need to install cytoscape and py4cytoscape:

!pip install pywikipathways

The whole point of py4cytoscape is to connect with Cytoscape. You will need to install and launch Cytoscape:

NOTE: To run this notebook, you must manually start Cytoscape first – don’t proceed until you have started Cytoscape.

Setup required only in a remote notebook environment

If you’re using a remote Jupyter Notebook environment such as Google Colab, run the cell below. (If you’re running a local Jupyter Notebook server on the desktop machine same with Cytoscape, you don’t need to do that.)

_PY4CYTOSCAPE = 'git+https://github.com/cytoscape/py4cytoscape@0.0.10'
import requests
exec(requests.get("https://raw.githubusercontent.com/cytoscape/jupyter-bridge/master/client/p4c_init.py").text)
IPython.display.Javascript(_PY4CYTOSCAPE_BROWSER_CLIENT_JS) # Start browser client

Getting started

First, confirm that you have everything installed and running:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment