GC Image Users' Guide

Chemical Identification

GC Image has tools for creating and using templates of chemical information observed in previous image(s) so that similar patterns of chemicals in subsequent image(s) can be recognized. Once recognized, the information (e.g., chemical names, groups, internal standard associations etc.) is copied from the template to the target image.

The template-based chemical identification process proceeds in four steps:

Step 1:  Create a template from a prototypical image. This step defines the pattern of peaks, graphics, and annotations, with associated metadata, that will be matched in subsequent target images. Figure 1 illustrates a template created from an image.
Figure 1: An example template created from a prototypical image.

Step 2:  Load the template for a target image. Figure 2 illustrates the template created in the previous step overlaid on a target image. Misregistration between peaks in the template and blobs in the target data is corrected by pattern matching in Step 3.
Figure 2: A template overlaid on a target image.

Step 3:  Match the template peaks to the blobs in the target image. This step computes a geometric transformation (scale and translation) of the template to align and match the template peaks with blobs in the target image. Matches also can be restricted by conditions imposed by CLIC expressions (described below) associated with template peaks. If no peaks are matched, then the identity transform is used. Then, all peaks, graphics, and annotations in the template are shown at their transformed positions with line segments illustrating matches between template peaks and blobs in the target image. The user can examine and then confirm or reject the matching. If the matching is not satisfactory, it is possible to change the pattern matching parameters or to edit the template, and then recompute the matching. Figure 3 shows a matching between a template and target image.
Figure 3: A template matched with target data and visually transformed.

Step 4:  Apply the template to copy the chemical information from the template to the target image. When a satisfactory matching and transformation is applied, the metadata from the template peaks are copied to the matched blobs and the graphics and annotations are copied into their transformed locations. Note that even after this step, it is possible to modify the blob metadata, graphics, and annotations in the target image. Figure 4 shows the target image with the chemical information from the template.
Figure 4: The target image with chemical information from the template.

Template Objects

A template consists of peaks, graphics, text, and chemical structure objects, each with essential metadata. GC Image provides a Template Object Table, pictured in Figure 5, which lists the template objects with columns for some metadata. Selecting a row of the Template Object Table selects the template object. As a convenience, the Template Object Table also lists peak sets defined by groups and constellations, although they are not objects per se.
Figure 5: The Template Object Table 

Peak objects are fundamental to a template. Peak objects are similar to blobs, but have only descriptive information about the peak and do not have data as blobs do. Peak objects specify the retention time for each separation dimension and may have optional metadata: chemical name, group name, constellation name, characteristic ions, CLIC expression, mass spectrum, inclusion flag, internal standard flag, internal standard association, exclusion flag, add text flag, add chemical structure flag, and color. Graphics, text, and chemical structure objects in templates have the same information that they have in images.

Template objects are displayed only in template mode. Template peaks are displayed as colored, unfilled circles. Template graphics are displayed with color-coded lines that are dashed, so they can be distinguished easily from image graphics if image graphics are displayed in template mode. The Template configuration panel, accessible from Configure -> Configure Settings, allows setting of visibility options and default colors for template objects. Figure 2 illustrates the graphical display for template objects. As is typical, the template peak locations in this example are slightly different than the locations of the blob peaks.

Creating and Saving Templates

Initially, the template of an image has no objects. Objects can be added to the template by loading a template file(s), by copying from objects in the current image, by interactive operations to draw template objects, or by a combination of these methods. This section describes the methods for interactively creating a template and saving it to a file. The next section describes how a template is viewed and edited. Although the process of creating a template can be time-consuming if many chemicals require identification, a user may save and re-use a template for analyzing many images.

To load a template from a file, select Filter -> Load Template from the menu or click the Load Template button (which is accessible in Template cursor mode.) The Load Template dialog, illustrated in Figure 6, provides access to a browser that allows the user to view the template before loading (i.e., without modifying the existing template). The Load Template dialog also allows the user to specify whether the selected template file is to be used to over-write the existing template or is to be added to the existing template. Template peaks and graphics must be unique, so any conflicting objects will not be added and a message will be displayed in a popup. The Load Template dialog is closed by clicking the Dismiss button.
Figure 6: The Load Template dialog.

