TableOfContents([2])

Cytoscape developer's tutorial

This tutorial will show some code snippets about how to use Cytoscape APIs on plugin development. Each feature is included in a sample plugin, which can serve as a starting point or template for new plugin developers. The code snippets can also be used as reference for experienced developers.

Cytoscape plugin is usually packaged in a jar file and deployed to the plugins directory of Cytoscape. When Cytoscape starts up and initializes, its plugin manager will look up all the plugins in plugins directory. A plugin should have following three components.

1. A class, which extends CytoscapePlugin. This is the entry point to Cytoscape. 2. A manifest file, explicitly list the class, which extended CytoscapePlugin class 3. A plugin.props file, which list the information about the plugin, such as plugin name, author, release date and more. Although this file is not absolutely required, it is recommended to have one, since plugin manager will need the information to handle the plugin properly. See the page at http://www.cytoscape.org/cgi-bin/moin.cgi/Cytoscape_Plugin_Tutorial for detail about the definition of a plugin.props.

If plugin developer will share and publish their plugins, they are encouraged to submit their plugins to Cytoscape plugin website at http://cytoscape.org/plugins/index.php .

1. How to add a tabbed Panel to Control panel?

It takes three steps to add a tabbed panel to the control panel. (1) Get a handler to the cytoPanel west, which is the control panel CytoPanelImp ctrlPanel = (CytoPanelImp) Cytoscape.getDesktop().getCytoPanel(SwingConstants.WEST);

(2) Create a JPanel object (a class extends JPanel, say, MyPanel) MyPanel myPanel = new MyPanel();

ctrlPanel.add("myPanel", myPanel);

Download a sample plugin, here.

2. How to add an image icon (menu item) to the toolbar?

ImageIcon icon = new ImageIcon(getClass().getResource("/tiger.jpg")); MyPluginToolBarAction toolbarAction = new MyPluginToolBarAction(icon, this); The toolbarAction must extend the class cytoscape.util.CytoscapeAction and its method isInToolBar()returns true.

Cytoscape.getDesktop().getCyMenus().addCytoscapeAction((CytoscapeAction) toolbarAction);

Download a sample plugin, here.

Funding for Cytoscape is provided by a federal grant from the U.S. National Institute of General Medical Sciences (NIGMS) of the Na tional Institutes of Health (NIH) under award number GM070743-01. Corporate funding is provided through a contract from Unilever PLC.

MoinMoin Appliance - Powered by TurnKey Linux