GC Image (LCxLC Edition) Users' Guide

Chemical Identification

LC Image has tools for creating and using templates of chemical information observed in previous chromatogram(s) so that similar chemical patterns in subsequent chromatogram(s) can be recognized. Once recognized, the information (e.g., compound 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.

A Template in Source 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. The template peaks are indicated by open circles. Misregistration between peaks in the template and blobs in the target data is corrected by pattern matching in Step 3.

A Template Overlaid on Target Image
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 and/or to edit the template, and then recompute the matching. Figure 3 shows a matching between a template and target image. In this example, the locations of the matched blobs (indicated by filled circles) is slightly below the positions of the template peaks.

A Template Matched with 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.

Target Image After a Template Applied
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. LC 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.

Template Object Table
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, such as compound name, group name, constellation name, characteristic channel(s), CLIC expression(s), 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 in the target image, but template pattern matching can resolve such discrepancies.

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.

Load Template Dialog
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 selected objects from an 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 cursor mode from the palette and select blobs for which peaks are to be added to the template. (Metadata such as compound 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: Add to Template Icon

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; description; flags; color settings; characteristic Qualifier and Quantifier channels; Analysis CLIC expression; and Reference Peak, are simply copied from each blob to a peak in the template. For multi-spectral images, the multi-spectrum is extracted from the blob according to the Type of multi-spectrum setting in the Library Search configuration (either the blob's peak MS or its integrated MS) and copied as the template peak's Reference MS. The Qualifier CLIC is copied unless the Template configuration flag Create MS matching functions when adding blobs to template is set, in which case a new Qualifier CLIC expression is created, as described next.

If the Create MS matching functions when adding blobs to template flag is set in the Template configuration, LC Image will generate a matching rule as each blob is copied to the template. The matching rule is used in subsequent matching to help distinguish the correct blob to be matched. The matching rule is expressed as a CLIC expression (described below). In constructing the rule, LC Image computes the match factors between the MS of the blob being copied to the template and the MS of each other blob and then selects as the most similar blob the other blob with the largest match factor. Then, LC Image writes a CLIC expression with a match factor requirement that is mid-point between the match factor for the most similar blob and a perfect match (999). However, the match factor requirement also is subject to a minimum and maximum threshold configured in LC Image Template configuration. Also, it is possible to set the Template configuration so that only included blobs or only neighboring blobs (those with an overlapping bounding box) are considered as possible most similar blobs.

Graphics objects can be added to the template with information copied from graphics objects in an image. First, select graphics cursor mode from the palette and select the graphics objects to be added to the template. (Metadata such as graphic name, etc., also should be set, as desired, in the graphics objects, but can be edited after copying to the template.) Then, click the Add to template button. LC 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.)

LC 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 7, 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. LC 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.

Template Configuration
Figure 7: 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 8, 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 Areas 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.

Template Mode Dropdown Menu
Figure 8: 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

The default template cursor mode is Select (template) objects. Template objects of any type can be selected in Select 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 clicked while in template cursor 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 template graphics, multiple template text objects, or multiple template 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 template objects of different types are selected.

The pattern of template peaks need not align exactly with the pattern of blobs in the target image, because template matching is quite effective at resolving discrepancies. However, if the pattern of template peaks is significantly and systematically different than the pattern of target blobs, e.g., due to different chromatographic conditions, the entire template can be transformed interactively by selecting Filter -> Transform Template. The controls on the Transform Template dialog, pictured in Figure 9, support translation, scaling, and shearing to systematically modify the template for a better fit.

Transform Template Dialog
Figure 9: The Transform Template dialog.

Matching and Applying Templates

LC 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 Matching 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 (after geometric transformation) for matching template peaks and target blobs. All distances are expressed in inter-sample distances (i.e., pixel dimensions).

Match Template provides a visualization of the matching, but the image is not updated (e.g., blob metadata are not changed) until the matching is applied. Figure 10 illustrates the result of matching template peaks to blobs in a target image. Template peaks are shown with open circles and matched blobs are shown as filled circles at the matched location, with a connecting line.

Matching Template Peaks with Blobs
Figure 10: The matching algorithm matches the template peaks to blobs in the target image and graphically highlights the matched blob 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. LC Image can be configured (in the Template Matching configuration) to prepare the matching report regardless of whether or not all peaks are 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 template can be applied to the target 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. The graphics, text, and chemical structures are geometrically transformed to maintain their positions relative to the template peaks using the transformation that minimizes the mean-squared error for mapping the template peaks to the matched blobs. Figure 11 illustrates the result of applying the template to the target image.

Matched Blobs after Template Applied
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. LC Image has tools that facilitate such changes. LC 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 Blob Analysis; graphics can be edited as described in Graphics and Areas; 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 relocated 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 setting (in the Template Matching configuration) is Matched Locations, then the matched peaks are relocated to the positions of the corresponding matched blobs. If the Update Template setting is 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, as described above.

Template Matching Visualization Toggle

The template matching visualization toggle allows a user to switch, with a keystroke “M”, between different views of matching results. A user also can turn on and off the preview of a saved template to compare with the current template.

Template Matching Report

The software allows a user to review and save the template matching report immediately after matching and also for the matching that was most recently applied.

The report contains these details:

Note: The units for Column I/Peak I and Column II/Peak II are determined by the Axis configuration.

View/Save Template Matching Report after Matching

  1. Open Menu -> Configure -> Configure Settings -> Template Matching.
  2. Check Show Matching Report under Template Match Option. (The setting is remembered.)
  3. Go to Template mode: Template Mode Icon
  4. If the image does not have a template, load a template by clicking the Load Template button: Load Template Icon
  5. Click the Match Template button: match template and the Template Matching Results dialog will pop up after the matching is done.
  6. Click on the Save button to save the report.
Template Matching Results Dialog
Figure 12: Template Matching Results dialog.

View/Save Template Matching Report for the Most Recently Applied Matching

  1. Select Menu -> View -> Template Match Results, and the Template Matching Results dialog will pop up.
  2. Click on the Save button to save the report.

Or,

  1. Select Menu -> File -> Save Summary Report.
  2. Add Template Match Result to the included subreports.
  3. Save the report.

Also in GC Project, a Template Matching Report can be added to any Summary Report. (Refer to Reports for more details on Summary Reports.)

Consensus Templates

LC Project can create a Consensus Template from a set of processed chromatograms and export it to a file. The Consensus Template reflects the analyses of multiple chromatograms and it can be used to analyze other chromatograms for the consensus features. LC Project and batches are tools for managing sets of chromatograms, as described in Project Management.

To generate a Consensus Template file, select "Actions -> Consensus Template" from the LC Project menu. In the Consensus Template dialog, shown in Figure 10, select the batch with the desired set of processed chromatograms, then click "OK". Then, indicate the desired output file name for the consensus template. The file is stored as a LC Image Template file (.bt). LC Project puts one peak into the Consensus Template for each distinct compound name for which there is an included blob with that name in any image in the source batch. For each distinct name, LC Project computes the consensus retention times for the template peak as the averages of the first-column retention times and the second-column retention times of all blobs having that name in the source images. For MS images, the MS of the template peak is set to the average of the MS (either peak or integrated MS as configured in LC Image) of all blobs having that name in the source images. Other metadata (such as group name) are set from one of the blobs having that name.

Consensus Template Dialog
Figure 10: The Consensus Template dialog.

Optionally, LC Project will generate a CLIC expression for each consensus peak to help distinguish the correct matching blob from other blobs. This process is similar to creating MS matching functions when adding blobs to a template. For each distinct name, in each of the source images in which there is an included blob with that name (referred to as a positive blob), LC Project selects the negative blob (an included blob with a different name) whose MS has the highest match factor with the consensus MS for the named blob. Then, LC Project determines a match factor requirement based on the match factors between the consensus MS and the MS of the positive and negative blobs. The match factor requirement is the mid-point point between (a) the smallest match factor for the positive blobs and (b) the largest match factor for the negative blobs that is smaller than the smallest match factor for the positive blobs (or zero if no match factor for the negative blobs is smaller than the smallest match factor for the positive blobs). Then, the CLIC expression will include all positive matches and exclude as many negative matches as possible using the match factor. The match factor requirement also is subject to a minimum and maximum threshold configured in LC Image Template configuration.

Computer Language for Identifying Chemicals (CLIC)

LC 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; extracting a CLIC image based on retention time, multi-spectrum, and/or blob characteristics; and constraining template matching. 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 apex) 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 CLIC Expression tool, pictured in Figure 13, 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.

CLIC Expression Dialog
Figure 13: CLIC Expression tool.

Once a CLIC expression is constructed, the tool can be used to apply it 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 unselected.

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, parentheses, and some mathematical functions. For example, "Peak_I > 10" selects 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 apex is greater than 10 minutes, the second-column retention time of the apex 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 LCxLC-MS data are:

There are two blob selection modes for LCxLC-MS data: peak mode, which uses the multi-spectrum of the blob's peak-valued pixel (the apex), or integrated mode, which uses the multi-spectrum formed by summing the multi-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 an apex with second-column retention time greater than 2.5 seconds and which have maximum multi-spectral intensity at either channel=128 or channel=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 blobs, 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.