Matrix of residuals form lucida fit with genes along rows. This is stored as a ResidualMatrixGLM and entries are only evaluated when accessed
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))
# fit joint model on all cells
fit <- lucida(sce, ~ 1)
#> Analyze all cells jointly...
#> all
#>
| | 0%, ETA NA
|=======================================================| 100%, Elapsed 00:00
#>
| | 0%, ETA NA
|=======================================================| 100%, Elapsed 00:00
#>
# extract residuals as a ResidualMatrixGLM
res <- residuals(fit, sce)
res[1:3, 1:3]
#> <3 x 3> DelayedMatrix object of type "double":
#> ATCATGCTGCGTAT-1 GTACGAACTGTCAG-1 CGTGATGAATTTCC-1
#> HES4 -0.01601760 -0.01601760 -0.01601760
#> ISG15 3.24949708 2.20217242 -0.15216263
#> AURKAIP1 3.87051294 -0.01974081 3.87051294