Frames¶
Frame is the base class for all MS1 frames. DDAMs1Frame, DIAMs1Frame, and PRMMs1Frame
inherit every field and method listed under Frame — only their additional fields are shown
below each subclass.
tdfpy.Frame
dataclass
¶
Frame(
*,
frame_id: int,
rt: float,
polarity: Polarity | None,
scan_mode: int,
msms_type: MsMsType,
tims_id: int | None,
base_peak_intensity: int,
total_ion_current: int,
num_scans: int,
num_peaks: int,
mz_calibration_id: int,
t1: float,
t2: float,
tims_calibration_id: int,
property_group_id: int | None,
accumulation_time: float,
ramp_time: float,
_timsdata: TimsData = _timsdata_field()
)
Bases: _Spectrum
Base class for a single timsTOF MS1 frame.
A frame is one complete TIMS-MS acquisition cycle. All fields below are
present on DDAMs1Frame, DIAMs1Frame and PRMMs1Frame.
timsdata
property
¶
timsdata: TimsData
The reader's open :class:TimsData.
Raises:
| Type | Description |
|---|---|
ReaderClosedError
|
If the reader that built this element was closed. |
polarity
instance-attribute
¶
polarity: Polarity | None
"positive" or "negative"; None if the file stores anything else.
tims_id
instance-attribute
¶
Byte offset of this frame's data block in analysis.tdf_bin (the TimsId column).
base_peak_intensity
instance-attribute
¶
Most intense peak across all scans in this frame (the MaxIntensity column).
total_ion_current
instance-attribute
¶
Sum of all peak intensities in this frame (the SummedIntensities column).
mz_calibration_id
instance-attribute
¶
ID of the row in the MzCalibration table.
tims_calibration_id
instance-attribute
¶
ID of the row in the TimsCalibration table.
property_group_id
instance-attribute
¶
ID of the row in the PropertyGroups table, if present.
accumulation_time
instance-attribute
¶
Ion accumulation time in milliseconds.
ms_level
property
¶
MS level: 1 for an MS1 frame, 2 for an MS/MS frame (from msms_type).
scan_peaks
¶
Raw peaks, one (N_i, 2) [m/z, intensity] float64 array per mobility scan.
The list has one entry per scan in this element's scan range, in scan
order; empty scans give a (0, 2) array.
Raises:
| Type | Description |
|---|---|
ReaderClosedError
|
If the reader was closed. |
TdfpyError
|
If a window's scan range does not fit its frame (corrupt file). |
Source code in src/tdfpy/elems.py
raw_peaks
¶
raw_peaks(
*,
exclude: ChargeStateRegion | None = None,
smooth: Smooth | None = None,
noise: NoiseSpec = None,
mobility_type: MobilityType = "ook0"
) -> npt.NDArray[np.float64]
Raw peaks as one (N, 3) [m/z, intensity, ion_mobility] array.
Restricted to this element's scan range. See :func:tdfpy.get_raw_peaks
for the keyword arguments.
Raises:
| Type | Description |
|---|---|
ReaderClosedError
|
If the reader was closed. |
TdfpyError
|
If a window's scan range does not fit its frame (corrupt file). |
Source code in src/tdfpy/elems.py
centroid
¶
centroid(
*,
exclude: ChargeStateRegion | None = None,
smooth: Smooth | None = None,
noise: NoiseSpec = None,
mobility_type: MobilityType = "ook0",
centroid: Centroider | None = None
) -> npt.NDArray[np.float64]
Centroided peaks as one (N, 3) [m/z, intensity, ion_mobility] array.
Restricted to this element's scan range. The raw-peak keywords are
passed to :func:tdfpy.get_raw_peaks; centroider settings live on
:class:~tdfpy.Centroider (default :class:~tdfpy.MergePeaksCentroider).
Raises:
| Type | Description |
|---|---|
ReaderClosedError
|
If the reader was closed. |
TdfpyError
|
If a window's scan range does not fit its frame (corrupt file). |
Source code in src/tdfpy/elems.py
tdfpy.DDAMs1Frame
dataclass
¶
DDAMs1Frame(
*,
frame_id: int,
rt: float,
polarity: Polarity | None,
scan_mode: int,
msms_type: MsMsType,
tims_id: int | None,
base_peak_intensity: int,
total_ion_current: int,
num_scans: int,
num_peaks: int,
mz_calibration_id: int,
t1: float,
t2: float,
tims_calibration_id: int,
property_group_id: int | None,
accumulation_time: float,
ramp_time: float,
_timsdata: TimsData = _timsdata_field(),
precursors: tuple[Precursor, ...]
)
DIA and PRM MS1 frames¶
DIAMs1Frame and PRMMs1Frame add no fields to Frame; they exist so code can tell the
acquisition type from the frame's type. Find the windows or transitions of a run with
DIA.windows and PRM.transitions (both lookups with query() / query_range()).
tdfpy.DIAMs1Frame
dataclass
¶
DIAMs1Frame(
*,
frame_id: int,
rt: float,
polarity: Polarity | None,
scan_mode: int,
msms_type: MsMsType,
tims_id: int | None,
base_peak_intensity: int,
total_ion_current: int,
num_scans: int,
num_peaks: int,
mz_calibration_id: int,
t1: float,
t2: float,
tims_calibration_id: int,
property_group_id: int | None,
accumulation_time: float,
ramp_time: float,
_timsdata: TimsData = _timsdata_field()
)
Bases: Frame
An MS1 frame from a DIA acquisition.
Inherits all fields from Frame. DIA isolation windows belong to MS/MS
frames; use the reader's windows lookup for them.
tdfpy.PRMMs1Frame
dataclass
¶
PRMMs1Frame(
*,
frame_id: int,
rt: float,
polarity: Polarity | None,
scan_mode: int,
msms_type: MsMsType,
tims_id: int | None,
base_peak_intensity: int,
total_ion_current: int,
num_scans: int,
num_peaks: int,
mz_calibration_id: int,
t1: float,
t2: float,
tims_calibration_id: int,
property_group_id: int | None,
accumulation_time: float,
ramp_time: float,
_timsdata: TimsData = _timsdata_field()
)
Bases: Frame
An MS1 frame from a PRM acquisition.
Inherits all fields from Frame. PRM transitions belong to MS/MS frames;
use the reader's transitions lookup for them.