squidpy icon indicating copy to clipboard operation
squidpy copied to clipboard

Parameters of squidpy.gr.spatial_neighbors()

Open Qirongmao97 opened this issue 2 years ago • 1 comments

Dear Squidpy developers:

I'm not quite sure some of the parameters in squidpy.gr.spatial_neighbors() function.

I noticed that there are parameters of n_neighs and radius for the generic coordinates data, what's the differences between them? I tried to input them both in the fuction and no matter how many time I changed n_neighs, the result still remain the same, does that mean radius suppress n_neighs ?

Thanks!

Qirongmao97 avatar Dec 13 '23 14:12 Qirongmao97

radius suppress n_neighs exactly, however only if all the neighbors have distance < radius. If you select n_neighs high enough so that some neighs have distance > radius, than they will be preserved.

giovp avatar Apr 25 '24 08:04 giovp