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

neigh_correct when computing spatial graph #834

Open
wangjiawen2013 opened this issue Jun 4, 2024 · 1 comment
Open

neigh_correct when computing spatial graph #834

wangjiawen2013 opened this issue Jun 4, 2024 · 1 comment
Assignees

Comments

@wangjiawen2013
Copy link

wangjiawen2013 commented Jun 4, 2024

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 ?

@giovp
Copy link
Member

giovp commented Jul 7, 2024

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.

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

No branches or pull requests

2 participants