Wednesday, July 1, 2026

I Gave Claude Science One Prompt. It Ran a Full Spatial Analysis.

By Lociven · SpatiaBio · July 2, 2026

I gave Claude Science AI Workbench — Anthropic's new scientific analysis platform — a single prompt and a dataset. Thirty minutes later, it handed me five publication-quality figures, a fully executable Jupyter notebook, and a reproducibility report.


What is Claude Science AI Workbench?

Released in June 2026, Claude Science is Anthropic's platform for running agentic scientific analysis inside a sandboxed Linux environment. You describe what you want in plain language. The agent installs packages, writes code, executes it, fixes errors, and returns figures and notebooks — all without you touching a terminal.

For spatial transcriptomics researchers, the pitch is simple: skip the environment setup, skip the debugging, get directly to the biology.

The prompt I used

Analyze the Squidpy IMC breast cancer dataset (sq.datasets.imc()):
1. Spatial neighbors graph — Delaunay triangulation
2. Neighborhood enrichment (sq.gr.nhood_enrichment, n_perms=1000)
3. Co-occurrence as a function of distance
4. Interaction matrix and centrality scores
5. Ripley's L for clustering vs. randomness

Use publication-grade conventions. Return a Jupyter notebook with all outputs embedded.

That's it. No code. No conda commands. The agent created a spatial conda environment (squidpy 1.8.2, scanpy 1.11.5), downloaded the Jackson et al. breast cancer IMC dataset (4,668 cells × 34 protein markers, 11 cell types), ran the full pipeline, and produced the figures below.


Figure 1 — Cell types in situ

The IMC dataset captures 11 cell types across a breast cancer tissue section. Apoptotic tumor cells (cyan) dominate numerically and are distributed throughout the tissue.

Breast cancer IMC cell types in situ

Generated with Claude Science AI Workbench (Anthropic, 2026) · squidpy 1.8.2 · Jackson et al., Nature 578, 2020

Figure 2 — Neighborhood enrichment: which cell types co-locate?

The permutation-based z-scores reveal the tissue's immune architecture at a glance. Three patterns stand out:

Immune clustering (z = +29 to +36): T cells, macrophages, and stromal cells form a tightly co-located immune compartment — the canonical TIL niche.
Tumor-immune avoidance (z = −21 to −28): Apoptotic tumor cells strongly avoid macrophages. Immune exclusion at the single-cell spatial level.
Tumor self-clustering (z = +33 to +48): Each tumor subtype clusters with itself, consistent with clonal expansion in distinct spatial niches.
Neighborhood enrichment heatmap

Generated with Claude Science AI Workbench (Anthropic, 2026) · squidpy 1.8.2 · Jackson et al., Nature 578, 2020

Interpretation note: A z-score above +10 is conventionally significant with n_perms=1000. Values of +29 to +48 indicate extremely non-random co-localization.

Figure 3 — Co-occurrence: the spatial scale of immune clustering

Co-occurrence shows at what distance cell types interact. The steep decay curves confirm that immune clustering is a contact-range phenomenon — not a tissue-wide gradient. Macrophages are enriched 7× near other macrophages at minimal distance, then fall sharply.

Co-occurrence distance curves

Generated with Claude Science AI Workbench (Anthropic, 2026) · squidpy 1.8.2 · Jackson et al., Nature 578, 2020

Figure 4 — Graph centrality: who connects the tissue?

Apoptotic tumor cells have degree centrality 0.83 and closeness centrality 0.84 — nearly 5× higher than any other cell type. They are physically positioned at the crossroads of the tissue, spatially interleaved with every other population.

Graph centrality scores

Generated with Claude Science AI Workbench (Anthropic, 2026) · squidpy 1.8.2 · Jackson et al., Nature 578, 2020

Figure 5 — Ripley's L: clustering vs. complete spatial randomness

Apoptotic tumor cells spike massively above the 95% CSR envelope across all distances — extreme, scale-independent clustering. Combined with the centrality result: self-clustering + network centrality is characteristic of a dominant tumor clone that has physically reorganized the tissue architecture.

