Skip to main content

Scan data

Each SpectrumRecord yielded by iter_spectra is assembled from one Idx record in the .wiff file plus the matching data block in the paired .wiff.scan file. The Idx record locates the block (byte offset and size) and carries the per-scan metadata; the block itself holds the peak data. See Legacy .wiff.scan blocks for the on-disk layout.

m/z and intensity​

The .wiff.scan block payload is a custom byte-level prefix encoding of (delta_mz, intensity) integer pairs (not a standard LZ/entropy codec). The reader decodes the pairs, accumulates the m/z deltas into an axis, and emits parallel mz (f64) / intensity (f32) arrays.

m/z calibration

On TripleTOF/ZenoTOF files the raw time-bin values are converted to m/z (Da) using the first (slope, intercept) pair of the TOFCalibrationData stream. QTRAP files have no calibration body, so their mz values are raw, uncalibrated bin values.

The resulting TripleTOF/ZenoTOF m/z values are not accurate: they do not line up with known fragment ions, background ions, or isotope spacing, and some files contain negative m/z. Do not use them for identification or accurate-mass work.

MS level and precursor​

ms_level comes from the Idx MS-level flag. MS2+ spectra carry a precursor whose precursor_native_id is the native ID of the preceding MS1 scan (None when no MS1 precedes it). selected_mz/target_mz come from the DDERealTimeDataEx stream on DDA files, linked by DDA cycle; on files without that stream (MRM/targeted, plain SWATH) they stay None.

Retention time​

retention_time_sec is the Idx per-record retention time (stored on disk in minutes) converted to seconds.

Fields not populated​

The analyzer is TOFMS for TripleTOF/ZenoTOF files and TQMS for QTRAP files (see Instrument families). The reader leaves total_ion_current unset - the Idx TIC is in physically calibrated cps and does not match the sum of the raw intensity counts, so the mzML writer recomputes TIC from the intensity array instead. scan_mode is also left unset (None): no decoded stream carries a per-scan or per-experiment centroid/profile indicator - see Reader: what the reader does not do. See the format overview for the full list of known limitations.