Skip to content

FlexScience

Spatial perturbation transcriptomics aims to measure how a genetically edited cell affects surrounding tissue.

Core trick

Counts independent perturbation sources rather than source-recipient pairs, then recomputes uncertainty with wild-cluster bootstrap and source-label permutation.

Tags

Description

Spatial perturbation transcriptomics aims to measure how a genetically edited cell affects surrounding tissue. I investigated whether these effects form a point-spread-function-like spatial response, bringing a mathematical idea from electrical engineering into an unfamiliar biomedical field. Using a public mouse-brain Spatial Perturb-seq dataset containing 229,775 cells, I found a consequential replication problem. Treating 24,453–31,189 source-recipient pairs as independent produced 16 of 20 nominal program-level hits. Keeping the biological comparisons and point estimates fixed, but computing uncertainty at the 78 or 101 independent perturbation and control sources, increased standard errors by a median of 5.5× and eliminated every hit: 0/20. Wild-cluster bootstrap, source-label permutation, equal-source weighting, non-overlap analysis, alternative adjustments, and leave-one-mouse-out checks agreed. Two Lrrk2 contrasts remain power-limited, method-dependent leads rather than findings. I packaged the central check as a reusable command-line audit that produces naive, source-aware, wild-bootstrap, and equal-source results from a source-recipient table. This matters because neighbour-level pseudoreplication can create false confidence across spatial screens. The resulting design guidance is concrete: count independent sources, balance them across animals, and power experiments at the source level. The broader demonstration is that Claude can help an outsider enter a new research field and contribute rigorously without lowering the standard of evidence.
txdai/Perturbation-PSF★ 00 forksPythonMITCreated Jul 12, 2026 · last push Jul 12, 2026

README excerpt

# Perturbation PSF

**A source-aware calibration audit for sparse spatial perturbation screens.**

Spatial Perturb-seq measures many recipient cells around a smaller number of genetically perturbed sources. This repository tests a critical inference failure mode: the same 20 biological contrasts produce 16 nominal hits when 24,453-31,189 source-recipient pairs are treated as independent, but 0/20 when uncertainty is computed at the 78 or 101 perturbation and control sources.

The project was built with Claude Science by an electrical-engineering researcher entering an unfamiliar biomedical field. Human-directed statistical review repeatedly changed the analysis; Claude maintained the executable research state, implemented the reruns, and helped turn the final calibration result into reusable software.

## Read the paper

The compiled article is [`here`](PerturbationPSF_Writeup.pdf). LaTeX source is intentionally excluded from this submission repository.

## Repository contents

- `src/perturbation_psf/` - reusable source-aware inference library.
- `scripts/run_audit.py` - command-line audit for long-form source-recipient tables.
- `scripts/make_synthetic_data.py` - deterministic smoke-test dataset generator.
- `scripts/00_download_data.sh` - download instructions for the public GEO data.
- `tests/` - unit tests for the central inference code.
- `notebooks/` - analysis notebook.
- `analysis/` - archived full Claude Science analysis pipeline.
- `data/results/` - review-validate

Team