Ripley's L clustering analysis

Generated with Claude Science AI Workbench (Anthropic, 2026) · squidpy 1.8.2 · Jackson et al., Nature 578, 2020


What Claude Science actually did (under the hood)

The agent's execution log was visible in real time. It:

1. Created a conda environment from scratch (squidpy==1.8.2, scanpy==1.11.5)
2. Downloaded and validated the IMC dataset (4,668 cells × 34 markers)
3. Ran all five Squidpy analyses with appropriate parameters
4. Noticed its own figure title was inaccurate and self-corrected it before saving
5. Authored a 23-cell reproducible notebook with embedded outputs
6. Bundled the dataset, requirements.txt, and README automatically

The self-correction on the Ripley's L title is worth noting. It cross-checked the figure against the data and caught a misleading generalization. That's not what most analysis scripts do.


Bonus: the same pipeline on Visium data

The IMC analysis above uses point-cloud coordinates. I reran the same prompt on a 10x Genomics Visium section (grid-based spots, 55 µm resolution). The agent automatically switched to coord_type="grid" and n_neighs=6 for the hexagonal lattice without being instructed to — it inferred this from the data format.

Figure 6 — Visium: spatial clusters

On the Visium hexagonal grid, cluster boundaries directly reflect anatomical structure. The sharper compartmentalization here vs. the IMC data is expected: Visium spots are physically constrained to a grid, so spatial patterns emerge more cleanly at tissue scale.

Visium spatial clusters

Generated with Claude Science AI Workbench (Anthropic, 2026) · squidpy 1.8.2 · 10x Genomics Visium

Figure 7 — Visium: gene expression overlay

Gene expression mapped onto spatial coordinates reveals domain-specific marker gradients. Unlike IMC (protein-level), Visium captures transcriptomic heterogeneity at spot resolution. Claude Science generated both the continuous expression overlay and the categorical cluster map in a single run.

Visium gene expression overlay

Generated with Claude Science AI Workbench (Anthropic, 2026) · squidpy 1.8.2 · 10x Genomics Visium

Figure 8 — Visium: neighborhood enrichment

The neighborhood enrichment heatmap on Visium shows a clean tissue-layer organization: adjacent anatomical compartments co-enrich (positive z-scores), distant layers avoid each other (negative z-scores). You can trace these directly back to the cluster map in Figure 6.

Visium neighborhood enrichment

Generated with Claude Science AI Workbench (Anthropic, 2026) · squidpy 1.8.2 · 10x Genomics Visium

The full Visium pipeline — grid graph parameters, spatial autocorrelation, and multi-sample batch correction — is in Pack 1 notebooks 03, 06, and 06b.

Honest assessment: is it useful?

✓ Works well for

• Standard Squidpy pipelines
• Exploratory analysis on new datasets
• Generating a reproducible baseline notebook
• Researchers new to spatial omics
• Rapid figure drafts for lab meetings

✗ Limitations

• Requires manual approval for each tool call
• Can't customize beyond what you describe
• No Visium HD / large dataset chunking
• Figure aesthetics are functional, not polished
• Session restarts lose progress

Bottom line: For getting from raw data to interpretable spatial figures in one session without writing code, it genuinely works. For publication-level customization, you still need to go hands-on. Pack 1 covers exactly that layer.


SpatiaBio Pack 1

Squidpy Foundations — 16 Notebooks ($19)

Everything Claude Science did above — plus memory optimization for Visium HD, batch correction across samples, ligand-receptor analysis, and Nature-style publication figure templates.

Get it for $19 →

Sister blog

The biology behind the cells you're mapping

NeoantigenLab covers neoantigen biology, HLA typing, pVACseq, and cancer immunotherapy — the immunology context for what spatial analysis reveals.

Visit NeoantigenLab →

No comments:

Post a Comment

I Gave Claude Science One Prompt. It Ran a Full Spatial Analysis.

By Lociven · SpatiaBio · July 2, 2026 I gave Claude Science AI Workbench — Anthropic's new scientific analysis platform — a single...