varRegression {RaceID}R Documentation

Linear Regression of Sources of Variability

Description

This functions regresses out variability associated with particular sources.

Usage

varRegression(object, vars = NULL, logscale = FALSE, Batch = FALSE)

Arguments

object

SCseq class object.

vars

data.frame of variables to be regressed out. Each column corresponds to a variable and each variable corresponds to a cell. The object must contain all cells, i.e. column names of the slot ndata from the SCseq object.

logscale

logical. If TRUE data are log-transformed prior to regression. Default is FALSE.

Batch

logical. If TRUE, then the function will regress out batch-associated variability based on genes stored in the filterpar$BGenes slot of the SCseq object. This requires prior batch correction with the filterdata function using bmode="RaceID".

Value

The function returns an updated SCseq object with the corrected expression matrix written to the slot dimRed$x of the SCseq object.

Examples

sc <- SCseq(intestinalDataSmall)
sc <- filterdata(sc)
b <- sub("(\\_\\d+)$","",colnames(intestinalData))
vars <- data.frame(row.names=colnames(intestinalData),batch=b)
sc   <- varRegression(sc,vars)

[Package RaceID version 0.3.5 Index]