Skip to content

Quick Start Guide for R and Python Programmers

dotasek edited this page Feb 20, 2018 · 3 revisions

This page is here for legacy information. For more recent info on accessing Cytoscape through R or Python, please refer to the Cytoscape Automation Repository.


Setup

What you need to start using cyREST

  • Java 8 (REQUIRED! Does NOT wirk with Java 7/6)
  • Cytoscape 3.2.1+
  • cyREST (Installation Guide)

For Python Users

  • Install py2cytoscape: pip install py2cytoscape
  • Some recommended dependencies:
    • requests
    • pandas
    • NetworkX
    • igraph
    • pygraphviz
  • Or, you can simply use Anaconda distribution to install all of popular scientific computing packages at once:

For R Users

  • RStudio (Highly recommended)
  • Recommended packages
    • igraph
    • httr
    • RJSON

Currently, wrapper for R is under development by Bioconductor team. For now, you need to use raw REST API to use cyREST features.

Advanced Users

cyREST is designed to use with other tools to build reproducible workflows. And Docker is recommended to make your analysis environment portable. If you prefer running your notebook/RStudio server in Docker Container, you can find examples from these repositories:

Test Drive

Python

  1. Clone this repository:
  2. Go into the cloned directory
  3. Read this document
  4. Start IPython Notebook: ipython notebook
  5. Click index.ipynb

Note: For Python users, there are two ways to call cyREST features;

  1. Call raw REST API using HTTP client
  2. Use py2cytoscape instead

Essentially, py2cytoscape is a syntactic sugar for Python users. I recommend to use py2cytoscape because it eliminates lots of boilerplate code.

Please read this for more background about this topic.

R

  1. Clone this repository:
  2. Go into the cloned directory
  3. Read this document
  4. Start RStudio
  5. Start from Basic tutorials in the r_markdown directory

Note: We don't have fully-featured R wrapper yet and you need to call raw REST API from R to call cyREST functions. We are working on it with Bioconductor team. Please be patient...

Questions?

Send an email to me (kono at ucsd edu.)