Embedding Metannogen in Web services
About this document
This technical documentation explains to adminstrators
of Web services, how Metannogen is embedded into Web pages.
Sycamore is used as a test case.
To learn how Metannogen is embedded into program applications
such as Cytoscape, read Embedding into program
applications.
I recommend to print the HTML source code of the form beginning from
"<form" and ending at </form>.
Forming a Metannogen Web link
The SBML file Lambeth from JWS Online Cellular Systems Modelling is used as an example.
It has a reaction with the id "vgp". The goal is that the user can add annotations to this reaction.
The following Web form sends all required data to Metannogen.
Metannogen has single-session capabilities, that means that it is launched only once even if the submit button is
pressed again.
This is because a http port number is provided in a web variable
(See this source code of the HTML form).
Two maintain distinct sessions, a different port number for each session must be given.
Updating the reaction (More demanding): The reaction "vgp" might have been changed in the Sycamore system since Lambeth.xml was loaded into Metannogen.
Metannogen provides the option to update this single reaction.
This is faster then updating the entire network.
A small SBML containing only the reaction under consideration
(here "vgp" ) needs to be generated by the server.
The network
id in the SBML must match that of Lambeth.xml.gz.
To test this feature, two version of the reaction can be selected
in the web form below.
These are the SBML files of the two versions:
lambeth_vgp2.xml
and lambeth_vgp3.xml.
They differ by the stoichiometry of the
biochemical equation. Please observe the change of the equation as
you select a different version.
Without updating (Easier to implement):
An easier to implement method is to use the variable openOrCreateDataset=reactionID.
The reaction under consideration does not need to be updated and therefore no sbml of this reaction needs to be generated by the server.
- To test the single instance mechanism, click the button
of the form several times.
-
Chose different http ports and check whether different sessions come up.
-
To simulate the updating of the reaction change the radio
button from vgp2 to vgp3 and watch the equation in Metannogen.
-
Test local and server side data storage.
The Web variables datasetFile and serverURL are evaluated only at session start, but is ignored when the session is only reactivated.
Deleting Reactions
Please regard reactions vpglm and vald.
metannogen.php?port=10118&rmReactions=vpglm+vald
2. Metannogen talks to the other program
It might be important, that users can click a
cross-link in Metannogen such that a certain page is opened in a
Web-based Database.
How respective menu-items (or even shell scripts) can be added to Metannogen's context menus
is described
in Embedding into program
applications.
Here we show a different method: Adding crosslinks to the
info-text of Reactions. Please open Metannogen with the above Web
button. Then click a reaction tree node in the browsable
tree. You see a message like the following:
MY_DATABASELINK:vgp KEGGr:vgp
ID vgp
NAME Ph + GLY __> G1P
EQUATION 2 Ph@Undefined + 2 GLY@Undefined --> 2 G1P@Undefined
EQUATION 2 Ph + 2 GLY --> 2 G1P
The first line in this text is a configurable list of
cross-links.
The items are underlined and the mouse cursor changes to web-cursor
indicating that a web page is opened by mouse click.
Users can configure these X-refs in the preference
menu. The name of the customize dialog is "reactionCrossLinks".
Therefore the web vaiable "customizeAddReactionCrossLinks" may be
used to change the content programmatically at program start.
This web-variable takes a file (file
path or URL) Here it is set to reactionCrossLinks.txt.
The abbreviations "MY_DATABASELINK:vgp" and "KEGGr:vgp" are
resolved with a configurable hash-table named "webLinks". Here
the web variable "customizeAddWebLinks" is set to
myWebLinks.txt.
Some Ideas, how this can be used in Sycamore
I think of 3 different Metannogen buttons in the Web pages of Sycamore Reactions. All three would start/reactivate a Metannogen session.
The difference is the visibility/accessibility of the annotations.
- Annotations in a local file on the user's PC.
This is for private notes on reactions or for collecting preliminary information before submission. It is like a notepad for each reaction.
- Private annotations in a password protected project on www.bioinformatics.org used by a team.
This button and the annotations would only be visible and changeable by group members.
The team members could communicate use this for communication before data is finally entered into the system.
They could share the downloaded/purchased PDF full texts.
- Publicly readable annotations. This would work like a Web-Wiki.