regress_out {spatialDE} | R 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

    set.seed(42)
    mock <- mockSVG(10, 1000, 10)
    stabilized <- stabilize(mock$counts)
    sample_info <- mock$coordinates
    sample_info$total_counts <- colSums(mock$counts)
    regressed <- regress_out(counts = stabilized, sample_info = sample_info)

[Package spatialDE version 1.0.0 Index]