ChromatogramExtractor#

class pyopenms.ChromatogramExtractor#

Bases: ProgressLogger

The ChromatogramExtractor extracts chromatograms (intensity vs retention time) from mass spectrometry data.

This class provides functionality to extract chromatographic traces from mass spectrometry data based on specified coordinates (m/z, retention time, and optionally ion mobility values).

The extractor supports two main interfaces:

  1. Legacy interface: Takes a TargetedExperiment object containing transitions and extracts chromatograms at the m/z values specified in those transitions.

  2. Modern interface: Takes a set of ExtractionCoordinates that specify the exact coordinates for extraction. This provides more flexibility and control over the extraction process. The prepare_coordinates() helper function can generate these coordinates for common MS1 and MS2 extraction scenarios.

Key features:

  • Supports both MS1 and MS2 level extractions

  • Configurable extraction window sizes in m/z dimension (absolute or ppm)

  • Multiple filter types available (Bartlett, tophat) for signal processing

  • Handles ion mobility data when available

  • Optimized for SWATH/DIA (Data Independent Acquisition) experiments

  • Progress logging capabilities through ProgressLogger base class

For MS2 extractions, the input data is expected to come from a SWATH/DIA experiment where precursor ions are fragmented in wide isolation windows, allowing for extraction of fragment ion chromatograms.

See also: ChromatogramExtractorAlgorithm (the underlying extraction algorithm) and ExtractionCoordinates (the coordinate specification format)

__init__() → None#
__init__(arg: pyopenms.ChromatogramExtractor, /) → None

Methods

__init__()

endProgress([bytes_processed])

Ends the progress display

extractChromatograms(input, output, ...)

getLogType()

Returns the type of progress log being used

nextProgress()

Increment progress by 1 (according to range begin-end)

prepare_coordinates(output_chromatograms, ...)

Prepare extraction coordinates from targeted experiment

setLogType(type)

Sets the progress log that should be used.

setProgress(value)

Sets the current progress

startProgress(begin, end, label)

Attributes

CMD = 0#
GUI = 1#
NONE = 2#
endProgress(bytes_processed: int = 0) → None#

Ends the progress display

extractChromatograms(input: pyopenms.SpectrumAccessOpenMS, output: list, extraction_coordinates: collections.abc.Sequence[pyopenms.ExtractionCoordinates], mz_extraction_window: float, ppm: bool, im_extraction_window: float, filter: str) → None#
getLogType() → pyopenms.ProgressLogger.LogType#

Returns the type of progress log being used

nextProgress() → None#

Increment progress by 1 (according to range begin-end)

static prepare_coordinates(output_chromatograms: list, extraction_coordinates: list, targeted: pyopenms.TargetedExperiment, rt_extraction_window: float, ms1: bool = False, ms1_isotopes: int = 0) → None#

Prepare extraction coordinates from targeted experiment

setLogType(type: pyopenms.ProgressLogger.LogType) → None#

Sets the progress log that should be used. The default type is NONE!

setProgress(value: int) → None#

Sets the current progress

startProgress(begin: int, end: int, label: str) → None#