FetchResiduals: Calculate pearson residuals of features not in the scale.data

View source: R/preprocessing5.R

FetchResidualsR Documentation

Calculate pearson residuals of features not in the scale.data

Description

This function calls sctransform::get_residuals.

Usage

FetchResiduals(
  object,
  features,
  assay = NULL,
  umi.assay = "RNA",
  layer = "counts",
  clip.range = NULL,
  reference.SCT.model = NULL,
  replace.value = FALSE,
  na.rm = TRUE,
  verbose = TRUE
)

Arguments

object

A seurat object

features

Name of features to add into the scale.data

assay

Name of the assay of the seurat object generated by SCTransform

umi.assay

Name of the assay of the seurat object containing UMI matrix and the default is RNA

layer

Name (prefix) of the layer to pull counts from

clip.range

Numeric of length two specifying the min and max values the Pearson residual will be clipped to

reference.SCT.model

reference.SCT.model If a reference SCT model should be used for calculating the residuals. When set to not NULL, ignores the 'SCTModel' paramater.

replace.value

Recalculate residuals for all features, even if they are already present. Useful if you want to change the clip.range.

na.rm

For features where there is no feature model stored, return NA for residual value in scale.data when na.rm = FALSE. When na.rm is TRUE, only return residuals for features with a model stored for all cells.

verbose

Whether to print messages and progress bars

Value

Returns a Seurat object containing Pearson residuals of added features in its scale.data

See Also

get_residuals


satijalab/seurat documentation built on May 11, 2024, 4:04 a.m.