squidpy icon indicating copy to clipboard operation
squidpy copied to clipboard

neigh_correct when computing spatial graph

Open wangjiawen2013 opened this issue 1 year ago • 1 comments

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 ?

wangjiawen2013 avatar Jun 04 '24 09:06 wangjiawen2013

hi @wangjiawen2013 that's parameter is used when building visium neighbor graph, when there is some sway. This is because the actual coordinates of the spots might have some errors, and without that correction sometime the hexagonal graph structure is not preserved. I would suggest you to take a look with and without with your own data.

giovp avatar Jul 07 '24 14:07 giovp

I am closing this. Feel free to reopen

selmanozleyen avatar Nov 07 '25 10:11 selmanozleyen