meffil.ewas: Epigenome-wide association study

View source: R/ewas.r

meffil.ewasR Documentation

Epigenome-wide association study

Description

Test association with each CpG site.

Usage

meffil.ewas(
  beta,
  variable,
  covariates = NULL,
  batch = NULL,
  weights = NULL,
  sites = NULL,
  samples = NULL,
  cell.counts = NULL,
  isva = F,
  sva = T,
  smartsva = F,
  smartsva.alpha = 0.5,
  n.sv = NULL,
  winsorize.pct = 0.05,
  robust = FALSE,
  rlm = FALSE,
  outlier.iqr.factor = NA,
  most.variable = 50000,
  featureset = NA,
  random.seed = 20161123,
  lmfit.safer = F,
  verbose = F
)

Arguments

beta

Methylation levels matrix, one row per CpG site, one column per sample or the filename of GDS (Genomic Data Structure) output from meffil.normalize.samples.

variable

Independent variable vector.

covariates

Covariates data frame to include in regression model, one row per sample, one column per covariate (Default: NULL).

batch

Batch vector to be included as a random effect (Default: NULL). Ignored if beta is a GDS filename.

weights

Non-negative observation weights. Can be a numeric matrix of individual weights of same dimension as beta, or a numeric vector of weights with length ncol(beta), or a numeric vector of weights with length nrow(beta).

sites

Restrict the EWAS to the given CpG sites – must match row names of beta (Default: NULL).

samples

Restrict the EWAS to the given samples – must match column names of beta (Default: NULL).

cell.counts

Proportion of cell counts for one cell type in cases where the samples are mainly composed of two cell types (e.g. saliva) (Default: NULL). Ignored if beta is a GDS filename.

isva

Apply Independent Surrogate Variable Analysis (ISVA) to the methylation levels and include the resulting variables as covariates in a regression model (Default: FALSE).

sva

Apply Surrogate Variable Analysis (SVA) to the methylation levels and covariates and include the resulting variables as covariates in a regression model (Default: TRUE).

smartsva

Apply the SmartSVA algorithm to the methylation levels and include the resulting variables as covariates in a regression model (Default: FALSE).

smartsva.alpha

alpha argument to SmartSVA providing the initial point for optimization. Smaller values reduce the number of iterations needed to reach convergence. Setting this 1 will produce exactly the outputs as SVA. (Default: 0.5).

n.sv

Number of surrogate variables to calculate (Default: NULL).

winsorize.pct

Apply all regression models to methylation levels winsorized to the given level. Set to NA to avoid winsorizing (Default: 0.05).

robust

Test associations with the 'robust' option when limma::eBayes is called (Default: TRUE). Ignored if beta is a GDS filename.

rlm

If beta is a matrix, then test associations with the 'robust' option when limma:lmFit is called. If beta is a GDS filename, then test associations using robust regression using MASS::rlm and calculate statistical significance using lmtest::coeftest with vcov=sandwich::vcovHC(fit, type="HC0") (Default: FALSE).

outlier.iqr.factor

For each CpG site, prior to fitting regression models, set methylation levels less than Q1 - outlier.iqr.factor * IQR or more than Q3 + outlier.iqr.factor * IQR to NA. Here IQR is the inter-quartile range of the methylation levels at the CpG site, i.e. Q3-Q1. Set to NA to skip this step (Default: NA).

most.variable

Apply (Independent) Surrogate Variable Analysis to the given most variable CpG sites (Default: 50000).

featureset

No longer used (Default: NA).

verbose

Set to TRUE if status updates to be printed (Default: FALSE).


perishky/meffil documentation built on June 9, 2024, 5:59 p.m.