Raw data data algorithms#

Low level utilities to work with raw data.

pydantic model tidyms2.algorithms.raw.AccumulateSpectraParameters#

Store accumulate_spectra parameters.

field end_time: pydantic.NonNegativeFloat [Required]#

Accumulate spectra starting until this acquisition time

field ms_level: pydantic.PositiveInt = 1#

the data MS level

field start_time: pydantic.NonNegativeFloat [Required]#

Accumulate spectra starting at this acquisition time

field subtract_left_time: float | None = None#

Scans with acquisition times lower than this value are subtracted from the accumulated spectrum. If None, no subtraction is done.

field subtract_right_time: float | None = None#

Scans with acquisition times greater than this value are subtracted from the accumulated spectrum. If None, no subtraction is done.

pydantic model tidyms2.algorithms.raw.MakeChromatogramParameters#

Store make_chromatogram parameters.

field accumulator: str = 'sum'#

How multiple values in a m/z windows are accumulated. "sum" computes the total intensity inside the window. "mean" divides the total intensity using the number of points inside the window.

field fill_missing: bool = True#

If True, sets the intensity to zero if no signal was found in a m/z window. If False, missing values are set to nan.

field mz: Sequence[float] [Required]#

a sorted sequence of m/z values

field window: pydantic.PositiveFloat = 0.05#

m/z tolerance to build EICs.

pydantic model tidyms2.algorithms.raw.MakeRoiParameters#

Store make_roi parameters.

field max_missing: pydantic.NonNegativeInt = 1#

maximum number of consecutive missing values in a ROI.

field min_intensity: pydantic.NonNegativeFloat = 0.0#

Discard ROIs if all of its elements have an intensity lower than this value.

field min_length: pydantic.PositiveInt = 5#

The minimum length of a ROI, defined as the number of non-NaN values in the ROI.

field multiple_match: str = 'reduce'#

How points are matched when there are multiple matches. If "closest" is used, the closest peak is assigned as a match and the others are used to create new ROIs. If "reduce" is used, an m/z and intensity pair is computed for all matching points using the mean for m/z and the sum for the intensity.

field pad: pydantic.NonNegativeInt = 0#

The number of dummy values to pad the ROI with

field targeted_mz: Sequence[float] | None = None#

If provided, only ROI with these m/z values will be created.

field tolerance: float = 0.01#

connect m/z values across scans if they are closer than this value

pydantic model tidyms2.algorithms.raw.MakeTICParameters#

Store make_tic parameters.

field kind: str = 'tic'#

tic computes the total ion chromatogram. bpi computes the base peak chromatogram

tidyms2.algorithms.raw.accumulate_spectra(ms_data, params)#

Accumulate consecutive spectra into a single spectrum.

Parameters:
Return type:

MSSpectrum

See also

AccumulateSpectraParameters

tidyms2.algorithms.raw.make_chromatograms(data, params)#

Compute multiple EIC from raw data using a list of m/z values.

Parameters:
Return type:

list[Chromatogram]

See also

MakeChromatogramParameters

tidyms2.algorithms.raw.make_roi(data, params)#

Build regions of interest (ROI) from raw data.

ROI are created by connecting values across scans based on the closeness in m/z. See the m/z trace extraction in LC-MS for a description of the algorithm used.

:param data : raw data :type params: MakeRoiParameters :param params: algorithm parameters

See also

lcms.MZTrace

See also

MakeRoiParameters

Return type:

list[MZTrace]

tidyms2.algorithms.raw.make_tic(data, params)#

Create a total ion chromatogram.

Parameters:
Return type:

Chromatogram

See also

MakeTICParameters