bulkrna-batch-correcti…
Load when correcting batch effects in bulk expression using R sva ComBat or the legacy Python parametric approximation. Skip…
Load when aligning multiple spatial slices into a common coordinate frame with PASTE or STalign. Skip single-slice data; for expression-space batch correction use spatial-integrate.
$ npx -y skills add tiangzlab/omicsclaw --skill spatial-register --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/spatial-registerContext preview
The summary Claude sees to decide when to auto-load this skill.
Load when aligning multiple spatial slices into a common coordinate frame with PASTE or STalign. Skip single-slice data; for expression-space batch correction use spatial-integrate.
name: spatial-register description: Load when aligning multiple spatial slices into a common coordinate frame with PASTE or STalign. Skip single-slice data; for expression-space batch correction use spatial-integrate. trigger: spatial registration, slice alignment, PASTE, STalign tags: - spatial - registration - alignment
from skills._sdk.notebook import load_skill, read_input, write_output
library = load_skill("spatial-register")
adata = library.register(read_input("data/slices.h5ad"), slice_key="slice")
write_output(adata, "intermediate/registered.h5ad")Align slice coordinates while preserving the original spatial coordinates. PASTE uses expression and spatial distances; STalign supports two slices. For expression-space correction use spatial-integrate instead.
Input: AnnData with expression, spatial coordinates and a slice-label column. The default reference is the first sorted label, not the largest slice. Functions return the same AnnData, shift tables and figures without writing files.
CLI writes `processed.h5ad`, `report.md`, `result.json`, registration tables and the before/after gallery. See [references/output_contract.md](references/output_contract.md) for the complete file inventory. Registered coordinates are `obsm["spatial_aligned"]`; `spatial` and `X_spatial`, if present, remain unchanged.
python skills/spatial/spatial-register/spatial_register.py --input slices.h5ad --output results/registration --slice-key slice --method paste python skills/spatial/spatial-register/spatial_register.py --demo --output /tmp/spatial_register
`examples/example_step.py` aligns unequal-size simulated slices through the step runner. [references/parameters.md](references/parameters.md) lists backend flags.
automatically switch from `spatial`.
coupling. The old `_lib/register.py:run_paste` direction was incorrect; unequal slice sizes now work, and solver failures raise instead of reporting success.
not the optimal-transport objective or a calibrated fit statistic.
the line-search call and fail inside PASTE. Use an isolated compatible environment.
It has no exposed seed control here; do not claim deterministic GPU results.
does not report it. Inspect shifts without treating smaller displacement as better alignment.
<!-- api:begin generated from _api.py; regenerate with run.py api <skill dir> --write -->
Add aligned coordinates in place without overwriting the input coordinates.
:param adata: AnnData with expression, spatial coordinates and slice labels. :param method: paste (default) for transport or stalign for two-slice LDDMM. :param slice_key: Observation column; None detects slice, sample, section or batch. :param reference_slice: Target label; None uses the first sorted label. :param parameters: PASTE alpha=0.1, dissimilarity='kl', use_gpu=False; STalign image_size=(400,400), niter=2000, a=500, use_expression=False. PASTE is deterministic on CPU; STalign has no seed control and may vary. :returns: The same AnnData with spatial_aligned and JSON run diagnostics. :raises ValueError: Invalid labels, coordinates, method or method parameters. :raises ImportError: Missing backend; use install_skill_deps for paste-bio/POT or STalign/torch as appropriate. :raises RuntimeError: A slice cannot be aligned; partial success is not returned.
Read the last registration summary.
:param adata: Registered AnnData. :param keep: True retains diagnostics; False removes them for CLI serialization. :returns: Summary with reference, slices and effective parameters, or an empty dict.
Measure Euclidean displacement from original to registered coordinates.
:param adata: AnnData with spatial_aligned and original spatial coordinates. :returns: observation and shift_distance columns, in observation order. :raises KeyError: Aligned coordinates are absent. :raises ValueError: Original coordinates are absent.
Plot original and registered slice coordinates side by side.
:param adata: Registered AnnData. :param slice_key: Slice label column; None detects the column from the data. :returns: A matplotlib Figure; the caller saves and closes it. :raises KeyError: Aligned coordinates or labels are absent.
<!-- api:end -->
`anndata`, `matplotlib`, `numpy`, `pandas`, `paste-bio`, `POT`, `scanpy`, `scikit-learn`, `scipy`, `seaborn`, `STalign`, `torch`
The CLI dependency list covers both methods; install only the chosen backend.
Conversational & memory-enabled AI research partner for multi-omics analysis. CLI + Desktop App (installers in Releases). From biological idea to full research paper.
Load when correcting batch effects in bulk expression using R sva ComBat or the legacy Python parametric approximation. Skip…
Load when discovering bulk gene co-expression modules and hub genes with R WGCNA. Skip direct expression contrasts (use…
Load when comparing gene expression between two conditions in bulk RNA-seq count data. Skip
Load when estimating cell-type proportions in bulk RNA-seq samples from a single-cell or
Load when running pathway / GO term enrichment on a bulk RNA-seq DE result list. Skip when
Load when converting Ensembl, Entrez or symbol IDs in a bulk RNA count matrix using an explicit mapping or a small human demo…