regress_out: Regress out library size effect

View source: R/naiveDE.R

regress_outR Documentation

Regress out library size effect

Description

Regresses out the effect of library size. This function is a wrapper for regress_out from the NaiveDE Python package.

Usage

regress_out(counts, sample_info)

Arguments

counts

matrix of variance stabilized counts, e.g. resulting from stabilize().

sample_info

data.frame with samples as rows and at least a column with total_counts.

Value

matrix of normalized counts.

Examples

## Mock up a SpatialExperiment object wit 400 cells and 3 genes
set.seed(42)
mock <- mockSVG(20, 3, 1)

stabilized <- stabilize(mock$counts)
sample_info <- mock$coordinates
sample_info$total_counts <- colSums(mock$counts)

regressed <- regress_out(counts = stabilized, sample_info = sample_info)

sales-lab/spatialDE documentation built on Feb. 12, 2024, 2:47 p.m.