simulateSpectra: Simulate mutational spectra

View source: R/spectra.R

simulateSpectraR Documentation

Simulate mutational spectra

Description

Generate simulated data using zero-inflated Poisson model

Usage

simulateSpectra(
  W = NULL,
  pzero = 0,
  nmut = 100,
  h,
  N = 10,
  dilute.ultra = FALSE,
  min.mut = 1,
  distr = "pois",
  vmr = 2,
  Ntry = 10000
)

Arguments

W

Input signature matrix

pzero

Proportion of extra zero counts (scalar)

nmut

Mean number of mutations per sample (scalar)

h

Vector of average proportion of mutations in each process; length equal to the number of columns in W.

N

No. of samples

dilute.ultra

Dipute ultra-mutated samples to reduce bias

min.mut

Minimum mutation load

distr

Underlying distribution of exposure counts; c('pois', 'nbinom'), either Poisson or negative binomial.

vmr

Variance to mean ratio of negative binomial.

Details

See Omichessan et al. DOI: 10.1371/journal.pone.0221235

Value

List of components X: simulated mutation counts; W, H: signature and exposure matrices.

Examples

set.seed(135)
K <- 5 # no. of processes
W <- t(gtools::rdirichlet(n = K, alpha = rep(1, 96)))
rownames(W) <- trinucleotides()
h <- gtools::rdirichlet(n = 1, alpha = rep(5, K))
x <- simulateSpectra(W = W, h = h, N = 100)

h <- read.table(system.file('extdata', 'hmean_breast_lung_skin_pancr.txt',
                            package = 'tempoSig'), header = TRUE, sep = '\t')
h <- t(h)['Breast',]
x <- simulateSpectra(h = h, N = 100)

mskcc/tempoSig documentation built on Feb. 3, 2023, 8:35 a.m.