VIEW THIS AS

Auto mode follows the Route Engine until you choose a viewpoint.

YOU ARE HERE

ROUTE CHECK

CONNECTED TO

WHAT NEXT

Use the canonical route for this room, or HELP if you are unsure.

Why Science? | Squidpy, Spatial Neighbourhoods and Omics–Image Analysis Evidence

Three students sit around open books and worksheets at a classroom table, reading, writing and discussing the work together.

eduKateSG · Why Science?

Analyse spatial molecular data and tissue images in one scalable Python framework, while treating every graph, neighbourhood score and image feature as an auditable choice rather than an automatic biological fact

Full section index · Science Learning Hub

Science learning becomes useful when a familiar object or observation is turned into a system of quantities, mechanisms and claim limits. This guide owns one applied evidence-reading job inside eduKateSG’s wider Science estate. It connects naturally to Why Science Spatial Transcriptomics Tissue Coordinates Gene Expression Evidence; Why Science Single Cell Rna Sequencing Barcodes Transcriptome Heterogeneity Evidence; Why Science Merfish Error Robust Barcodes Spatial Rna Evidence; Why Science Open St Repurposed Flow Cells 3D Spatial Transcriptome Evidence; Education Hub; Singapore Secondary School Directory; Career Adulthood Hub. It also keeps current school and public claims traceable to visible primary sources: Squidpy primary study; Squidpy PubMed record; Squidpy full text; Official scverse Squidpy repository; Squidpy documentation; Current scverse package catalogue; 2026 G2 Computing syllabus. The sources describe the scientific scope; this article translates that scope into a calm route for Primary Science, PSLE Science, Secondary Science, O-Level Science, STEM exploration, school choices and career pathways without inventing admission or employment outcomes.

Squidpy is an open-source Python framework for scalable analysis of spatial molecular data and images. Its 2022 Nature Methods paper described tools for spatial graphs, neighbourhood enrichment, co-occurrence, spatial statistics, image features and interactive visualisation, integrated with the Scanpy and AnnData ecosystem. Squidpy can make complex spatial analyses reproducible and inspectable, but it does not validate biological conclusions automatically. Graph definitions, annotations, null models, image segmentation, software versions and biological replication still decide what a reported neighbourhood or pattern means.

Section 1 of 36

1. Know what a framework does

Squidpy organises and analyses spatial molecular data and tissue images in Python. It provides interoperable tools rather than one biological model. That flexibility helps researchers compose transparent workflows, but it also means every graph, statistic and feature must be chosen and justified for the study question.

Contents · Next section

Section 2 of 36

2. Use annotated data containers

Squidpy builds on AnnData and the Scanpy ecosystem, keeping molecular matrices, observations, features, coordinates and results together. A structured container supports provenance only when fields are labelled, raw data are preserved and transformations are recorded. A tidy object can still contain a poorly designed experiment.

Contents · Previous section · Next section

Section 3 of 36

3. Connect molecules, coordinates and images

A spatial dataset may include gene or protein measurements, spot or cell coordinates, segmentation and high-resolution images. Squidpy links these layers for analysis. Registration and scale factors must be checked because a correct-looking overlay can be shifted enough to change neighbourhoods.

Contents · Previous section · Next section

Section 4 of 36

4. Construct a spatial graph

Nodes represent spots or cells, while edges represent a chosen notion of neighbourhood such as grid adjacency, radius or nearest neighbours. The graph makes spatial statistics possible. It is a model of proximity, not proof that connected cells touch or communicate.

Contents · Previous section · Next section

Section 5 of 36

5. Separate adjacency from interaction

Two cell types can be adjacent because tissue architecture places them there. Neighbour enrichment detects arrangement relative to a null model; it does not show ligand binding, signal direction or causal effect. Mechanistic language needs molecular and experimental evidence beyond graph proximity.

Contents · Previous section · Next section

Section 6 of 36

6. Scale analysis without losing design

The primary paper emphasised scalable workflows across spatial technologies and images. Efficient computation enables large datasets, yet millions of cells or pixels do not create independent biological replicates. The specimen remains the unit for generalisation.

Contents · Previous section · Next section

Section 7 of 36

7. Keep the paper’s scope specific

The 2022 Nature Methods article introduced Squidpy tools for spatial graphs, neighbourhood analysis, co-occurrence, spatial statistics, image features and visualisation. The framework supports transcriptome and other multivariate measurements. It does not endorse every downstream parameter combination.

Contents · Previous section · Next section

Section 8 of 36

