createSparseMat: Creates a sparse matrix from a list of 'MassPeaks' objects

View source: R/createSparseMat.R

createSparseMatR Documentation

Creates a sparse matrix from a list of 'MassPeaks' objects

Description

The sparse matrix is created via 'Matrix::sparseMatrix'. This type of representation speeds-up computation compared to 'MALDIquant::MassPeaks'.

Usage

createSparseMat(x)

Arguments

x:

a list of MassPeaks objects.

Value

An S3 class 'sparseIntensityMatrix' with three slots; 'spmat' - sparse matrix of type 'Matrix::dgCMatrix' holding the spectral intensities (see ?Matrix::sparseMatrix), 'mzAxis' - a numeric holding all m/z bins (in Da) and, finally, 'coordinates' - a two-column matrix holding the coordinates of the spectra which are stored in rows of 'spmat'.


CeMOS-Mannheim/moleculaR documentation built on April 14, 2025, 8:27 a.m.