1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
\name{get_residuals}
\alias{get_residuals}
\title{Return Pearson or deviance residuals of regularized models}
\usage{
get_residuals(
vst_out,
umi,
residual_type = "pearson",
res_clip_range = c(-sqrt(ncol(umi)), sqrt(ncol(umi))),
min_variance = vst_out$arguments$min_variance,
cell_attr = vst_out$cell_attr,
bin_size = 256,
verbosity = vst_out$arguments$verbosity,
verbose = NULL,
show_progress = NULL
)
}
\arguments{
\item{vst_out}{The output of a vst run}
\item{umi}{The UMI count matrix that will be used}
\item{residual_type}{What type of residuals to return; can be 'pearson' or 'deviance'; default is 'pearson'}
\item{res_clip_range}{Numeric of length two specifying the min and max values the results will be clipped to; default is c(-sqrt(ncol(umi)), sqrt(ncol(umi)))}
\item{min_variance}{Lower bound for the estimated variance for any gene in any cell when calculating pearson residual; default is vst_out$arguments$min_variance}
\item{cell_attr}{Data frame of cell meta data}
\item{bin_size}{Number of genes to put in each bin (to show progress)}
\item{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}
\item{verbose}{Deprecated; use verbosity instead}
\item{show_progress}{Deprecated; use verbosity instead}
}
\value{
A matrix of residuals
}
\description{
Return Pearson or deviance residuals of regularized models
}
\examples{
\donttest{
vst_out <- vst(pbmc, return_cell_attr = TRUE)
pearson_res <- get_residuals(vst_out, pbmc)
deviance_res <- get_residuals(vst_out, pbmc, residual_type = 'deviance')
}
}
|