scmet_simulate_diff: Simulate differential methylation data from scMET.

View source: R/scmet_simulate.R

scmet_simulate_diffR Documentation

Simulate differential methylation data from scMET.

Description

General function for simulating two methylation datasets for performing differential methylation analysis. Differential analysis can be either performed in detecting changes in mean or variability of methylation patterns between the two groups. Similar to scmet_simulate, the function allows inclusion of covariates X that explain differences in mean methylation levels. Or also defining the trend for the mean - overdispersion relationship.

Usage

scmet_simulate_diff(
  N_feat = 100,
  N_cells = 50,
  N_cpgs = 15,
  L = 4,
  diff_feat_prcg_mu = 0,
  diff_feat_prcg_gamma = 0.2,
  OR_change_mu = 3,
  OR_change_gamma = 3,
  X = NULL,
  w_mu = c(-0.5, -1.5),
  s_mu = 1,
  w_gamma = NULL,
  s_gamma = 0.3,
  rbf_c = 1,
  cells_range = c(0.4, 0.8),
  cpgs_range = c(0.4, 0.8)
)

Arguments

N_feat

Total number of features (genomics regions).

N_cells

Maximum number of cells.

N_cpgs

Maximum number of CpGs per cell and feature.

L

Total number of radial basis functions (RBFs) to fit the mean-overdispersion trend. For L = 1, this reduces to a model that does not correct for the mean-overdispersion relationship.

diff_feat_prcg_mu

Percentage of features (betwen 0 and 1) that show differential mean methylation between the two groups.

diff_feat_prcg_gamma

Percentage of features (betwen 0 and 1) that show differential variability between the two groups.

OR_change_mu

Effect size change (in terms of odds ratio) of mean methylation between the two groups.

OR_change_gamma

Effect size change (in terms of odds ratio) of methylation variability between the two groups.

X

Covariates which might explain variability in mean (methylation). If X = NULL, a 2-dim matrix will be generated, first column containing intercept term (all values = 1), and second colunn random generated covariates.

w_mu

Regression coefficients for covariates X. Should match number of columns of X.

s_mu

Standard deviation for mean parameter mu.

w_gamma

Regression coefficients of the basis functions. Should match the value of L. If NULL, random coefficients will be generated.

s_gamma

Standard deviation of dispersion parameter gamma.

rbf_c

Scale parameter for empirically computing the variance of the RBFs.

cells_range

Range (betwen 0 and 1) to randomly (sub)sample the number of cells per feature.

cpgs_range

Range (betwen 0 and 1) to randomly (sub)sample the number of CpGs per cell and feature.

Value

Methylation data from two cell populations/conditions.

Examples

sim_diff <- scmet_simulate_diff(N_feat = 150, N_cells = 100, N_cpgs = 15, L = 4)


andreaskapou/scMET documentation built on June 1, 2022, 11:47 p.m.