mergeTolerance: Merge spectra with m/z tolerance

View source: R/extract_merge.R

mergeToleranceR Documentation

Merge spectra with m/z tolerance

Description

mergeTolerance() merges two spectra by identifying common peaks with a given m/z tolerance. It can be used with Reduce() to merge more than two spectra.

Usage

mergeTolerance(x, y, tolerance = 1e-05)

Arguments

x, y

MS2 spectra as objects of class matrix with m/z in the first column and intensity in the second.

tolerance

The m/z tolerance used for merging. If two peaks are within tolerance, they are regarded as the same. Defaults to 1e-5, i.e. 10ppm.

Value

A matrix with m/z in the first column and separate columns for intensities in the respective spectra. If peaks were merged, their m/z corresponds to the mean of the two original m/z.


tdepke/CluMSID documentation built on April 10, 2022, noon