-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can densMAP (in development version of Seurat) yield reproducible clustering? #9
Comments
This'll be because the seed is controlled in python, which has a separate RNG stream to R. Setting the R seed doesn't affect the python one. If you want reproducible densmap in R might I suggest using densvis? Otherwise flag the issue with the Seurat team, as I'm fairly sure the issue isn't with the densmap algorithm itself. |
eg, library("densvis")
set.seed(42)
x <- matrix(rnorm(200), ncol=2)
d1 <- densmap(x, random_state = 42L)
d2 <- densmap(x, random_state = 42L)
identical(d1, d2)
# TRUE vs library(Seurat)
data("pbmc_small")
set.seed(42)
pbmc_small1 <- RunUMAP(pbmc_small, dims = 1:5, densmap = TRUE)
set.seed(42)
pbmc_small2 <- RunUMAP(pbmc_small, dims = 1:5, densmap = TRUE)
identical(Embeddings(Reductions(pbmc_small1, "umap")), Embeddings(Reductions(pbmc_small2, "umap")))
# FALSE densvis also uses basilisk which means the umap version is conda-controlled. |
This is fixed now |
I"m running densMAP in the development version of Seurat, and it seems to work (hallelujah!) but the clustering is not reproducible. If I run the same pipeline twice over, the clustering is similar yet different. Is there a way to make it reproducible?
setting the seed doesn't help. Is this intrinsic to the densMAP algorithm? Or is there a way to make it reproducible?
thanks,
Nicolaas
ps command I run is:
RunUMAP(MySeuratObject, dims = 1:UMAP.dimensions, densmap=TRUE)
The text was updated successfully, but these errors were encountered: