satijalab / seurat

R toolkit for single cell genomics
http://www.satijalab.org/seurat
Other
2.28k stars 909 forks source link

dispersion.cutoff and mean.cutoff don't seem to work at all with FindVariableFeatures() #9128

Closed Rayan21100 closed 1 month ago

Rayan21100 commented 3 months ago

Hi,

I'm doing spatial single-cell analysis on CosMx databases and I've run into a problem when using FindVariableFeatures(). I have only 960 genes in total so I wanted to plot the variable genes and choose them with the cuttoff depending on the vizualization. I have a list of Seurat Object (lung_data) and the first one is lung5_1. At the begining I've run:

lung_data$lung5_1<-FindVariableFeatures(lung_data$lung5_1)
plot <- VariableFeaturePlot(lung_data$lung5_1)
plot

And I got this plot:

cutoff

Then I tried different dispersion cutoff c(2,10), c(2,Inf) or even c(10000,Inf) but nothing changes and I get the exact same plot each time. This is how I changed the cutoff:

lung_data$lung5_1<-FindVariableFeatures(lung_data$lung5_1,dispersion.cutoff=c(2,Inf))
plot <- VariableFeaturePlot(lung_data$lung5_1)
plot

I also tried mean.cutoff but again the plot is identical and all of my genes are considered variable. However if I change nfeatures, then I have a different plot. How come dispersion.cutoff and mean.cutoff don't have any effect ?

Thank you in advance!

samuel-marsh commented 1 month ago

Hi,

Not member of dev team but hopefully can be helpful. The parameters you mention are when using the mean.var.plot method for feature selection and not vst. So you need to specify that method in FindVariableFeatures code along with the parameters.

Best, Sam