GetResiduals | R Documentation |
Remove covariate effects from methylayion values by fitting probe-specific linear models
GetResiduals( dnam, betaToM = TRUE, epsilon = 1e-08, pheno_df, covariates_char, nCores_int = 1L, ... )
dnam |
data frame or matrix of methylation values with row names = CpG IDs and column names = sample IDs. This is often the genome-wide array data. |
betaToM |
indicates if methylation beta values (ranging from [0, 1])
should be converted to M values (ranging from (-Inf, Inf)). Note that if
beta values are the input to |
epsilon |
When transforming beta values to M values, what should be done
to values exactly equal to 0 or 1? The M value transformation would yield
|
pheno_df |
a data frame with phenotype and covariates, with variable
|
covariates_char |
character vector for names of the covariate variables |
nCores_int |
Number of computing cores to be used when executing code in parallel. Defaults to 1 (serial computing). |
... |
Dots for additional arguments passed to the cluster constructor.
See |
This function fits an ordinary linear model predicting methylation values for each probe from the specified covariates. This process will be useful in scenarios where methylation values in a region or at an individual probe are known a priori to have differential methylation independent of the disease or condition of interest.
output a matrix of residual values in the same dimension as
dnam
data(betasChr22_df) data(pheno_df) GetResiduals( dnam = betasChr22_df[1:10, 1:10], betaToM = TRUE, pheno_df = pheno_df, covariates_char = c("age.brain", "sex", "slide") )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.