Loading...
 

Chemical Structure Plug-In

Image
The Chemical Structure Plug-In equips each metabolite with a property that can carry a structural formula. The structural formula property can be loaded from popular file formats like CML or MOL files as well as from databases. The structural formula can then be used in visualization, to perform mass balance analyses or to define atom mappings (within the Atomic Layer Plug-In).

Using the Plug-In

After installation, the Chemical Structure Plug-In is available in the list of active plug-ins. Activate the plug-in within a network document.

Activating structural formulas
Activating structural formulas


Each metabolite is then equipped with the property "Chemical Structure". Initially, this property of each metabolite is empty. By clicking on the the property in the property editor you can edit the chemical structure. The following dialog window appears.

Structural formula dialog
Structural formula dialog

1.2. Input Sources

The structural formula can be loaded from file, from InChi-Code and from database. The latter requires a database access plug-in to be installed in Omix (KEGG, BioCyc). Alternatively, a structural formula can also be drawn manually. therefore, the plug-in offers to download and utilize the KegDraw editor tool for chemical structures.

The KEGG and BioCyc Database plug-ins automatically load chemical structures of imported metabolites if available.

1.3. Visual Representation

You can change the visual appearance of the displayed chemical structure. For instance, display all C and/or H atoms, display element colors or atom numbers etc.


1.4. Network Validation

In biochemical reactions each atom of the educt molecules is transported to one of the product molecules. Hence, the number of atoms of the educts and products must be equals for each chemical element. The Chemical Structure Plug-In provides a validity check in menu Extras -> Chemical Structure Options. Here, all reactions are checked with respect to their educt and product molecules. If the number of atoms do not match a warning is given.

Validity check button
Validity check button

1.5. Displaying Chemical Structures in the Diagram

There are multiple ways to visualize chemical structures in the network diagram:

  • visualization on demand
  • using a self painting property to fill the item's background
  • using an accessory to visualize the structure.

1.5.1. Visualization on Demand

The view mode of the diagram editor provides the option to interactively visualize properties of individual network components on mouse hover.
Refer to the Omix User Manual in order to read about "Visualization on Demand".

1.5.2. Self Painting Property

Instead of filling the shape of an item with color, texture or gradient brush you can choose a property to be painted in the items background. Edit a metabolite's fill paint property, choose the "Property Reference" tab and select the property "Chemical Structure". This causes the structural formula, to be painted as shape content if available. In order to use this mechanism for all metabolites in the diagram configure the metabolites' default fill paint property for the entire network.

Another way to use this feature is to insert a GraphicsItem in the diagram, assign a structure as custom property and referencing this property as fill parameter:

omix.plugin.mol.MolData structureFile = ... 
GraphicsItem item = getGraphicsItem("itemID");
item.setCustomProperty("structure", structureFile);
item.paint = new PaintedProperty("structure", null, null);

1.5.3. Visualizing Accessory

Edit the document's OVL code and add following lines:

extend Metabolite{
	ObjectField<omix.plugin.mol.MolData> structure : void;
	{
		structure.value = (omix.plugin.mol.MolData)OmixApplication.readField("omix.plugin.mol", metaboliteType(), "molFile");
	}
}


The code extends each metabolite symbol and adds an ObjectField. An ObjectField displays its content beside the network item if possible. The content in this case is "omix.plugin.mol.MolData" which is the internal type name for structural formulas. The stuctural formula property provided by the plug-in is actually called "molFile" stored in namespace "omix.plugin.mol". In line 3, the command OmixApplication.readField(...) reads the structural formula property and stores its content in the ObjectField where it is then visualized. The block between line 2 and 4 represents an initializer that is invoked when the code is first applied in the network. You can also use the code in line 3 in other code segments.