This document summarizes Keiichiro Ono's lab meeting presentation about developing a RESTful API for Cytoscape. The presentation covered the motivation for external tools to programmatically access Cytoscape, the design of a new Cytoscape module that exposes a RESTful API, and a proof-of-concept demo. The goal is to make Cytoscape more accessible for hardcore users to embed in automated workflows from languages like R and Python.
4. Problems
- Cytoscape is getting more and more user-friendly
- Lots of GUI-based Apps
- Easy access to interaction databases
- But not hardcore-user-friendly!
- There is no easy way to embed Cytoscape as a part of
larger, automated workflow (using R/Python/etc.)
- We are losing hardcore users (like you) because of this
limitation…
5. THE SMALL TOOLS MANIFESTO FOR BIOINFORMATICS
- Every single tool should do the smallest possible task really well
- Every single tool lives in its own public source code repository
- All tools are free and open source software (FOSS) and come with a
license approved by the Free Software Foundation (FSF).
- Source code should be easy to read and understand by any
competent software developer
- Error conditions and exceptions should be descriptive and handled
in a clear way
- When possible tools should support (Unix) pipes
- When possible tools provide a useful command line interface
- Tools should avoid system dependencies, such as named (absolute)
file paths
- Every single tool comes with a simple build protocol, at least for
Linux
- Software installation and deployment dependencies are handled
through external package management system
https://github.com/pjotrp/bioinformatics
14. Data I/O
- Should be platform-independent
- Need to support multiple environments
- R, Python w/Pandas, MATLAB, Perl, Shell Scripts, or
workflow engine like Kepler/Taverna
- RESTful API
➡ Access Cytoscape data and functions via HTTP, which
is supported by virtually all platforms
15. RESTful API
- Example
- GET http://localhost:9000/networks
➡ Returns all networks in machine-readable format
- GET http://localhost:9000/networks/52
➡ Returns a network with ID 52
- POST http://localhost:9000/networks
➡ Create a new network from the data
16. CRUD
Resource POST (Create) GET (Read) PUT (Update) DELETE
(Delete)
/networks Create a new
network
List all networks Bulk update
network data
Delete all
networks
/networks/SUID Error Show all
information for
the network with
SUID
Update
information for
the network with
SUID
Delete network
with SUID
19. Which Format Should We Support? (1)
- Basic data exchange format in RESTful world
- JSON (JavaScript Object Notation)
- Like XML, not an actual format, just a standard
- For the first version, we will use Cytoscape.js
style JSON
22. Which Format Should We Support? (2)
- Other File Formats
- Networks: GraphML, EdgeList, Adj. Matrix
- Tables: CSV/TSV
- Open Question:
Conversion from Standard Data Structure
- igraph object to JSON
- DataFrame to JSON/CSV
23. Long-Term Goal: Cytoscape Cyberinfrastructure
Internet
Service 1 Service 2
NDEx (DB)
Web Browser
Cytoscape Desktop