Why does co_occurence not use a pre-calculated spatial graph
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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