simulator_ewas: simulator_ewas : function to simulate DNA methylation data...

Description Usage Arguments Details Value Examples

Description

simulator_ewas : function to simulate DNA methylation data for EWAS

Usage

1
2
3
simulator_ewas(n = 100, p = 500, K = 5, freq = NULL,
  prop.causal = 0.01, prop.variance = 0.4, sigma = 1, sd.A = 0.2,
  mean.A = 1, sd.U = 1, sd.V = 1)

Arguments

n

: number of individuals

p

: number of cpg variables

K

: number of latent factors

freq

: (vector) mean methylation values (if NULL, set randomly)

prop.causal

: proportion of causal variables (probes/loci)

prop.variance

: proportion of exposure variance explained by latent structure (intensity of confounding)

sigma

: standard deviation of residual errors

sd.A

: standard deviation for effect sizes

mean.A

: (vector) mean of effect sizes

sd.U

: (vector) standard deviations for factors

sd.V

: standard deviations for loadings

Details

This function is used to simulate datasets for EWAS. The simulation model is based on linear relationships. First, it construct a covariance matrix for X and U and prop.variance (intensity of the confounders or correlation between X and U). Then this matrix is used to simulate via normal laws X and U. Thereafter, the effect sizes of X (A) and U (V) are calculated using mean parameters of effect sizes (meanA) and standard deviations (sdA and sdV). Note that the effect sizes of X are calculated only for causal mediators with X. For non-causal mediators, the effect sizes is 0. On the other hand, a residual error matrix is calculated via the sigma (Z) parameter. To finish the methylation matrix is calculated thanks to the formula : Y = V*U + A*X + Z

Value

Y : matrix of methylation beta values

Ynorm : pnorm(Y)

X : exposure

A : effect sizes exposure

causal : set of CpGs associated with the exposure

U : simulated confounders

V : loadings of coufounders

freq : mean methylation values

Examples

1
2
# Simulate data :
simu <- simulator_ewas(100, 500, 5)

jumentib/useFonc documentation built on Nov. 18, 2019, 3:17 p.m.