Learn R Programming

MetaDBparse (version 2.0.0)

searchMZ: Find matches for m/z value in given database

Description

This function takes user m/z, ppm error, base database and the extended database to return hits of interest.

Usage

searchMZ(
  mzs,
  ionmodes,
  outfolder,
  base.dbname,
  ppm,
  ext.dbname = "extended",
  append = FALSE
)

Arguments

mzs

Vector of m/z values

ionmodes

Vector of pos/negative mode for each m/z value

outfolder

Which folder are your databases stored in?

base.dbname

Which base database do you want to retrieve info from? (without .db suffix)

ppm

Parts per million accepted error range

ext.dbname

Name of extended database (without .db suffix), Default: 'extended'

append

Use this when searching muiltiple base databases, so only one result table is created, Default: FALSE

Value

Data table with match results

See Also

SQLite rbindlist dbExecute,dbGetQuery,dbDisconnect fn

Examples

Run this code
# NOT RUN {
 
# }
# NOT RUN {
myFolder = tempdir()
# }
# NOT RUN {
 
# }
# NOT RUN {
buildBaseDB(outfolder = myFolder, "lmdb", test = TRUE)
# }
# NOT RUN {
 
# }
# NOT RUN {
file.remove(file.path(myFolder, "extended.db"))
# }
# NOT RUN {
 
# }
# NOT RUN {
data(adducts)
# }
# NOT RUN {
 
# }
# NOT RUN {
data(adduct_rules)
# }
# NOT RUN {
 
# }
# NOT RUN {
buildExtDB(outfolder = myFolder, base.dbname = "lmdb",
 silent=FALSE, adduct_table = adducts, adduct_rules = adduct_rules)
# }
# NOT RUN {
 
# }
# NOT RUN {
searchMZ(c("104.3519421"), "positive", outfolder = myFolder, "lmdb", ppm = 3)
# }

Run the code above in your browser using DataLab