8. Import data with provenance

Record platform, tissue, coordinate system, image pyramid, scale units, matrix layer and annotation source. Validate dimensions and identifiers before analysis. Silent coordinate swaps or mismatched cell IDs can produce plausible but meaningless maps.

Contents · Previous section · Next section

Section 9 of 36

9. Quality-control before graph building

Inspect counts, detected features, background, segmentation size, tissue coverage and batch. Remove obvious failures with predeclared rules and map exclusions. Graph algorithms can spread technical artefacts across neighbours, so quality control should precede spatial smoothing or enrichment.

Contents · Previous section · Next section

Section 10 of 36

10. Choose graph geometry

A Visium-like grid, irregular cell coordinates and three-dimensional point cloud require different neighbourhood rules. State radius or neighbour number in physical units where possible. Compare plausible graphs and show whether conclusions depend on one arbitrary distance.

Contents · Previous section · Next section

Section 11 of 36

11. Test neighbourhood enrichment

Squidpy can compare observed cell-type connections with a permutation-based null distribution. The result depends on labels, graph and how permutations preserve or destroy tissue structure. Report null construction, permutations, effect size and specimen-level consistency rather than only a z-score.

Contents · Previous section · Next section

Section 12 of 36

12. Measure co-occurrence across distance

Co-occurrence analysis asks how cell types share space over distance scales. Peaks can suggest tissue niches or exclusion zones. Edge effects, uneven density and segmentation error can shift curves, so compare independent specimens and appropriate nulls.

Contents · Previous section · Next section

Section 13 of 36

13. Use spatial autocorrelation

Statistics such as Moran’s I can identify features whose values are spatially patterned. A high score indicates structure, not its biological cause. Library-size gradients, staining variation or batch can also be spatially autocorrelated and need control.

Contents · Previous section · Next section

Section 14 of 36

14. Handle ligand–receptor results carefully

Expression-based ligand–receptor tools can prioritise candidate communication between nearby populations. They usually do not observe protein secretion, receptor activation or direction. Name the database and thresholds, then treat leading pairs as hypotheses for orthogonal or perturbation tests.

Contents · Previous section · Next section

Section 15 of 36

15. Practise with an invented neighbour table

This fictional table shows why effect and replication both matter.

Cell-type pairEnrichment scoreSpecimens agreeingEdge sensitivityFirst reading
A–B3.85/5lowstrong pattern
A–C4.22/5highunstable
B–D-2.75/5lowreproducible avoidance
C–D0.35/5lowlittle evidence
Invented classroom data for comparison practice; not an operational, product-certification or safety dataset.

Values are invented, not software benchmarks.

Contents · Previous section · Next section

Section 16 of 36

16. Extract image features

Squidpy can calculate texture, intensity and other features from image crops around spots or cells. These quantify appearance but remain sensitive to staining, illumination, magnification and crop size. Standardise acquisition and validate features against pathology or controlled objects.

Contents · Previous section · Next section

Section 17 of 36

17. Segment before aggregating with care

Cell segmentation converts images into masks that can receive molecular or image features. Split and merged cells alter neighbourhood counts and cell-type composition. Benchmark masks by tissue class and retain uncertainty rather than assuming every polygon is one complete cell.

Contents · Previous section · Next section

Section 18 of 36

18. Cluster and annotate transparently

Molecular and image features may support clustering or classification. Report feature selection, model, reference and marker evidence. A cluster label should remain separate from its spatial enrichment, preventing circular claims that a region is special because it was defined from that region.

Contents · Previous section · Next section

Section 19 of 36

19. Use imaging-based spatial data

The paper illustrated analysis across imaging-based assays where individual molecules or cells can be represented at fine coordinates. Dense data magnify segmentation and memory challenges. Resolution should be reported as effective measurement and mask accuracy, not simply camera pixel size.

Contents · Previous section · Next section

Section 20 of 36

20. Use sequencing-based spatial data

Capture-spot assays provide broad molecular profiles at coarser locations. Squidpy can analyse their graphs and linked histology, but spot adjacency is not cell adjacency. Interpret neighbourhoods at the platform’s spatial scale and state mixture limitations.

Contents · Previous section · Next section

Section 21 of 36

21. Visualise without hiding missingness

Interactive maps are useful for exploring large data, yet colour scales, smoothing and down-sampling can change perception. Show missing regions, raw values and specimen identifiers. Save the code and settings that produced publication figures.

Contents · Previous section · Next section

Section 22 of 36

22. Challenge graph choices

