cfr_linReg: Removing Confounding Factor Effects using Linear Regression

Description Usage Arguments Value Examples

View source: R/preprocessing.R

Description

Removing Confounding Factor Effects using Linear Regression

Usage

1

Arguments

mat

a numeric matrix with the expression values, where columns are the samples and rows are probesets, transcripts, or genes.

cov

a list with covariates to regress out from the expression matrix

Value

a list with three elements, i) corrected expression matrix, ii) coefficients for the covariates and iii) p values for each covariate

Examples

1
2
3
4
5
6
7
8
myexp <- sapply( 1:10, function(i){ rnorm(n = 10000, mean = sample(1:3, 1), sd = sample(c(1, 3), 1)) })
mycov <- list(batch = sample(c(0, 1), 10, replace = TRUE))
resx <- cfr_linReg(myexp,mycov)
print(myexp[1:5,1:5])
print(resx$correctedExp[1:5,1:5])
dim(resx$correctedExp)
head(resx$cov_coef)
head(resx$cov_p)

mdonertas/hetAge documentation built on Jan. 2, 2020, 12:53 a.m.