GetResiduals: Get Residuals

Description Usage Arguments Value Examples

View source: R/GetResiduals.R

Description

Get Residuals

Usage

1
2
3
4
5
6
7
8
GetResiduals(
  dnam,
  betaToM = TRUE,
  pheno_df,
  covariates_char,
  nCores_int = 1L,
  ...
)

Arguments

dnam

data frame or matrix of methylation values, with row names = CpG IDs, column names = sample IDs. This is often the genome-wide array data. Note that if beta values are the input here, then betaToM should be set to TRUE. If mvalues are the input, then betaToM should be set to FALSE

betaToM

indicates if converting methylation beta values to mvalues

pheno_df

a data frame with phenotype and covariates, with variable Sample indicating sample IDs.

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 CreateParallelWorkers for more information.

Value

output a matrix of residual values, in the same dimension as dnam

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
   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")
   )

lissettegomez/coMethDMR documentation built on April 25, 2021, 1:10 p.m.