mzrtsim: Generate simulated count data with batch effects for npeaks

View source: R/mzrtsim.R

mzrtsimR Documentation

Generate simulated count data with batch effects for npeaks

Description

Generate simulated count data with batch effects for npeaks

Usage

mzrtsim(
  ncomp = 100,
  fc = NULL,
  ncond = 2,
  ncpeaks = 0.1,
  nbatch = 3,
  nbpeaks = 0.1,
  npercond = 10,
  nperbatch = c(8, 5, 7),
  batchtype = "mb",
  rtsim = TRUE,
  db = NULL,
  seed = 42
)

Arguments

ncomp

compound numbers to be selected, default 100

fc

fold change of compounds with the same length of compounds numbers, default NULL

ncond

Number of conditions to simulate

ncpeaks

percentage of compounds influenced by conditions

nbatch

Number of batches to simulate

nbpeaks

percentage of peaks influenced by batchs

npercond

Number of samples per condition to simulate

nperbatch

Number of samples per batch to simulate

batchtype

type of batch. 'm' means monotonic, 'b' means block, 'r' means random error, 'mb' means mixed mode of monotonic and block, default 'mb'

rtsim

logical, simulate retention time or not

db

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

seed

Random seed for reproducibility

Details

the numbers of batch columns should be the same with the condition columns.

Value

list with rtmz data matrix, row index of peaks influenced by conditions, row index of peaks influenced by batchs, column index of conditions, column of batchs, raw condition matrix, raw batch matrix, peak mean across the samples, peak rsd across the samples

See Also

simdata

Examples

data(hmdbcms)
sim <- mzrtsim(db=hmdbcms)

yufree/mzrtsim documentation built on March 16, 2024, 12:22 p.m.