Calculate pearson residuals of features not in the scale.data This function is the secondary function under FetchResiduals
FetchResidualSCTModel(
object,
assay = "SCT",
umi.assay = "RNA",
layer = "counts",
chunk_size = 2000,
layer.cells = NULL,
SCTModel = NULL,
reference.SCT.model = NULL,
new_features = NULL,
clip.range = NULL,
replace.value = FALSE,
verbose = FALSE
)
Returns a matrix containing centered pearson residuals of added features
A seurat object
Name of the assay of the seurat object generated by SCTransform. Default is "SCT"
Name of the assay of the seurat object to fetch UMIs from. Default is "RNA"
Name of the layer under `umi.assay` to fetch UMIs from. Default is "counts"
Number of cells to load in memory for calculating residuals
Vector of cells to calculate the residual for. Default is NULL which uses all cells in the layer
Which SCTmodel to use from the object for calculating the residual. Will be ignored if reference.SCT.model is set
If a reference SCT model should be used for calculating the residuals. When set to not NULL, ignores the `SCTModel` paramater.
A vector of features to calculate the residuals for
Numeric of length two specifying the min and max values the Pearson residual will be clipped to. Useful if you want to change the clip.range.
Whether to replace the value of residuals if it already exists
Whether to print messages and progress bars