regressout | R Documentation |
Remove the effect of a variable from a gene expression matrix. This is done with linear regression. For each gene, we take lm(gene expression ~ var_to_reg). We use the residuals from this linear model as the new expression values. This was inspired by the Seurat::ScaleData function for single-cell analysis.
regressout(gem, var_to_reg, scale = NULL, center = NULL)
gem |
a matrix or data.frame; gene expression values with rows = genes aand columns = samples |
var_to_reg |
a vector with length = ncol(gem) (ie a variable with some number for each sample) |
scale |
T/F, default T, scale gem before lm |
center |
T/F, default T, center gem before lm |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.