Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

correct_counts

Correct data by setting all latent factors to their median values and reversing the regression model


Description

This version does not need a matrix of Pearson residuals. It takes the count matrix as input and calculates the residuals on the fly. The corrected UMI counts will be rounded to the nearest integer and negative values clipped to 0.

Usage

correct_counts(
  x,
  umi,
  cell_attr = x$cell_attr,
  verbosity = 2,
  verbose = NULL,
  show_progress = NULL
)

Arguments

x

A list that provides model parameters and optionally meta data; use output of vst function

umi

The count matrix

cell_attr

Provide cell meta data holding latent data info

verbosity

An integer specifying whether to show only messages (1), messages and progress bars (2) or nothing (0) while the function is running; default is 2

verbose

Deprecated; use verbosity instead

show_progress

Deprecated; use verbosity instead

Value

Corrected data as UMI counts

Examples

vst_out <- vst(pbmc, return_cell_attr = TRUE)
umi_corrected <- correct_counts(vst_out, pbmc)

sctransform

Variance Stabilizing Transformations for Single Cell UMI Data

v0.3.2
GPL-3 | file LICENSE
Authors
Christoph Hafemeister [aut, cre] (<https://orcid.org/0000-0001-6365-8254>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.