Skip to content
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) yield reproducible clustering? #4762

Closed
NicolaasVanRenne opened this issue Jul 12, 2021 · 3 comments
Closed

Comments

@NicolaasVanRenne
Copy link

densMAP 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?

thanks,

Nicolaas

ps command I run is:
RunUMAP(MySeuratObject, dims = 1:UMAP.dimensions, densmap=TRUE)

@k3yavi
Copy link
Member

k3yavi commented Jul 16, 2021

Hi @NicolaasVanRenne ,

I think it's unrelated to Seurat and rather the feature/issue of generating low dimensional embeddings using UMAP as it can result in different looking (although topologically similar) clusters in multiple runs of the same data. Although you can try setting the seed like set.seed(12) and check if that helps.

@k3yavi k3yavi closed this as completed Jul 16, 2021
@NicolaasVanRenne
Copy link
Author

NicolaasVanRenne commented Jul 16, 2021

Thanks for replying @k3yavi ,

However, I always apply set.seed as you mentioned. It does not work to make densMAP reproducible. Getting reproducible plots is important to me - as I would prefer my analyses to be reproducible...

Maybe @lldelisle can help here? As she wrote the code as I understood from #4630

Any thoughts?

Nicolaas

@lldelisle
Copy link
Contributor

Hi,
I am sorry. I cannot really help. Apparently the seed is set in python by:

if (!is.null(x = seed.use)) {
py_set_seed(seed = seed.use)
}

And it is set to 42 by default:
seed.use = 42L,

...
Sorry...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants