pinellolab / simba

SIMBA: SIngle-cell eMBedding Along with features
https://simba-bio.readthedocs.io
BSD 3-Clause "New" or "Revised" License
54 stars 7 forks source link

Query genes method not yielding expected behavior #7

Closed daquang closed 2 years ago

daquang commented 2 years ago

SIMBA_MultiBatchCorrection (10).zip

I am replicating the SIMBA multi-batch example. Finding neighbor genes of given pins (cell 67 and beyond) is not yielding the expected behavior. I'm not sure if it is because I am using developer versions of SIMBa and SIMBA_pbg. I have attached a zip of my python notebook for reference.

huidongchen commented 2 years ago

The issue is that there are no neighbor genes of the given pin in your case and therefore it can not plot them.

As the pytorch training procedure is not deterministic, the SIMBA embeddings of cells and genes from different runs are not exactly the same (although the structures are very similar).

That being said, when specifying the pin on UMAP to look for the neighbor genes, you will need to check UMAP plot to make sure there are actually points within the range (or instead of specifying the radius, you can also specify k nearest neighbors. then it will always return k genes).

daquang commented 2 years ago

Thank you, I changed use_radius to False and now I'm getting results that make sense.