sciagent-skill-creator
Scaffold a new SciAgent-Skills entry. Picks pipeline/toolkit/database/guide template, creates skills/{category}/{name}/SKILL.md…
Spatial transcriptomics cell type annotation for single-cell-resolution platforms (Xenium, MERFISH, CosMx, SeqFISH): CELLxGENE reference download, Harmony label transfer, per-cluster marker evidence naming lineages then subtypes, spatial niches. Visium/Slide-seq spots: GPU ->
$ npx -y skills add jaechang-hits/SciAgent-Skills --skill spatial-transcriptomics-cell-type-annotation --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/spatial-transcriptomics-cell-type-annotationContext preview
The summary Claude sees to decide when to auto-load this skill.
Spatial transcriptomics cell type annotation for single-cell-resolution platforms (Xenium, MERFISH, CosMx, SeqFISH): CELLxGENE reference download, Harmony label transfer, per-cluster marker evidence naming lineages then subtypes, spatial niches. Visium/Slide-seq spots: GPU ->
name: "spatial-transcriptomics-cell-type-annotation" description: "Spatial transcriptomics cell type annotation for single-cell-resolution platforms (Xenium, MERFISH, CosMx, SeqFISH): CELLxGENE reference download, Harmony label transfer, per-cluster marker evidence naming lineages then subtypes, spatial niches. Visium/Slide-seq spots: GPU -> spatial-transcriptomics-deconvolution-cell2location; CPU -> spatial-mapping-tangram (cell types: per-spot proportions); no reference -> spatial-domain-detection (regions: domains from markers). Beyond labels (microenvironment, arrangement, spatial patterns): read spatial-transcriptomics-analysis-squidpy before asking the user." license: "CC-BY-4.0"
Annotates cells and tissue niches in imaging-based spatial data, where each observation is one segmented cell. A tissue- and state-matched scRNA-seq reference is pulled from CELLxGENE, its labels are transferred with Harmony, and each cluster is then named from a table that puts its markers next to the transferred labels. Output: an AnnData with per-cell labels, confidence and niches, plus the evidence table behind every name.
Check the platform before anything else:
| Signal | Single-cell resolution -> this skill | Spot-based -> `spatial-transcriptomics-deconvolution-cell2location` | |---|---|---| | Genes | ~100-5,000 targeted panel | ~18,000-33,000 (whole transcriptome) | | Files | `cell_feature_matrix.h5`, `cells.csv(.gz)`, `experiment.xenium` | `filtered_feature_bc_matrix.h5`, `spatial/tissue_positions*.csv` | | Platforms | Xenium, MERFISH, CosMx, SeqFISH | Visium, Visium HD bins, Slide-seq, ST |
A spot mixes several cells; naming each spot with one label is wrong, so a Visium request to "annotate cell types" goes to deconvolution.
# Install only what `import` reports missing. pixi add --pypi harmonypy cellxgene-census # scanpy, scikit-learn are usually present pixi add --pypi squidpy # Step 7 (niches) only
decisions:
- id: D1
param: STATE
kind: required
source: user
ask: "Which tissue, and in what state (healthy, or which tumour or disease)?"
default: null
- id: D2
param: referenceSource
kind: required
source: user
ask: "Do you have a matched scRNA/snRNA-seq reference (h5ad with raw counts and a cell type column), or should I search public data (CELLxGENE) for one?"
default: null
- id: D3
param: annotationRoute
kind: required
source: user
ask: "Transfer labels from a reference (recommended, slow; CellTypist only if installing the transfer tools fails), run CellTypist (fast, not recommended: less accurate on this panel), or name clusters from markers only?"
default: null
- id: D4
param: MIN_COUNTS
kind: optional
source: user
ask: "Keep cells with at least how many transcripts?"
default: "10"Ask D1-D3 together, and give each D3 option its cost:
Tangram or scANVI, installed at run time. Fetching a public reference is not guaranteed: install, query and download take minutes or longer, and the dataset can be missing from Census or exhaust memory (Step 4). Transfer is also long: on ~154k cells, UMAP took ~45 s and Leiden ~2 min before Harmony and training even start. Install the transfer tools first, even though CellTypist is pre-installed. Only if that install or import fails, stop, tell the user the error, then fall back to CellTypist with the caveat below and say so in the result.
trained on whole-transcriptome scRNA-seq, so on a targeted panel only the overlapping genes are used and labels are less accurate. State this whenever its labels are reported, and check them with markers (Step 6).
When the user asks whether anything else must be uploaded, answer from D2: the Xenium output is enough to start, and a matched reference of their own is the fastest and most reliable route. Never describe the reference fetch or the transfer as immediate or guaranteed.
import pandas as pd
import scanpy as sc
XENIUM_DIR = "path/to/xenium_outs" # folder with cell_feature_matrix.h5 + cells.csv.gz
adata = sc.read_10x_h5(f"{XENIUM_DIR}/cell_feature_matrix.h5", gex_only=False)
# Control probes/codewords are not genes; keep Gene Expression only.
adata = adata[:, adata.var["feature_types"] == "Gene Expression"].copy()
cells = pd.read_csv(f"{XENIUM_DIR}/cells.csv.gz", index_col="cell_id")
adata.obs = adata.obs.join(cells, how="left")
adata.obsm["spatial"] = adata.obs[["x_centroid", "y_centroid"]].to_numpy() # microns
print(adata)
print(f"panel: {adata.n_vars} genes; median transcripts/cell: {adata.obs['total_counts'].median():.0f}")
``Turn your AI coding agent into a life sciences expert — 199 bioinformatics skills for Claude Code covering RNA-seq, single-cell analysis, genomics, proteomics, drug discovery, and more. Boosted BixBench from 65% to 92%. Open source.
Scaffold a new SciAgent-Skills entry. Picks pipeline/toolkit/database/guide template, creates skills/{category}/{name}/SKILL.md…
Bayesian modeling with PyMC 5: priors, likelihood, NUTS/ADVI sampling, diagnostics (R-hat, ESS), LOO/WAIC comparison, prediction.…
Time-to-event modeling with scikit-survival: Cox PH (elastic net), Random Survival Forests, Boosting, SVMs for censored data.…
Guided statistical analysis: test choice, assumption checks, effect sizes, power, APA reporting. Pick tests, verify assumptions,…
Python statistical modeling: regression (OLS, WLS, GLM), discrete (Logit, Poisson, NegBin), time series (ARIMA, SARIMAX, VAR),…
DL cell/nucleus segmentation for fluorescence and brightfield microscopy. Pre-trained models (cyto3, nuclei, tissuenet) and a…