Repeat key analyses with plausible radii, nearest-neighbour counts and edge rules. Record which relationships persist. A result that reverses when one neighbour is added is informative but not ready for a strong biological conclusion.

Contents · Previous section · Next section

Section 23 of 36

23. Challenge permutation nulls

Randomly shuffling labels across an entire tissue may ignore layers or regions that constrain cell placement. Compare nulls that preserve relevant structure and avoid conditioning away the question. Explain what each null represents biologically.

Contents · Previous section · Next section

Section 24 of 36

24. Challenge tissue edges

Cells near a boundary have fewer observable neighbours, and cropped images omit outside tissue. Quantify edge exposure, exclude or adjust where appropriate and rerun results. Apparent cell-type avoidance can arise from geometry alone.

Contents · Previous section · Next section

Section 25 of 36

25. Challenge segmentation error

Perturb boundaries, merge or split a realistic fraction of masks and examine neighbourhood stability. Review dense and unusual regions manually. If a headline association disappears under modest segmentation uncertainty, report that dependence.

Contents · Previous section · Next section

Section 26 of 36

26. Version software and environments

Record Squidpy, Scanpy, AnnData and dependency versions, plus code commit, seeds and hardware where relevant. Package APIs and defaults evolve. Current scverse listings can identify releases, but the study must archive the exact environment used.

Contents · Previous section · Next section

Section 27 of 36

27. Compare Squidpy with SpaGCN

Squidpy supplies a broad toolkit for graph, image and spatial statistics; SpaGCN defines a graph-convolutional approach for spatial domains and genes. Squidpy can support exploration and validation around specialised models, but using both does not make assumptions disappear.

Contents · Previous section · Next section

Section 28 of 36

28. Treat negative results as bounded

No enrichment may mean genuine random mixing, inadequate labels, wrong distance, low power or segmentation noise. Simulate effects on the observed graph to estimate detectable strength. State the spatial scale and effect size ruled out.

Contents · Previous section · Next section

Section 29 of 36

29. Build a classroom neighbourhood graph

Students place labelled counters on a grid, draw edges under two distance rules and calculate which pairs occur more often than shuffled layouts. Changing the boundary or one mislabelled counter shows how graph and annotation choices affect conclusions.

Contents · Previous section · Next section

Section 30 of 36

30. Connect to Primary Science observation

Young learners can count neighbours, compare arrangements and distinguish ‘next to’ from ‘caused by’. They can repeat a shuffled layout and see why one pattern may occur by chance, building cheerful confidence with evidence.

Contents · Previous section · Next section

Section 31 of 36

31. Strengthen PSLE Science process skills

A fictional table supports interpreting positive, negative and near-zero patterns. Pupils can compare replication, spot the edge-sensitive result and propose a fair test. The lesson is careful reasoning, not advanced coding.

Contents · Previous section · Next section

Section 32 of 36

32. Extend into Secondary and O-Level Science

Biology contributes tissue organisation; Mathematics contributes graphs and probability; Computing contributes data structures, algorithms and reproducibility; Chemistry contributes staining and molecular assays. Current official syllabuses remain the authority for assessed content.

Contents · Previous section · Next section

Section 33 of 36

33. Use the topic for school choices

Students interested in life science, computing or data analysis can verify current subject and programme information on official school pages. Ask whether projects teach data provenance and evaluation. This article makes no unverified school or admissions claim.

Contents · Previous section · Next section

Section 34 of 36

34. See the career pathways

Spatial analysis involves computational biologists, imaging scientists, software maintainers, statisticians, pathologists and data engineers. Open-source contributions can demonstrate skill, but jobs and courses require current criteria, training and teamwork. No outcome is guaranteed.

Contents · Previous section · Next section

Section 35 of 36

35. Did You Know? A null model is a scientific story

A permutation is not just a software button. It describes what arrangement would count as chance while other features stay fixed. Different null stories can answer different questions and produce different enrichment scores.

Contents · Previous section · Next section

Section 36 of 36

36. Keep the final claim bounded

A defensible Squidpy conclusion names data provenance, graph, annotations, null model, image and segmentation quality, software environment, parameter sensitivity and biological replication. It may report a reproducible neighbourhood pattern. It should not turn adjacency into signalling, a z-score into causation or scalable computation into independent evidence.

A reproducible Squidpy project begins with a data manifest. Record specimen hierarchy, assay, coordinate units, image files and pyramids, transformations, molecular layers, annotation sources and identifiers. Validate that coordinates overlay the correct image before any graph is built. A one-axis swap can generate plausible statistics from completely wrong neighbourhoods.

