Skip to contents

Variance stabilizing transform using deviance residuals from negative binomial regression model

Usage

vst(x)

Arguments

x

model fit from lucida()

Value

returns deviance residuals for NB model fit from each gene after dispersion smoothing and shrinkage

Examples

library(SingleCellExperiment)

# Load example data
data(example_sce, package="muscat")
sce <- example_sce

# Compute library size for each cell
sce$libSize <- colSums(counts(sce))

# run NB model on all cells
res <- lucida(sce, ~ 1, verbose=FALSE)
#> all 

# Variance Stabilizing Transform
res.vst <- vst( res )

res.vst[1:3, 1:3]
#>          ATCATGCTGCGTAT-1 GTACGAACTGTCAG-1 CGTGATGAATTTCC-1
#> HES4           -0.2446638       -0.2593426       -0.2490049
#> ISG15          -0.3593083       -0.4249165       -0.4703207
#> AURKAIP1        2.2884244       -0.4056374        2.2058815