Learn R Programming

MetaDBparse (version 2.0.0)

buildExtDB: Build external database using a given base database

Description

Wrapper function that takes a base database, an existing (or not) external database, and fills the extended database with adduct and isotope variants of the compounds in the base database.

Usage

buildExtDB(
  outfolder,
  ext.dbname = "extended",
  base.dbname,
  cl = 0,
  blocksize = 600,
  mzrange = c(60, 600),
  adduct_table = adducts,
  adduct_rules = adduct_rules,
  silent = silent,
  use.rules = TRUE,
  count.isos = F,
  all.isos = T
)

Arguments

outfolder

Which folder are your databases in?

ext.dbname

Extended database name (without .db suffix), Default: 'extended'

base.dbname

Base database name (without .db suffix)

cl

parallel::makeCluster object for multithreading, Default: 0

blocksize

How many compounds to process simultanaously? Higher means more memory spikes but faster building, Default: 600

mzrange

Range of m/zs to include in database, Default: c(60, 600)

adduct_table

Adduct table, Default: adducts

adduct_rules

Adduct rule table, Default: adduct_rules

silent

Silence warnings?, Default: silent

use.rules

Use adduct rules?, Default: TRUE

count.isos

Add columns for amounts of 2H, 13C, 15N atoms? Useful for heavy isotope experiments.

all.isos

Include and calculate all isotopes? (if FALSE, only takes the 100/main isotope).

See Also

SQLite fn as.data.table,rbindlist,fwrite,fread dbWriteTable pbapply check_chemform

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)
# }

Run the code above in your browser using DataLab