network1: network1

Description Usage Arguments Value

View source: R/Functions_Spectra_comparison.R

Description

Compare two spectra and calculate a similarity score (e.g. intensity values of matched MS peaks) NOTE: handling matching peaks from one spectrum that match multiple peaks from the other spectrum is implemented now but needs testing

Usage

1
2
network1(spec1, spec2, mztol = 0.005, ppm = 0, parentshift = 0,
  method = "cosine", minpeaks = 6, nonmatched = T)

Arguments

spec1

spectrum 1

spec2

spectrum 2

mztol

max m/z difference between peaks to match matching

ppm

max difference between peaks in ppm

parentshift

m/z difference between parentmasses (importantly, has to be Parent(spec2) - Parent(spec1) ) to find alternative matches / neutral loss matches; will only be calculated if abs(parentshift) > abs(mztol)

method

method passed on to pairCompare(); "cosine" will use lsa::cosine(), "pearson" will use stats::cor()

minpeaks

minimum number of peaks that have to be matched, otherwise returns 0

nonmatched

if TRUE, will add non-matching peaks to calculation, with 0 intensity in the spectrum missing the peak

Value

the result of the method call, a numeric similarity score


mjhelf/MassTools documentation built on Nov. 19, 2021, 2:38 a.m.