Pre-register the primary graph, spatial scale, cell labels, image features, neighbourhood statistic, null model, permutation count, multiple-testing plan and specimen-level comparison. Exploratory dashboards can remain open-ended, but a headline association should be rerun on untouched specimens with the analysis locked.

Publish a funnel from raw observations to quality-controlled cells or spots, valid coordinates, graph nodes, image-linked observations and final tests. Map exclusions and segmentation failures. Report how many nodes are isolated and how many lie near edges. A result based mainly on the best-segmented centre of tissue may not represent the whole specimen.

Graph construction should be justified in physical and biological terms. A nearest-neighbour graph equalises degree but can connect across large gaps; a radius graph preserves distance but creates variable degree. Compare both where reasonable and visualise edges. For three-dimensional data, check anisotropic section spacing rather than treating all axes equally.

Null models are scientific assumptions. Whole-tissue label shuffling asks whether arrangement differs from unrestricted randomness; region-stratified shuffling asks whether there is additional structure within known compartments. Neither is universally correct. State which biology is held fixed, report effect sizes beside z-scores and test alternative nulls when conclusions depend on the choice.

Segmentation uncertainty should propagate into neighbourhood analysis. Benchmark masks against nuclei or expert review, then jitter centroids, split and merge a plausible fraction of cells and recompute key results. Dense immune or tumour regions may fail differently from sparse tissue. Report which relationships survive those perturbations.

Image-feature pipelines need acquisition controls. Archive stain, scanner, magnification, colour processing, crop size and feature definitions. Use stable reference slides or colour standards when comparing batches. Validate computational features against independent pathology or controlled patterns; a texture score is a measurement, not a diagnosis.

Spatial autocorrelation and multiple testing require care. Many genes can appear patterned because of library-size or tissue-quality gradients. Include relevant covariates, use appropriate correction and report effect size and spatial scale. Confirm selected features in independent specimens rather than treating every significant statistic as a discovery.

Neighbour and co-occurrence results should be summarised per specimen before cohort inference. Cells are nested and spatially correlated. Display every biological replicate and use hierarchical or specimen-level statistics. Millions of cells increase map precision inside a specimen but do not manufacture a representative cohort.

Ligand–receptor analyses require a separate evidence ladder. Record database version, expression threshold, cell labels, distance rule and null model. Confirm leading pairs with protein localisation, receptor activation or perturbation when making mechanistic claims. Proximity plus compatible transcripts supports a candidate interaction, not observed signalling.

Figures should show tissue images, segmentation, quality maps, graph edges, raw counts, enrichment effects, null distributions, edge sensitivity and replicate-level results. Avoid presenting only a composite heatmap. Readers should be able to trace one headline pair from raw neighbouring cells through the statistic and across specimens.

Reproducibility materials include AnnData objects or documented exports, images, transformations, graph matrices, feature tables, labels, code, notebooks, package lockfile, container, seeds, results and checksums. Cite exact Squidpy, Scanpy and dependency versions. Archive a rendered report so later package changes do not alter the historical record.

Negative findings should be calibrated on the observed graph. Simulate enrichment or exclusion of varying strength and spatial extent while preserving density and region structure. Report the smallest reproducible effect the study could detect. ‘No evidence at this radius and power’ is more accurate than claiming random organisation at every scale.

Software maintenance is part of scientific quality. Test workflows when dependencies change, pin environments, review deprecation warnings and keep small benchmark datasets. A current package catalogue can indicate supported releases, but long-term reproducibility depends on archiving the exact executable environment used for the paper.

Cross-platform comparisons should begin with a matched spatial question. Preselect cell types, distances and tissue compartments, then compare Squidpy outputs with direct imaging or another analysis route on the same or adjacent section. Agreement on a broad neighbourhood does not validate every edge, while disagreement can reveal scale, annotation or segmentation limits worth investigating.

Review computational choices with both domain experts and independent analysts. A pathologist may spot an impossible tissue edge, while a statistician may spot an unsuitable null model. Record disagreements and resolutions. Collaborative review is especially valuable when a result is visually striking but sensitive to annotations or graph construction.

A careful final sentence might say: ‘Using a versioned Squidpy workflow, prespecified spatial graphs and null models identified neighbourhood patterns that were stable to graph, edge and segmentation checks and reproduced across independent specimens.’ It should not convert adjacency into causal signalling, image texture into pathology or computational scale into biological replication.

Contents · Previous section · Continue to the Science Learning Hub