scverse / scverse/squidpy

n-hop neighbors in spatial graph

Open
#1,159 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
598
Forks
121
Avg merge
3d 11h
Merged PRs (30d)
3

Description

Description of feature

I think it would be useful to add a function to derive n-hop neighbors.
In some cases, that's better than just using a larger radius since it takes gaps in the tissue properly into account.
For instance, in the case of core needle biopsies, we often have situations like this one, where

(A) = cell of interest
(B) = cell of same tissue section within radius $r_1$, that's reachable via 3-hop neighborhood based on radius $r_2$.
(C) = cell on other tissue section (-> distances are not meaningful with respect to cell A) that's also within $r_1$, but cannot be reached via 3-hop neighborhood based on radius $r_2$.

Image

IMO this would be useful irrespective of the method (radius, delauney), so probably a postprocessing function?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no file, test, or entry point; start by reviewing Squidpy's existing radius and Delaunay spatial-neighborhood implementations. Use the A/B/C example to define n-hop reachability, and consider how a postprocessing function can work independently of the graph-construction method.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.