Description Usage Arguments Value Examples
View source: R/preprocessing.R
Removing Confounding Factor Effects using Linear Regression
1 | cfr_linReg(mat, cov)
|
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 |
a list with three elements, i) corrected expression matrix, ii) coefficients for the covariates and iii) p values for each covariate
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.