scverse / scverse/squidpy

Why does co_occurence not use a pre-calculated spatial graph

Open
#1,165 0 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

As far as I can tell gr.co_occurrence uses a brute-force appraoch to find pairs of cells within a certain distance.

Couldn't that be implemented much more efficiently when relying on a pre-computed neighborhood graph? Of course, co-occurence would be limited to whatever is the max radius that was set when calculating the graph.

That way, multiple samples could also easily be respected as library_key is already taken into account by gr.spatial_neighbors (see also https://github.com/scverse/squidpy/issues/917).

Am I missing something?

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

Start by reading the gr.co_occurrence and gr.spatial_neighbors entry points mentioned in the issue, then trace how distance-based cell pairs and library_key are handled. Compare the current brute-force behavior with the pre-computed neighborhood graph approach. Done should include graph-based co-occurrence with the documented maximum-radius limitation and correct handling of multiple samples.

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
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.