massdiff: Tabulate pairwise combinations of mass peaks

Description Usage Arguments Details Value See Also Examples

View source: R/massdiff.R

Description

Takes all pairwise combinations of masses from either an MSI data set that was imported with the function msimat, or from a simple numeric vector of masses.

Usage

1

Arguments

d

Either an MSI data set of class msimat, imported with the function msimat, or a numeric vector representing m/z values of mass peaks

Details

The number of possible pairs grows combinatorially and the calculation will fail for >65536 values (the function uses a 16-bit integer internally).

Value

Object of class massdiff with three elements:

A - m/z values for peak pairs; for a given pair, A will be lower than B. Requries that the peak list in the input be sorted ascending numerically by mass.

B - m/z values for peak pairs

diff - their respective differences

See Also

hist.massdiff to plot histogram of mass differences

adductMatch to match mass differences to possible molecular transformations

corrPairsMSI to test whether given peak pairs are correlated, using MSI intensity data from massdiff and msimat objects

Examples

1
2
3
d <- msimat(csv=system.file("extdata","msi.csv",package="mass2adduct"),sep=";")
d.diff <- massdiff(d) # d is an msimat object
print(d.diff) # Show a summary of massdiff object

kbseah/mass2adduct documentation built on June 9, 2021, 9:20 p.m.