Generate simulated mzml data and compounds list

simmzml(
  db,
  name,
  n = 100,
  inscutoff = 0.05,
  mzrange = c(100, 1000),
  rtrange = c(0, 600),
  ppm = 5,
  sampleppm = 5,
  mzdigit = 5,
  noisesd = 0.5,
  scanrate = 0.2,
  pwidth = 10,
  baseline = 100,
  baselinesd = 30,
  SNR = 100,
  tailingfactor = 1.2,
  compound = NULL,
  rtime = NULL,
  tailingindex = NULL,
  seed = 42,
  unique = FALSE,
  matrix = FALSE,
  matrixmz = NULL
)

Arguments

db

compound database with MS1 data. e.g. hmdbcms or monams1

name

file name of mzml

n

compound numbers from database, if compound is not NULL, n will be compound number, default 100

inscutoff

intensity cutoff for MS1 spectra, default 0.05

mzrange

m/z range for simulation, peaks out of the range will be removed, default c(100,1000)

rtrange

retention time range for simulation, default c(0,600)

ppm

m/z shift in ppm for input compounds, default 5

sampleppm

m/z shift in ppm within one sample, default 5

mzdigit

m/z digits, default 5

noisesd

standard deviation for normal distribution of m/z shift, default 0.5

scanrate

time for each full scan, default 0.2 second or 5 spectra per second

pwidth

peak width for the compound. If it's a single value, simulated peaks' width will use this number as the lambda of Poisson distribution. If it's a numeric vector, it will be used as the peak width for each compounds.

baseline

noise baseline, default 100

baselinesd

standard deviation for noise, default 30

SNR

signal to noise ratio of each compound, default 100 for all compounds when baseline is 100

tailingfactor

tailing factor for peaks, larger means larger tailing, default 1.2

compound

numeric compound index in the database for targeted analysis, default NULL

rtime

retention time for the compounds, if NULL, retention time will be simulated. Default NULL

tailingindex

numeric index for tailing compounds, if NULL, all peaks will tailing. Default NULL

seed

Random seed for reproducibility

unique

if TRUE, one compound will have one spectra. Default FALSE

matrix

if TRUE, m/z from experimental data will be used for background m/z simulation.Default FALSE

matrixmz

custom matrix m/z vector, default NULL and predefined list from serum blank will be used.

Value

one mzML file for simulated data and one csv file the simulated compounds with retention time, m/z and name

Examples

data(monams1)
simmzml(db=monams1, name = 'test')
#> Warning: mzR has been built against a different Rcpp version (1.0.12)
#> than is installed on your system (1.0.13). This might lead to errors
#> when loading mzR. If you encounter such issues, please send a report,
#> including the output of sessionInfo() to the Bioc support forum at 
#> https://support.bioconductor.org/. For details see also
#> https://github.com/sneumann/mzR/wiki/mzR-Rcpp-compiler-linker-issue.