scverse / squidpy

Spatial Single Cell Analysis in Python
https://squidpy.readthedocs.io/en/stable/
BSD 3-Clause "New" or "Revised" License
400 stars 70 forks source link

neigh_correct when computing spatial graph #834

Open wangjiawen2013 opened 1 month ago

wangjiawen2013 commented 1 month ago

Hi, what does the parameter mean when build spatial neighborhood graph (https://squidpy.readthedocs.io/en/stable/_modules/squidpy/gr/_build.html#spatial_neighbors)? image

And, here is the sturcture of 10x visium chip: image when I set the following n_rings=2 and n_neighs=6, I expect there should be more neighbours when n_rings=2 than n_rings=1, but I have set n_neighs=6, are the neighbours still the same between n_rings=1 and n_rings=2 ? sq.gr.spatial_neighbors(adata, n_rings=2, coord_type="grid", n_neighs=6)

In visium, one spot and it's 6 neighbours have the same euclidean distance. In this case, what will happens if I set n_neighs=3 or n_neighs=10 ? Is it mandatory to set n_neighs=6 for 10x visium ?