mzMatch: mzMatch

View source: R/Functions_FeatureTable_analysis.R

mzMatchR Documentation

mzMatch

Description

Find m/z matches for each item in a Feature Table in a database.

Usage

mzMatch(df, db, ppm = 5, mzdiff = 0.001)

Arguments

df

data.frame that contains a mz column

db

data.frame that contains the compound database and at least columns mz and id. Can also be a character vector of .csv file paths (will be combined into a single list for the search, with duplicate lines removed)

ppm

ppm mz tolerance

mzdiff

maximum mz difference. NOTE: either ppm OR mzdiff condition has to be met

Details

columns in the resulting data.frame contain hits for each entry (row) in df :

  • mzMatches identity of the seach hits in db, taken from the id column of each db

  • mzMatchError ppm error, based on difference between db$mz and df$mz for each search hit.

All other columns defined in any db file are added as well with the prefix mzMatch_. If there are multiple hits across the db files, they will be separated by "|" within each column (including mzMatches and mzMatchError)

Value

a data.frame with the same number of rows as df and columns as described in details

Examples

testdb <- read.csv(system.file("extdata", "examples", "example_projectfolder",
 "mini_example_features.csv", package = "Metaboseek"))
testdb

matches <- mzMatch(df = testdb, db = c(system.file("db", "smid-db_pos.csv", package = "Metaboseek")))

updateDF(matches,testdb)


mjhelf/Mosaic documentation built on April 28, 2022, 11:32 a.m.