Cytoscape is a cross-platform, open source application for visualization and analysis of networks. It is widely used in the field of Systems Biology to visualize different types of biological networks (like protein-protein interactions). It also has a plugin mechanism for extending its core functionality. Cytoscape is written in Java, so this open the possibility of using Processing to create Cytoscape plugins. I just put together a small template for creating Processing plugins for Cytoscape using Eclipse, keep reading for more details.
Besides using Processing’s API to write Cytoscape plugins, it is also posible to load Processing libraries from within the plugin. This allows for OpenGL-accelerated graphics, video and audio capabilities, rendering of complex geometries, connection to other hardware devices (Arduino, sensors), etc. The first version of the template (based on Sojamo‘s template for Processing libraries) is available here. This initial template has one issue, which is that closing the plugin window will close the entire application.
How to use? First unzip the file and import the project from Eclipse. Add the cytoscape.jar and core.jar files to the /lib folder, and then open the build.xml ant file located in /resources. This file compiles the plugin and puts the resulting jar in the /distribution folder. To install the plugin in Cytoscape, copy this jar to the plugins folder of Cytoscape.
The template also includes a class for simplifying the debugging of the plugin, PluginDebug. Running the project as a Java application from the Eclipse IDE will show all the Main classes available in the project (most of them come from cytoscape.jar). Choose “PluginDebug – processing.plugin”, which should launch an instance of cytoscape and install the plugin in its menu.