Differences between revisions 4 and 5
Revision 4 as of 2012-03-19 20:19:11
Size: 2625
Editor: server2
Comment:
Revision 5 as of 2012-03-19 20:21:26
Size: 3977
Editor: server2
Comment:
Deletions are marked like this. Additions are marked like this.
Line 25: Line 25:

== Introduction ==
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.

    A class, which extends CytoscapePlugin. This is the entry point to Cytoscape.

    A manifest file, explicitly list the class, which extended CytoscapePlugin class

    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 .

About the cookbook

To help app developers to develop their own app, the Cytoscape developer team developed the cookbook, a collection of small apps. The cookbook could be used to

  1. get your feet wet
  2. find a template project to extend
  3. find out how to do something in Cytoscape.

How to use the cookbook?

SVN repository: http://chianti.ucsd.edu/svn/core3/support/trunk/samples/

Steps:

  1. Check out sample project from SVN repository with the above URL
  2. Compile with “mvn clean install”
  3. Copy the jar in the project target directory to Cytoscape installation: bundles/apps
  4. Start Cytoscape 3.0

The list of app examples in the cookbook

The list of sample apps is basically the same as in the cookbook for Cytoscape 2.X. They are mostly Cytoscape Bundle apps, but also include a few Simple apps. Some of them are,

Introduction

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.

  • A class, which extends CytoscapePlugin. This is the entry point to Cytoscape.

    A manifest file, explicitly list the class, which extended CytoscapePlugin class

    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 .

How to add a tabbed Panel to Control panel?

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

How to create, modify, and destroy a network, nodes, and edges?

How to save/restore app states?

How to use the Cytoscape task monitor to show the progress of my job?

Trouble shooting

If you get compile error,

  1. Check the version number of parent POM, the latest is at Cytoscape repository

  2. If this is a dependency problem, check the version number of depended bundle at Cytoscape repository

Recommendations

  1. If you’re a beginner you probably want to use the Simple app type. see example02a, example03a
  2. If you want to port as quickly as possible, again, go with the Simple app type.
  3. If you want to publish an API you must use the Bundle app type
  4. If you experience version conflicts or anticipate future version conflicts, again you must use the Bundle app type.
  5. If you are in doubt, you should probably use the Simple app type. You can always port it to the Bundle app type later should that become necessary. Both styles are supported and will be until (at least) version 4.0.

App Porting Hints

How to

  1. get current network --- see sample app 5
  2. get attributes --- see sample app 11
  3. add a menu item --- see sample app 3

Questions, suggestions

Please send e-mail to cytoscape help desk or discussion group

Cytoscape_3/AppDeveloper/Cytoscape_3_App_Cookbook (last edited 2020-02-05 19:54:29 by KristinaHanspers)

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