This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Seurat sctransform return.only.var.genes = FALSE

Hi,

If I set return.only.var.genes = FALSE for sctransform in Seurat, will RunPCA use all genes by default or only variable genes (as it would with return.only.var.genes = TRUE)? I am struggling to find the relevant code on their GitHub. If anyone could point me in the direction of that code, that would be really helpful.

Best wishes,

Lucy

scrna-seq seurat sctransform

2 answers

I think it will use all genes. This is the code from their GitHub:

if (return.only.var.genes & !conserve.memory) {

scale.data <- vst.out$y[top.features, ]

} else {

scale.data <- vst.out$y

}

Thanks - that's really helpful. However, I am a bit confused as my UMAP seems to look they same whether I set return.var.only.genes = TRUE or return.var.only.genes = FALSE.

This information is available in the manual. RunPCA will only use the variable features unless you specify otherwise via the features parameter. RunUMAP uses PCA reductions by default, though you can force it to run on features directly with the features parameter (probably not what you want, and will take much, much longer to run).

Thank you - that makes sense with the data that I have been getting. Do you know where in the code this is specified?

Those are just the default parameters for each specified function. You can see them in the manual or using ?RunPCA, etc in RStudio.

Log in to answer this question.