ecl-logo Documentation
ECL`

AnalyzePeaks

AnalyzePeaks[ChromatographyData]⟹AnalysisObject

Finds peaks in Absorbance, Fluorescence, and other data in the given Chromatography data object, and computes peak properties such as Position, Height, and Area.

AnalyzePeaks[CESDSData]⟹AnalysisObject

Finds peaks in Absorbance or Migration Data from the Capillary Gel Electrophoresis SDS data object.

AnalyzePeaks[CIEFData]⟹AnalysisObject

Finds peaks in Absorbance data from the Capillary Isoelectric Focusing data object.

AnalyzePeaks[ProtocolObject]⟹AnalysisObject

Finds peaks in all DataObjects linked to the given HPLC, FPLC, CESDS, or CIEF ProtocolObject.

AnalyzePeaks[NumericData]⟹AnalysisObject

Finds peaks in NumericData, an ordered list of {x, y} points or a QuantityArray.

Overview

  • The options of AnalyzePeaks specify which data are selected, how they are preprocessed, and how peaks are identified.
  • x values in options (regions, windows, spans and widths) are in the x-axis units of the input data.
  • Some options apply to only a subset of supported data types:
  • Method, SignalToNoiseMethod, ParentPeakall inputs and methods
    ReferenceFielddata objects and protocols; ignored for numeric data
    Wavelengthchromatography Absorbance and Absorbance3D data;
    ignored for fluorescence, scattering, FID and CAD data;
    not used for other inputs
    HammingWindowWidth, BlankDataSourcechromatography only
    IsoelectricPointMarkerscIEF only
    SmoothingFilter, SmoothingParameter,
    SecondDerivativeThreshold, LiftOffPercent,
    TouchDownPercent, MinPeakArea, MinPeakHeight,
    MaxPeakHeight, MaxPeakWidth, PeakAssignments
    Method -> DetailedCurvature only
    ManualPeaksMethod -> Manual only
  • When multiple data objects are supplied as input, the options are resolved and applied homogenously over all of them.
  • Each Object[Analysis, Peaks] stores the input options in UnresolvedOptions and resolved values of every option in ResolvedOptions. Passing ResolvedOptions back to AnalyzePeaks reproduces the result.

Details

  • AnalyzePeaks finds peaks in a 1D signal, draws a straight baseline under each peak, and reports properties of each peak such as its position, height, width and area.
  • The results are uploaded to Constellation as Object[Analysis, Peaks] objects, one for each data object analyzed. Analyzing a protocol or a list of data objects returns a list of analysis objects.
  • To obtain results as a packet, set Upload -> False.
  • The following inputs can be given:
  • Object[Data, Chromatography]absorbance, 3D absorbance, fluorescence, scattering,
    FID or CAD traces from HPLC, FPLC or GC
    Object[Data, CapillaryGelElectrophoresisSDS]processed UV absorbance or relative migration data
    Object[Data, CapillaryIsoelectricFocusing]UV absorbance or processed UV absorbance electropherograms
    Object[Protocol, HPLC],
    Object[Protocol, FPLC],
    Object[Protocol, CapillaryGelElectrophoresisSDS],
    Object[Protocol, CapillaryIsoelectricFocusing]
    every data object linked to the protocol
    numeric dataan ordered list of {x, y} points,
    or a 2-column QuantityArray
  • Options

Data Selection and Preprocessing

  • ReferenceField specifies the field downloaded from the data object to be analyzed. The accepted fields are:
  • Object[Data, Chromatography]Absorbance, Absorbance3D, Fluorescence,
    Scattering, FIDResponse, CADResponse
    Object[Data, CapillaryGelElectrophoresisSDS]ProcessedUVAbsorbanceData, RelativeMigrationData
    Object[Data, CapillaryIsoelectricFocusing]UVAbsorbanceData, ProcessedUVAbsorbanceData
  • Wavelength specifies the absorbance wavelength to analyze. For Absorbance data, an explicit Wavelength must equal the wavelength the data were recorded at. For Absorbance3D data, Wavelength picks the slice of the 3D data at that wavelength, rounded to the nearest nanometer.
  • HammingWindowWidth applies a Hamming-window low-pass filter to the raw trace before any analysis, to suppress high-frequency noise. Each point becomes a weighted average of its neighbors, with the most weight at the center of the window. The filtered trace replaces the raw trace for every later calculation, including heights and areas.
  • HammingWindowWidth is given in seconds, in pixels, or as a plain number in x-axis units; Null applies no filter. By default, Absorbance data uses the width the HPLC experiment recorded on the data object, and other data are not filtered. A little of each end of the trace is lost, because the window has to fit fully inside the data.
  • BlankDataSource gives a blank run used for blank-relative properties, currently the noise in the signal-to-noise ratio. The possible values are:
  • Tracemeasure everything on the analyzed trace itself (default)
    MostRecentBlankuse the last blank injected before each sample
    in the source protocol's InjectionTable;
    an error when no blank was injected before the sample
    Object[Data, Chromatography]use that data object as the blank
  • BlankDataSource can also be a list with one entry per input data object; a list of the wrong length is an error. A protocol input takes a single value.

pI Calibration (cIEF)

  • IsoelectricPointMarkers -> {{pILow, pixelLow, deltaLow}, {pIHigh, pixelHigh, deltaHigh}} converts the x-axis of cIEF electropherograms from pixels to pI before peak detection. pILow must be less than pIHigh and pixelLow less than pixelHigh, each delta must be a positive whole number, and the two search windows must not overlap. By default no calibration is applied and the axis stays in pixels.
  • For each marker, the highest-absorbance point strictly inside the window from pixel - delta to pixel + delta is taken as the marker. Note: this is the highest raw data point; no peak picking is involved, so a noise spike or the flank of a neighboring peak can be chosen if it is taller.
  • A straight line is drawn through the two markers (marker pixel, pI), and every pixel along it is converted to pI. Points outside the two markers are extrapolated along the same line.
  • Each electropherogram is calibrated separately, so the same pI can sit at slightly different pixels in different runs. If a marker window falls outside any one electropherogram, calibration fails for the whole analysis.
  • After calibration, all x values are in pI, including peak positions and widths, SecondDerivativeThreshold regions, PeakAssignments windows, SmoothingParameter and the SignalToNoiseMethod span.
  • If a SignalToNoiseMethod span cannot be carried onto the calibrated axis, SignalToNoiseMethod reverts to USP5x with a warning.

Peak Picking Methods

  • Method chooses the peak-picking algorithm:
  • DetailedCurvaturefind apexes from the smoothed second derivative (default)
    Manualreport exactly the peaks given in ManualPeaks

Detailed Curvature Method

  • With Method -> DetailedCurvature, the derivatives of the trace are smoothed, and each local maximum of the negative second derivative above a threshold marks a peak apex. A baseline starts between the apex's two inflection points and grows outward until the edge slopes flatten to the LiftOffPercent and TouchDownPercent criteria. Peaks outside the size limits are then excluded.
  • SmoothingFilter is the filter used to compute the smoothed first and second derivatives that drive apex detection, baselines and droplines. Only the derivatives are smoothed; heights, areas and baselines are measured on the trace itself. The filters are:
  • Gaussianderivatives are computed by convoluting the trace with a Gaussian kernel.
    SmoothingParameter is the Gaussian width (default).
    SavitzkyGolayderivatives are computed based on a cubic polynomial that is fitted to a window around each point on the trace.
    SmoothingParameter is the window width.
  • Gaussian smooths more strongly while SavitzkyGolay preserves variations of the underlying trace.
  • SmoothingParameter is the smoothing strength in x-axis units. Larger values suppress more noise and merge closely spaced peaks.
  • SecondDerivativeThreshold -> {{start, end}, threshold} defines a peak-detection region and the apex threshold. Only maxima of the negative second derivative that lie inside a region and reach its threshold become apexes. A list of such entries defines several regions, each with its own settings.
  • Regions must lie within the data, must not overlap, but may touch.
  • SmoothingParameter, LiftOffPercent, TouchDownPercent, MinPeakArea, MinPeakHeight, MaxPeakHeight and MaxPeakWidth can differ from one region to the next; SmoothingFilter applies to every region.
  • Each cluster's baseline starts as the straight line joining its two inflection points, and its ends then move outward one data point at a time. LiftOffPercent sets where the baseline starts on the leading edge: expansion stops once the slope of the trace, relative to the baseline, has fallen to that percentage of its value at the inflection point. TouchDownPercent is the same criterion on the trailing edge.
  • With the default LiftOffPercent -> 0 and TouchDownPercent -> 0, the baseline runs out until the edge is parallel to it; larger values stop it closer to the apex.
  • A baseline stops expanding once it reaches its liftoff and touchdown targets, or an expansion step causes the slope of the baseline to go outside the smoothed first derivatives of the trace at either endpoint.
  • Neighboring clusters whose baselines overlap are merged into one, including across region boundaries. The merged baseline spans the outermost ends the two reached, its slope targets are recomputed from its outermost inflection points, and it is expanded again.
  • After merging, each cluster is split into one peak per apex by placing droplines in one of three ways:
  • Valleybetween two clusters,
    at the point of the trace closest to the baseline
    Shoulderwhere one peak rides on the flank of another,
    at the curvature trough nearest the weaker peak
    (the one with less curvature at its apex)
    Roundbetween peaks fused inside one cluster,
    at the curvature trough between their apexes
  • The apex of a peak with a Shoulder or Round boundary is the point of greatest curvature. For other peaks, it is the highest point above its baseline.
  • Each peak is then checked against the size limits of the region containing its apex:
  • MinPeakHeightexclude peaks whose height above their baseline is below this,
    in y units (default 0, no limit)
    MinPeakAreaexclude peaks whose area is below this,
    in y × x units (default 0, no limit)
    MaxPeakHeightexclude peaks whose height above their baseline is above this,
    such as a solvent front or an overloaded component
    (default Null, no limit)
    MaxPeakWidthexclude peaks whose width from start boundary to end boundary
    is above this, such as baseline drift picked up as a peak
    (default Null, no limit)
  • Excluded peaks are not reported, and are not used as the preceding peak for AdjacentResolution. Exclusion happens after the peaks are built, so neighboring peaks keep their droplines and baselines, and an excluded peak's area is not given to its neighbors.

Manual Method

  • With Method -> Manual, the peaks are exactly those given in ManualPeaks. There is no smoothing, thresholding, baseline expansion or exclusion, and every manual peak is reported.
  • ManualPeaks takes one list of peaks per input dataset. Each peak is {{x1, y1}, {x2, y2}, label}, where label is a string, a Model[Molecule] or Null.
  • A manual peak spans the data points nearest x1 and x2, and must cover at least 3 points. Its baseline is the straight line through {x1, y1} and {x2, y2} exactly as given. The baseline does not have to touch the trace, so it can be drawn above or below the signal.
  • The apex of a manual peak is the highest point above its baseline.

Peak Assignment and Parent Peak

  • PeakAssignments -> {{{start, end}, label}, ...} labels peaks by position, where label is a string or a Model[Molecule]. In every dataset, a peak whose apex falls inside a peak assignment directive's window gets that window's label.
  • PeakAssignments directives must not overlap, and each label can be used only once. For Method -> Manual, label manual peaks by specifying ManualPeaks where each peak carries its own label in each dataset.
  • ParentPeak names the label of a reference peak, so only a labeled peak can be the parent. In each dataset, the peak carrying that label is the parent, and every peak's RelativeArea and RelativePosition are calculated against it. ParentPeak applies to both methods.
  • If no peak in a dataset carries the ParentPeak label, a warning is issued and that dataset's relative values are left blank.

Peak Properties

  • Each Object[Analysis, Peaks] holds one entry per peak in each per-peak field. The entries are index-matched, so the nth entry of every field describes the same peak. Peaks are sorted by increasing Position.
  • Reference links the analyzed data object, which links back to the analysis, and PeakSamples links the samples that were measured. ReferenceField, AbsorbanceWavelength, HammingWindowWidth, IsoelectricPointMarkers, BlankDataSource and SignalToNoiseMethod record the settings that were used.
  • Heights and areas are measured above each peak's own straight baseline, B(x)=BaselineSlopex+BaselineIntercept, on the unsmoothed trace (after the Hamming filter, if one is applied). In the formulas below, t_R is the Position of the peak, H its Height, and W_(h/2) its HalfHeightWidth.
  • Positionx value of the apex:
    retention time, migration time, pixel or pI
    Heightheight of the apex above the baseline,
    H=y(t_R)−B(t_R)
    Areaarea between the signal and the baseline
    from PeakRangeStart to PeakRangeEnd,
    by the trapezoidal rule over the data points of the peak
    PeakRangeStart, PeakRangeEndx values of the start and end boundaries
    BaselineSlope, BaselineInterceptthe straight baseline under the peak
    HalfHeightWidth, WidthRangeStart, WidthRangeEndwidth at 50% of the height,
    and where that width starts and ends
    TailingFactorUSP tailing factor, measured at 5% of the height
    HalfHeightNumberOfPlatestheoretical plates, by the half-height method
    AdjacentResolutionresolution to the preceding peak, from half-height widths
    SignalToNoise, SignalToNoiseRangesignal-to-noise ratio,
    and the x range the noise was measured over
    PeakToValleyStart, PeakToValleyEndheight relative to the valley at the start or end boundary
    PeakLabel, PeakAssignmentlabel and linked Model[Molecule]
    ParentPeak, RelativeArea, RelativePositionthe parent peak's label,
    and area and position relative to it
  • The apex is the data point with the greatest height above the baseline, except for DetailedCurvature peaks with a Shoulder or Round boundary, whose apex is the point of greatest curvature (negative second derivative).
  • HalfHeightWidth is WidthRangeEnd - WidthRangeStart, where WidthRangeStart and WidthRangeEnd are the first data points, searching inward from the start and the end of the peak, whose signal is at least B(t_R)+H/2. The width is measured on data points and is not interpolated between them.
  • TailingFactor is W_(0.05h)/(2f), where W_(0.05h) is the width of the peak at 5% of its height and f is the distance from the leading edge at 5% of the height to the apex. This is the USP tailing factor, and the EP and JP symmetry factor.
  • HalfHeightNumberOfPlates is N=5.545(t_R/W_(h/2))^2, the USP, EP and JP half-height method.
  • AdjacentResolution is R_s=1.18(t_(R2)−t_(R1))/(W_(h/2,1)+W_(h/2,2)), where t_(R2) and W_(h/2,2) are the Position and HalfHeightWidth of the peak, and t_(R1) and W_(h/2,1) are those of the preceding peak. This is the harmonized USP, EP and JP half-height form, not the older USP tangent-width form. AdjacentResolution of the first peak is Null.
  • PeakToValleyStart and PeakToValleyEnd are H/H_v, where H_v is the height of the signal above the peak's baseline at its start or end boundary. They are calculated only for DetailedCurvature peaks whose boundary is shared with a neighboring peak and lies above the baseline (a Valley, Shoulder or Round boundary).
  • PeakLabel and PeakAssignment give the label and molecule assigned to each peak by PeakAssignments, (or by ManualPeaks when Method -> Manual).
  • When ParentPeak is set to the label of a peak, RelativeArea is the Area of each peak divided by the Area of the parent peak, and RelativePosition is the unadjusted relative retention of EP and JP, with no dead-time correction.

Signal-to-Noise

  • SignalToNoise is S/N=2H/h, where h is the peak-to-peak noise: the range of the signal about a straight line fitted to the data in a noise window. SignalToNoiseRange gives the {start, end} x values of that window.
  • SignalToNoiseMethod sets the noise window:
  • USP5xa window 5 times the HalfHeightWidth wide,
    split evenly before the start and after the end of the peak
    (default)
    USP20xthe same, with a window 20 times the HalfHeightWidth wide
    start ;; endone window spanning that range of x values,
    used for every peak
  • With USP5x or USP20x, when the data ends before one side of the window, the rest of the window is taken from the other side, and SignalToNoise is Null if the window does not fit within the data.
  • When noise is sampled from the analyzed trace, points that lie within any peak are left out of the noise window, and SignalToNoise is Null if more than half of the window lies within peaks.
  • When BlankDataSource specifies a blank, the noise is measured on the blank over the same window. With BlankDataSource -> Trace, the formula is the USP, EP and JP formula, but the result is not the pharmacopeial signal-to-noise ratio, which requires noise measured on a blank.

Examples

open allclose all

Basic Examples

Find the peaks in a chromatogram. By default results are saved as a Object[Analysis, Peaks] Constellation object:

Plot them on the trace:

Analyze several data objects at once:

Return the analysis as a packet rather than uploading it:

Find peaks in raw xy data

Additional Examples

Find peaks in a capillary gel electrophoresis (CE-SDS) electropherogram:

Find peaks in 3D absorbance data at one wavelength:

Peaks are index-matched across the per-peak fields, sorted by Position:

Options

BlankDataSource

By default, the noise for SignalToNoise is measured on the analyzed trace itself:

Measure the noise on a blank run instead:

Use the blank injected most recently before each sample in the protocol's InjectionTable:

HammingWindowWidth

Low-pass filter the trace with a Hamming window before analysis:

The filtered trace is also used for heights and areas. Compare the heights without and with the filter:

IsoelectricPointMarkers

Calibrate a cIEF electropherogram from pixels to pI with two markers, pI 6 near pixel 142 and pI 8 near pixel 1620, each searched for within 50 pixels:

The peak positions are in pI:

Calibrate every electropherogram of a cIEF protocol:

LiftOffPercent

By default each baseline runs out until the leading edge of the peak is parallel to it:

A larger value starts the baseline closer to the apex:

ManualPeaks

Give the peaks directly, each as its start point, end point and label. The baseline is the straight line between the two points:

The baseline does not have to touch the trace. Draw it below the signal:

MaxPeakHeight

Exclude peaks taller than 20, such as a solvent front or an overloaded component. Here the tallest peaks of the early cluster are excluded:

MaxPeakWidth

Exclude peaks wider than 0.16 minutes from start boundary to end boundary:

Method

DetailedCurvature, the default, finds peak apexes from the smoothed second derivative:

Manual reports exactly the peaks given in ManualPeaks:

MinPeakArea

Exclude peaks whose area is below 1:

MinPeakHeight

Exclude peaks less than 10 high:

ParentPeak

Calculate the area and position of every peak relative to the peak labeled "peak A":

ParentPeak also applies to manual peaks:

PeakAssignments

Label the peaks whose apex falls in each window:

Assign molecules to the peaks of every chromatogram in a protocol. Each peak is labeled with the molecule's name and linked to it in PeakAssignment:

ReferenceField

Analyze the raw UV absorbance of a cIEF run:

Analyze the processed UV absorbance of every electropherogram in a cIEF protocol:

Analyze the FID trace of a GC data object:

SecondDerivativeThreshold

Look for apexes only between 0.24 and 3.7 minutes, where the negative second derivative reaches 83:

Give several regions, each with its own threshold:

Settings such as SmoothingParameter and MinPeakHeight can differ from one region to the next:

SignalToNoiseMethod

By default, the noise is measured over a window 5 half-height widths wide around each peak:

Use a window 20 half-height widths wide:

Measure the noise for every peak over one span of baseline, here from 5 to 10 minutes:

SmoothingFilter

Gaussian, the default, takes derivatives weighted by the derivatives of a Gaussian:

SavitzkyGolay fits a cubic polynomial to a window around each point and takes the derivatives from that fit:

SmoothingParameter

Light smoothing resolves the early cluster into several peaks:

Heavier smoothing runs them together:

Template

Reuse the options of an earlier analysis on another data object:

TouchDownPercent

By default each baseline runs out until the trailing edge of the peak is parallel to it:

A larger value ends the baseline closer to the apex:

Upload

Return a packet instead of uploading an Object[Analysis, Peaks]:

Wavelength

Analyze 3D absorbance data at a chosen wavelength:

Different wavelengths slice different traces from the same 3D data:

For 2D absorbance data, Wavelength resolves to the wavelength the data were recorded at:

Properties & Relations

AnalyzePeaksOptions returns the resolved options without running the analysis:

Passing the stored ResolvedOptions back to AnalyzePeaks reproduces the result:

The data object links back to its analyses:

AnalyzePeaksPreview opens the interactive preview to adjust the peaks before uploading:

Possible Issues

An explicit Wavelength must match the wavelength 2D absorbance data were recorded at. These data were recorded at 260 nm:

Wavelength is ignored, with a warning, for data that are not absorbance:

SecondDerivativeThreshold regions must not overlap:

Options of the DetailedCurvature method are not used, with a warning, when Method -> Manual:

If no peak carries the ParentPeak label, a warning is issued and the relative values are left empty:

SignalToNoise is Null when more than half of the noise window lies within peaks, as in a crowded cluster:

A noise span outside the data cannot be used: