Closed frederikziebell closed 3 years ago
There is no difference between the y
slot of the return list of vst()
and the output of get_residuals()
> vst_out <- vst(pbmc, return_cell_attr = TRUE)
> vst_residuals <- get_residuals(vst_out)
> identical(vst$y, vst_residuals)
[1] TRUE
Seurat::SCTransform
applies a different clipping to the residuals and also centers the genes. Check the documentation of Seurat::SCTransform
for details.
For more information what the slots in a Seurat Assay are, have a look at the Assay documentation (?Seurat::Assay
)
Thank you for the clarification, I haven't spotted the different clipping.
Hi Christoph,
what is the difference between what is stored in the
y
slot of the return fromvst()
and whatget_residuals()
returns? From the documentation,vst_out$y
contains pearson residuals but get_residuals() internally builds an additional regression model?I noted that
vst()
andSeurat::SCTransform()
give different results, potentially becauseSCTransform()
internally callsget_residuals()
. Here's an example:Could you please clarify (1) why get_residuals() is not simply a call to the
y
slot of thevst()
output? (2) ifget_residuals()
can be used to reproduce thescale.data
slot in Seurat (3) and maybe why thedata
slot in Seurat has only positive results? I actually thought that this would already contain pearson residuals.Thank you!