get_residual_var {sctransform}R Documentation

Return variance of residuals of regularized models

Description

This never creates the full residual matrix and can be used to determine highly variable genes.

Usage

get_residual_var(vst_out, umi, residual_type = "pearson",
  res_clip_range = c(-sqrt(ncol(umi)), sqrt(ncol(umi))),
  cell_attr = vst_out$cell_attr, bin_size = 256,
  show_progress = TRUE)

Arguments

vst_out

The output of a vst run

umi

The UMI count matrix that will be used

residual_type

What type of residuals to return; can be 'pearson' or 'deviance'; default is 'pearson'

res_clip_range

Numeric of length two specifying the min and max values the residuals will be clipped to; default is c(-sqrt(ncol(umi)), sqrt(ncol(umi)))

cell_attr

Data frame of cell meta data

bin_size

Number of genes to put in each bin (to show progress)

show_progress

Whether to print progress bar

Value

A vector of residual variances (after clipping)

Examples

## Not run: 
vst_out <- vst(pbmc)
res_var <- get_residual_var(vst_out, pbmc)

## End(Not run)


[Package sctransform version 0.2.0 Index]