View source: R/Functions_FeatureTable_analysis.R
mzMatch | R Documentation |
Find m/z matches for each item in a Feature Table in a database.
mzMatch(df, db, ppm = 5, mzdiff = 0.001)
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 |
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
)
a data.frame with the same number of rows as df
and columns
as described in details
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.