featlistCompare: featlistCompare

View source: R/Functions_Labelfinder.R

featlistCompareR Documentation

featlistCompare

Description

compare feature tables and find molecular features that are shifted from the mz values in reflist by mzdiff and are within rtdiff.

Usage

featlistCompare(
  reflist = reflist,
  complist = complist,
  mzdiff = 2 * 1.00335,
  pktol = 2,
  rtdiff = 10,
  ppm = 5
)

Arguments

reflist

data.frame with molecular features and columns mz, rt, rtmin, rtmax

complist

data.frame with molecular features and columns mz, rt, rtmin, rtmax

mzdiff

expected mz difference between features of interest in reflist and complist

pktol

maximum fold difference in retention time peak width between matched peaks

rtdiff

maximum retention time difference (same unit as rt columns in reflist and complist, typically seconds)

ppm

maximum relative mz difference between matched peaks in parts per million (ppm)

Details

Will first find matches in complist and then go back and find the shifted mz in reflist as well as the unshifted mass in complist.

Value

a list of data.frames

Examples

## Not run: 
 MseekExamplePreload(data = TRUE, tables = TRUE)
demo_reflist = data.frame(mz = 101:200,
                     rt = 201:300,
                     rtmin = 198:297,
                     rtmax = 201:300)

demo_complist = demo_reflist

demo_complist$mz <- demo_complist$mz + rnorm(100, 2*1.00335, sd = 2*1.00335/600)

demo_complist[101:150,] <- demo_complist[1:50,]

demo_complist$mz[101:150] <- demo_complist$mz[101:150] + 1e-10


compareResults <- featlistCompare(reflist = demo_reflist, complist = demo_complist)

  MseekExamplePreload(data = FALSE, tables = TRUE)
compareResultsBig <- featlistCompare(reflist = tab2$df, complist = tab2$df)


## End(Not run)


mjhelf/METABOseek documentation built on April 27, 2022, 5:13 p.m.