domains / families / science / spatial-neighbors
Build the spatial neighbor graph that every downstream spatial statistic (Moran's I, neighborhood enrichment, co-occurrence, spatial domains) inherits, using Squidpy. Use when choosing the graph type (kNN vs Delaunay vs fixed-radius vs Visium hex grid) and understanding why it silently changes every downstream result; handling variable cell density (kNN fixes neighbor COUNT, fixed-radius fixes physical DISTANCE -- each distorts the other); getting coordinate units right (pixels vs microns; Visium array coords are not distance); pruning Delaunay long edges across tissue gaps; running the graph sensitivity analysis almost nobody runs; and knowing when planar section neighbors misrepresent a 3D tissue.
The two skills cover the same task but with different levels of depth and focus. The first copy (OpenClaw) is a practical, code-heavy recipe book that provides specific Python snippets for building various graph types, accessing data, and visualizing results. The second copy (GPTomics) is a conceptual guide that emphasizes the statistical implications of graph choice, the 'modifiable areal unit problem,' and decision-making criteria (e.g., when to use grid vs. generic, density biases). The first copy lacks the critical reasoning about why graph choice affects downstream statistics, while the second copy lacks the specific implementation details for visualization, specific spot querying, and combining spatial/expression graphs found in the first. Combining them provides both the 'how' and the 'why'.