Template objects can be copied from objects in the image: template peaks from image blobs, template graphics from image graphics, etc. In this way, a pattern of objects from the image can be recorded in a template so that it can be used to identify similar patterns in subsequent images.

Peak objects can be added to the template with descriptive information abstracted from blobs in an image. First, select blob mode from the palette and select blobs for which peaks are to be added to the template. (Metadata such as chemical name, etc., typically are set, as desired, in the blobs, but may be added or modified in the peak.) Then, click the Add to template button, as shown in Figure 7.
Figure 7: The Add to template button is used to create template peaks from image blobs or to copy graphical objects and annotations to a template.

A template peak is created for each selected blob with metadata from that blob. Template peaks must have unique retention times, so if a template has an existing peak at the same retention times, then the new peak will not be added and a message will be displayed in a popup. New peaks are added to the template with descriptive information extracted from each blob. The chemical, group, and constellation names; characteristic ions; flags; and color settings are simply copied from each blob to a peak in the template. For multi-channel images, the mass spectrum is extracted from the blob according to the Type of mass spectrum setting in the Library Search configuration (either the blob's peak mass spectrum or its integrated mass spectrum). The peak's CLIC expression is not extracted from the blob and currently must be defined interactively by the analyst as described below.

Optionally, GC Image will generate a CLIC expression for each blob copied to a template peak to help distinguish the correct matching blob from other blobs. GC Image finds the match factors between the blobs MS and the MS of each other blob and then selects as the negative blob the blob with the largest match factor. Then, GC Image writes a CLIC expression with a match factor requirement that is mid-point between the match factor for the negative blob and a perfect match (999). However, the match factor requirement also is subject to a minimum and maximum threshold configured in GC Image Template configuration.

Graphics objects can be added to the template with information copied from graphics in an image. First, select graphics mode from the palette and select the graphics to be added to the template. (Metadata such as graphic name, etc., also should be set, as desired, in the graphics.) Then, click the Add to template button. GC Image creates new graphics objects in the template with information copied from each selected graphic in the image. (Template graphics must have unique retention times, so if a template has an existing graphic with the same specification in the separation plane, then the new graphic will not be added and a message will be displayed in a popup.)

GC Image can be configured so that when a graphic is copied from an image to the template, Marker Peaks are selected from the blob set defined by the graphic and copied to create peaks in the template. The Template configuration pane, pictured in Figure 8, has a checkbox to indicate the creation of marker peaks for graphics copied from the image to the template and a number box to indicate the number of marker peaks per graphic. GC Image uses a clustering algorithm to create the requested number of clusters from the blob set and uses the blob with the largest volume in each set as the marker peak for the cluster.
Figure 8: The Template configuration panel.

Text and chemical structure objects in an image can be copied to the template in text mode and chemical structure mode in the same manner as graphics are copied from the image to the template.

The Image Viewer palette has a button to set the cursor mode to template mode. Next to the template cursor-mode button, there is a pull-down template mode selector. The selectable template cursor modes, illustrated in Figure 9, are:

The actions for drawing template graphics, text, and chemical structure objects and editing vertices are the same as for the corresponding objects, as described in Graphics and Text and Chemical Structure Annotations. Draw Template Peak is performed similarly to drawing a graphics point. If template objects are drawn (rather than added from blobs, graphics, text, or chemical structures in the image or from a file), then the metadata for the object is initially empty and must be provided interactively.
Figure 9: Template cursor modes.

Once a template is created by any combination of reading from a file, copying from the image, or drawing directly into the template, it can be written to a file for subsequent re-use. To save a template, select File -> Save Template from the menu and designate the folder and file name. The template is stored as a text file tagged using an eXtensible Markup Language (XML) schema. Saved templates contain all of the objects in the template, with metadata.

Selecting and Editing Template Objects

By default, the template cursor mode is Select template object. Template objects of any type can be selected in select template object mode by positioning the cursor on the template object and clicking the left mouse-button. Multiple template objects can be selected (or deselected) with successive control-clicks with the left mouse-button. All template objects can be selected by choosing Edit -> Select All (or using the <Ctl>-A keys) in select template mode. The Delete / Exclude Object button on the palette deletes selected template objects, if it is pressed while in template mode.

The handles of selected template objects can be used to relocate knots by using click-and-drag with the left mouse-button. A selected template object can be translated in-full by click-and-drag with the left mouse-button, beginning in the interior of the object. Multiple selected template objects also can be relocated using click-and-drag with the left mouse-button.

When a template object is selected, clicking the right mouse-button brings up a template object metadata popup, in which metadata, such as the name, can be assigned. When multiple template peaks, multiple graphics, multiple text objects, or multiple chemical structure objects are selected, then clicking the right mouse-button brings up a popup for shared metadata. These metadata popups resemble the metadata popups for multiple blobs, graphics, text, and chemical structures in the image. No shared metadata popup is available if objects of different types are selected.

Matching and Applying Templates

GC Image can match the pattern of peaks in the template to detected blobs in the image. Match Template is initiated from the Filter menu on the Image Viewer or with the Match Template button (which is accessible in Template cursor mode.) The template peaks are matched by a search algorithm that attempts to establish geometrically consistent correspondences between peaks in the template and blobs in the image. The template matching algorithm searches for a translation (i.e., horizontal and vertical shift) and scale (i.e. , horizontal and vertical resizing) of the template that aligns it with target peaks. Then, only target peaks within a set distance threshold of each template peak and which meet constraints imposed by the peak's CLIC expression are matched. If no peaks are matched, then the identity transform is used.

The matching algorithm can be parameterized via the Template configuration pane from Configure -> Configure Settings on the Image Viewer menu bar. The parameters are the center, half-width, and half-height of the translation search window; the center, half-width, and half-height of the scale search window, and the horizontal and vertical distance thresholds for matching a template peak and target peak. Figure 8 illustrates the Template dialog.

Match Template provides a visualization of the matching, but the image is not updated (e.g., blob metadata are not changed). Figure 10 illustrates the result of matching the template peaks to the image peaks. Template peak matches are shown as color-filled circles at the matched location.
Figure 10: The matching algorithm matches the template peaks to the image peaks and graphically highlights the matched locations with filled circles.

If the algorithm fails to match all peaks, a popup provides a Template Matching Report about the matching results, including the matching transform and details of each matched and unmatched peak. GC Image can be configured to prepare the matching report regardless of whether or not all peaks were matched.

If the template matching algorithm does not yield satisfactory results, the user has two options to improve the matching:

An unsatisfactory matching can be cleared by selecting "Filter -> Clear Template Match", by modifying the template, or by performing matching again. It is not necessary that the matching be perfect. A largely correct, but imperfect match can be corrected interactively after the template is applied.

Once a satisfactory match is achieved, the metadata from the blob is applied to the image by selecting Filter -> Apply Template from the menu or clicking the Apply Template button (which is accessible in Template cursor mode). Applying the template causes the metadata from the template peaks to be copied into the corresponding blobs (as determined by template matching). Also, template graphics, text, and chemical structures are copied with their metadata into the image at their transformed positions. Figure 11 illustrates the result of applying the template to the image.
Figure 11: After the template is applied to the image, the metadata of the matched peaks is set with the template metadata.

Note that even after applying the template, it is possible to modify the metadata of the blobs in the target image and other objects in the target image. GC Image has tools that facilitate such changes. GC Image has tools that are especially useful for correcting mismatched blobs. The Image Viewer menu and tool bar provide access to Cut Metadata, Copy Metadata, and Paste Metadata. These allow the user to quickly transfer metadata from a misidentified blob to the correct blob. The blob must be selected with a blob selection tool before the blob metadata can be cut, copied, or pasted. Also, blob metadata can be set directly as described in Peak Detection and Analysis; graphics can be edited as described in Graphics; and text and chemical structures can be edited as described in Text and Chemical Structure Annotations .

It is possible to perform Update Template so that the template objects are transformed according to the matching with the current image. This allows users to easily correct for retention-time drift, update a template for new conditions or columns, or otherwise update a template.

To update a template, select "Filter -> Update Template". If the Update Template configuration is set to relocate peaks by Matched Locations, then the matched peaks are relocated to the positions of the corresponding matched blobs. If the Update Template configuration is set to relocate peaks by Matched Transform, then the matched peaks are relocated according to the matching transform. Other template objects, such as graphics, are relocated according to the matching transform.

Computer Language for Identifying Chemicals (CLIC)

GC Image provides tools for constructing and applying selection expressions using the Computer Language for Identifying Chemicals (CLIC). A user can build powerful expression with rule-based criteria for selecting blobs or extracting a CLIC image based on retention time, mass spectrum, and/or blob characteristics. For example, a simple expression in the selection language is:
Retention(1)>15
This expression could be used to select all blobs in which the largest-valued pixel (i.e. , the peak) has first-dimension retention time greater than 15 minutes or to form a image that retains the values of all pixels with first-dimension retention time greater than 15 minutes (and sets the values of all other pixels to zero).

The tool, pictured in Figure 12, resembles a calculator, with a display box for the expression and buttons for numbers, functions, arithmetic operators, logical operators, relational operators, and parentheses for grouping. The user builds the expression by typing directly in the display box and/or clicking buttons. Buttons for Back and Clear also are available to construct the expression.
Figure 12: CLIC Expression tool.

Once constructed, the tool can be used to apply the expression either pixel-by-pixel or blob-by-blob, depending on the setting of the radio buttons. In pixel selection mode, the expression is applied by clicking the Generate CLIC Image button, which produces an image in which pixels that evaluate to true are unchanged and pixels that evaluate to false are set to zero (i.e., masked). In blob selection mode, the expression is applied by clicking the Select Blobs button, which causes the blobs that evaluate to true to be selected and the blobs that evaluate to false to be un-selected.

The CLIC Image Viewer provides a Save button, which allows a user to save a CLIC image to a separate file. The button invokes a file browser to specify the location and name of the GCI (.gci) file.

All blob characteristics (e.g., compound name, volume, retention times of the peak, etc.) that are selected in the current blob table configuration are available for inclusion in the expression via a pull-down menu. These functions can be combined with numbers, operators, and parentheses. For example, "Peak_I > 10" will select all blobs for which the first-column retention time of the peak is greater than 10 minutes. A more complex expression, "(Peak_I > 10) & (Peak_II < 3) & (Volume > 100)", selects all blobs for which the first-column retention time of the peak is greater than 10 minutes, the second-column retention time of the peak is less than 3 seconds, and the volume (i.e., total response integrated across the 2D peak) is greater than 100.

The functions available for GCxGC-MS data are:

There are two blob selection modes for GCxGC-MS data: peak mode, which uses the mass spectrum of the blob's peak-valued pixel, or integrated mode, which uses the mass spectrum formed by summing the mass spectra of all pixels in the blob.

The operators available for selection expressions are:

Here is a more interesting example selection expression:

(Retention(2)>2.5)&((Ordinal(128)=1)|(Ordinal(142)=1))
This expression can be used to select all blobs that have a peak with second-column retention time of greater than 2.5 seconds and which have maximum mass spectral intensity at either mass/z=128 or mass/z=142.

CLIC expressions can be stored and recalled with the selection calculator. To save an expression, type a name for the expression in the Name text box before evaluating the expression. To recall an expression, select the expression from the list of named expressions. The user is prompted before overwriting a previously saved expression or reading to replace the current expression.

CLIC expressions also can be defined for graphical objects, template peaks, and template graphical objects. In included graphical objects, blob sets are determined both by intersection or inclusion in the graphical object and by the CLIC expression. In templates, peaks will match a blob only if the blob satisfies the CLIC expression (as well as the template pattern) and when the template is applied then template graphical objects are copied with CLIC expressions to the image.

Contents       Previous: GCxGC-MS Data Processing and Analysis       Next: Comparative Analysis and Visualization

GC Image™ Users' Guide © 2001–2007 by GC Image, LLC, and the University of Nebraska.