scanpy icon indicating copy to clipboard operation
scanpy copied to clipboard

densmap

Open ivirshup opened this issue 4 years ago • 9 comments

This seems related to the new Densmap feature https://umap-learn.readthedocs.io/en/latest/densmap_demo.html (see https://www.biorxiv.org/content/10.1101/2020.05.12.077776v1)

Would be cool to support it in scanpy.

Originally posted by @gokceneraslan in https://github.com/theislab/scanpy/issues/1509#issuecomment-748156450

ivirshup avatar Feb 02 '21 03:02 ivirshup

I would be keen to see densmap added to scanpy. I can maybe help with a PR but not sure whether it's better/prefered to add a new sc.tl.densmap() function or add arguments to the existing sc.tl.umap()?

lazappi avatar Apr 27 '21 10:04 lazappi

I can maybe help with a PR but not sure whether it's better/prefered to add a new sc.tl.densmap()

Good question. In UMAP, I believe it's just a key word argument.

My instinct would be separate function, since it takes a few new arguments and has a few new values associated. Also, could potentially add a different key in obsm, since I don't think you can transform data into the existing space and this may conflict with ingest (any thoughts @Koncopd?).

I would also be interested in any thoughts you had on the applicability/ usefulness of the method in general. One question that comes up for me, is PCA space a reasonable original space to be using here?

ivirshup avatar Apr 27 '21 11:04 ivirshup

I think being able to see density could be really useful but I've only tried it a couple of times so not sure how it goes in practice. A lot of the motivation for wanting it in scanpy is to make it easier to try out 😸. The umap developers adding it to the main package seems like a good argument that it's useful though.

I hadn't thought about inputs but first guess is that PCA (or equivalent) should capture density relatively well? The function would let the user choose the input though right (with some sensible default)?

lazappi avatar Apr 27 '21 11:04 lazappi

A lot of the motivation for wanting it in scanpy is to make it easier to try out 😸.

We've definitely ended up with a number of features this way, but more so when we had fewer users... I think this would be a good candidate for an experimental module.

The umap developers adding it to the main package seems like a good argument that it's useful though.

I should look through the paper on this more carefully, but from my initial skimming I wasn't particularly convinced the relative density was meaningful.

I hadn't thought about inputs but first guess is that PCA (or equivalent) should capture density relatively well?

I'm suspicious it could be dependent on dataset make-up, e.g. what the components represent and whether they are likely to be shared.

ivirshup avatar May 03 '21 04:05 ivirshup

Ok, well I have half a function based on the current UMAP function which seems to work ok if that ends up being helpful for whatever implementation.

lazappi avatar May 03 '21 09:05 lazappi

Great, I think we may go for an experimental module as soon as next release (though, maybe the one after).

If you form any strong opinions or have any cool use cases for the function, I'd definitely be interested in hearing about it.

ivirshup avatar May 03 '21 09:05 ivirshup

Hi, did any one ever end up testing Densmap for scRNA ?

pakiessling avatar Jan 23 '24 14:01 pakiessling

I tried it out and I guess I had a function somewhere (not sure if I can find it again) but I don't think anyone looked more into adding it to scanpy.

lazappi avatar Jan 24 '24 07:01 lazappi

how's it going now

chansigit avatar May 31 '24 18:05 chansigit