Skip to content
David Teschner edited this page Apr 5, 2024 · 1 revision

Introduction

This is a library containing core data structures and functionality for ion-mobility separated mass spectrometry data.

Installation

Datastructures

Enums

MsType

Used to distinguish between different types of mass spectra, e.g., MS1, MS2, etc.

Spectra

MzSpectrum

Description

A single mass spectrum, containing a vector of m/z values and a vector of corresponding intensities.

Methods

new

Creates a new MzSpectrum from a vector of m/z values and a vector of corresponding intensities.

to_resolution(resolution: i32) -> MzSpectrum

Returns a new MzSpectrum where m/z values are binned to the given resolution. The intensities are summed up for all m/z values that fall into the same bin.

filter_ranged(mz_min: f64, mz_max: f64, intensity_min: f64, intensity_max: f64) -> MzSpectrum

Returns a new MzSpectrum where all m/z values that are not in the given range are removed. The same is done for intensities.

IndexedMzSpectrum

A single MzSpectrum that additionally contains a vector of m/z indices, e.g., time-of-flight (TOF) values.

Methods

new

Creates a new IndexedMzSpectrum from a vector of m/z values, a vector of corresponding intensities, and a vector of m/z indices.

to_resolution(resolution: i32) -> IndexedMzSpectrum

Returns a new IndexedMzSpectrum where m/z values are binned to the given resolution. The intensities are summed up for all m/z values that fall into the same bin, tof indices are averaged for all m/z values that fall into the same bin.

filter_ranged(mz_min: f64, mz_max: f64, intensity_min: f64, intensity_max: f64) -> IndexedMzSpectrum

Returns a new IndexedMzSpectrum where all m/z values that are not in the given range are removed. The same is done for intensities. Tof indices are removed if the corresponding m/z value is removed.

TimsSpectrum

A single IndexedMzspectrum that additionally contains a frame index, scan index, retention time, inverse ion mobility value, and an MsType. It is used to represent a single scan of a timsTOF dataset.

Frames

ImsFrame

A flat collection of spectra that belong to the same retention time, composed of a vector of ion-mobilities, a vector of m/z values and a vector of intensities.

TimsFrame

A flat collection of spectra that belong to the same retention time, composed of a frame index, retention time value, a vector of scans, a vector of ion-mobilities, a vector of m/z values, a vector of TOF indices, and a vector of intensities.

Slices

TimsSlice

A collection of TimsFrame objects, mainly used to parallelize independent computations like filtering, binning etc. over frames.