Integration of Metannogen into Applications

This document describes, how Metannogen is embedded into other applications such as Cytoscape.

This document may be helpful for my colleague, who is currently creating a Metannogen plugin for Cytoscape.

Two directions of the communication must be distinguished:
  1. Cytoscape talks to Metannogen: From the other application the context menu of network components (reactions, metabolites) can be opened. Menu items in the context menu allow to create/open an annotation in Metannogen.
  2. Metannogen talks to Cytoscape:A context menu of a network component can be opened in Metannogen. It contains menu items to highlight/activate/focus .... them in Cytoscape.

Cytoscape talks to Metannogen

Cytoscape needs to start the program /bin/javaws which is part of the Java installation. It may use a library function like "exec(...)" or "system(...)". The following demo explains the program parameters.
For testing download the following SBML file:


wget -O test.sbml.gz http://www.bioinformatics.org/strap/metannogen/demo_integration/sycamore/Lambeth.xml.gz

Start Metannogen via Javaws:


javaws "http://www.bioinformatics.org/strap/metannogen/metannogen.php?networks=test.sbml.gz&port=10118&datasetFile=myAnnotations.datasets&openOrCreateDataset=vgapdh"

If Metannogen had already been started, this command brings Metannogen to the front and opens the annotation for "vgapdh". Otherwise Metannogen will be started.

Now try the same command with a different reaction ID:


javaws "http://www.bioinformatics.org/strap/metannogen/metannogen.php?networks=test.sbml.gz&port=10118&datasetFile=myAnnotations.datasets&openOrCreateDataset=vldh"

Metannogen talks to Cytoscape

Reaction cross-links

Reaction cross-links can be added with the program option 'customizeAddReactionCrossLinks". This is described in Sycamore

Context menus of network objects and IDs in text components

To watch the output of the "echo" command, we will need to activate the Java console. To open the Java-settings type:
      javaws -viewer
    
Figure Dialog to apply shell scripts or Web addresses to selected text. Each node in the tree represents a shell script which can be started by left click. The text in the text box "Argument for shell scripts" replaces the placeholder in the script (asterisk). Users can define own scripts. Details.
ExecByRegex#screenshot()
A customizable dialog to start external apps can be opened (See figure) using the context menu of tree nodes and identifiers in text components. The representing text of the object under the mouse pointer (network component, annotation, identifier) is shown in the upper text field, here "hello". The Lower part contains external applications arranged as an expandable tree. In the figure the collection "demo" contains for example "Example Google". The items can be customized by an external file, here test_shell_scripts.txt. It contains three columns separated by tab-character or the string "%09".
  1. Path and display name of the item. Path separator is back-slash.
  2. A condition whether an item is displayed or not depending on the current text. This is simply a regular expression. Match means the item is displayed. Dot asterisk ".*" matches anything and the respective items with always be visible.
  3. Shell script that is executed or web page to be shown in the browser or HTTP port and data for HTTP-socket. The shell script appears as balloon message over the tree. Asterisk is replaced by the current text (here "Hello").
This file test_shell_scripts.txt is loaded with the program option "customizeAddScriptByRegex=http://...". The option takes files or URLs.


javaws "http://www.bioinformatics.org/strap/metannogen/metannogen.php?networks=test.sbml.gz&port=10118&customizeAddScriptByRegex=http%3A%2F%2Fwww.bioinformatics.org%2Fstrap%2Fmetannogen%2Fdemo_integration%2Ftest_shell_scripts.txt&datasetFile=myAnnotations.datasets&openOrCreateDataset=vldh"


This mechanism can be used to add items for controlling other applications. Web-addresses starting with "http://localhost:" will not be opened in the browser - instead the text following the query mark is send through a socket connection.