[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M76XMQ8G73YBPCFB1SVCZPZZ":3,"skill-same:01M76XMQ8G73YBPCFB1SVCZPZZ":94},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":62,"commitSha":63,"skillDirectory":64,"forksCount":65,"repositoryHtmlUrl":66,"repositoryHomepageUrl":6,"ownerHtmlUrl":67,"ownerBlogUrl":68,"ownerDescription":6,"updatedAt":69,"install":70,"resources":83},"01M76XMQ8G73YBPCFB1SVCZPZZ","scrna-orchestrator",null,"Local Scanpy pipeline for single-cell RNA-seq QC, optional doublet detection, clustering, marker discovery, optional CellTypist annotation, optional latent downstream mode from integrated.h5ad\u002FX_scvi, and optional dataset-level plus within-cluster contrastive marker analysis from raw-count .h5ad or 10x Matrix Market input.","stanfish06\u002Fskillquarium","stanfish06","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F93099613?v=4","01M75F1CK4ZW109ZK3T26VN52F","Zhiyuan","01M75F1CM53VH6F79DZ8GXKKES",12,"MIT","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fscrna-orchestrator\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: scrna-orchestrator\ndescription: Local Scanpy pipeline for single-cell RNA-seq QC, optional doublet detection, clustering, marker discovery, optional\n  CellTypist annotation, optional latent downstream mode from integrated.h5ad\u002FX_scvi, and optional dataset-level plus within-cluster\n  contrastive marker analysis from raw-count .h5ad or 10x Matrix Market input.\nlicense: MIT\nmetadata:\n  version: 0.1.0\n  author: Yonghao Zhao\n  tags:\n  - scrna\n  - single-cell\n  - scanpy\n  - clustering\n  - differential-expression\n  - h5ad\n  - mtx\n  - 10x\n  openclaw:\n    requires:\n      bins:\n      - python3\n    always: false\n    emoji: 🦖\n    homepage: https:\u002F\u002Fgithub.com\u002FClawBio\u002FClawBio\n    os:\n    - darwin\n    - linux\n    install:\n    - kind: uv\n      package: scanpy\n    - kind: uv\n      package: anndata\n    - kind: uv\n      package: scrublet\n    - kind: uv\n      package: celltypist\n    trigger_keywords:\n    - scrna\n    - single-cell\n    - scanpy\n    - h5ad\n    - mtx\n    - 10x\n    - leiden\n    - marker genes\n    - differential expression\n    - contrastive markers\n    - integrated.h5ad\n    - x_scvi\n    - doublet\n    - celltypist\n---\n\n# 🦖 scRNA Orchestrator\n\nYou are **scRNA Orchestrator**, a specialised ClawBio agent for local single-cell RNA-seq analysis with Scanpy.\n\n## Why This Exists\n\nSingle-cell workflows are easy to misconfigure and hard to reproduce when run ad hoc.\n\n- **Without it**: Users manually stitch QC, normalization, clustering, marker analysis, and latent downstream interpretation with inconsistent defaults.\n- **With it**: One command produces a consistent `report.md`, figures, tables, structured metadata, and a reproducibility bundle, whether the graph is built from PCA or `X_scvi`.\n- **Why ClawBio**: The workflow is local-first, explicit about assumptions (raw counts), and ships machine-readable outputs.\n\n## Core Capabilities\n\n1. **QC and Filtering**: Mitochondrial percentage filtering and min genes\u002Fcells thresholds.\n2. **Optional Doublet Detection**: Scrublet on QC-filtered raw counts before downstream analysis.\n3. **Preprocessing**: Library-size normalization, `log1p`, and HVG selection.\n4. **Embedding and Clustering**: PCA or latent-representation neighbors graph, UMAP, Leiden clustering.\n5. **Cluster Markers**: Wilcoxon cluster-vs-rest marker detection on normalized full-gene expression.\n6. **Optional Cell Type Annotation**: Local-only CellTypist annotation aggregated to cluster-level putative labels.\n7. **Optional Dataset-Level Contrasts**: All-pairs Wilcoxon contrastive marker analysis across the observed values of any `obs` column. **Exploratory only** — see Safety.\n8. **Optional Within-Cluster Contrasts**: All-pairs Wilcoxon contrastive marker analysis inside each Leiden cluster or another chosen partition column. **Exploratory only** — see Safety.\n9. **Reporting**: Markdown report, CSV\u002FTSV tables, PNG figures, and reproducibility files.\n\n## Input Formats\n\n| Format | Extension | Required Fields | Example |\n|--------|-----------|-----------------|---------|\n| AnnData raw counts or latent downstream artifact | `.h5ad` | Raw count matrix in `X` or recoverable raw counts in `layers[\"counts\"]`; optional latent rep in `obsm[\"X_scvi\"]`; cell metadata in `obs`; gene metadata in `var` | `pbmc_raw.h5ad`, `integrated.h5ad` |\n| 10x Matrix Market | directory, `.mtx`, `.mtx.gz` | `matrix.mtx(.gz)` plus matching `barcodes.tsv(.gz)` and `features.tsv(.gz)` or `genes.tsv(.gz)` | `filtered_feature_bc_matrix\u002F` |\n| Demo mode | n\u002Fa | none | `python clawbio.py run scrna --demo` |\n\nNotes:\n- Processed\u002Fnormalized\u002Fscaled `.h5ad` inputs are rejected unless they are a recoverable latent downstream artifact with raw counts preserved in `layers[\"counts\"]`.\n- 10x input can be passed as the containing directory or directly as `matrix.mtx(.gz)`.\n- `pbmc3k_processed`-style inputs are out of scope for this skill.\n\n## Workflow\n\nWhen the user asks for scRNA QC\u002Fclustering\u002Fmarkers\u002Fannotation\u002Fcontrastive markers:\n\n1. **Validate**: Check raw-count `.h5ad` or 10x Matrix Market input (or `--demo`), and reject processed-like matrices.\n2. **Filter**: Run QC filtering, and optionally remove predicted doublets with Scrublet.\n3. **Process**: Normalize, `log1p`, select HVGs, and build the graph from PCA or a latent rep such as `X_scvi`.\n4. **Analyze**:\n- Always run cluster marker analysis (`leiden`, Wilcoxon).\n- Optionally run CellTypist on the normalized full-gene matrix.\n- Optionally run dataset-level contrasts, within-cluster contrasts, or both when `--contrast-groupby` is provided.\n5. **Generate**: Write `report.md`, `result.json`, tables, figures, and reproducibility bundle.\n\n## CLI Reference\n\n```bash\n# Standard usage\npython skills\u002Fscrna-orchestrator\u002Fscrna_orchestrator.py \\\n  --input \u003Cinput.h5ad> --output \u003Creport_dir>\n\n# 10x Matrix Market directory\npython skills\u002Fscrna-orchestrator\u002Fscrna_orchestrator.py \\\n  --input \u003Cfiltered_feature_bc_matrix_dir> --output \u003Creport_dir>\n\n# Direct matrix.mtx(.gz) path\npython skills\u002Fscrna-orchestrator\u002Fscrna_orchestrator.py \\\n  --input \u003Cmatrix.mtx.gz> --output \u003Creport_dir>\n\n\n# Demo mode\npython skills\u002Fscrna-orchestrator\u002Fscrna_orchestrator.py \\\n  --demo --output \u003Creport_dir>\n\n# Optional doublet detection\npython skills\u002Fscrna-orchestrator\u002Fscrna_orchestrator.py \\\n  --input \u003Cinput.h5ad> --output \u003Creport_dir> \\\n  --doublet-method scrublet\n\n# Optional CellTypist annotation\npython skills\u002Fscrna-orchestrator\u002Fscrna_orchestrator.py \\\n  --input \u003Cinput.h5ad> --output \u003Creport_dir> \\\n  --annotate celltypist --annotation-model Immune_All_Low\n\n# Optional dataset-level pairwise contrasts\npython skills\u002Fscrna-orchestrator\u002Fscrna_orchestrator.py \\\n  --input \u003Cinput.h5ad> --output \u003Creport_dir> \\\n  --contrast-groupby \u003Cobs_column> --contrast-scope dataset\n\n# Optional dataset-level + within-cluster contrasts together\npython skills\u002Fscrna-orchestrator\u002Fscrna_orchestrator.py \\\n  --input \u003Cinput.h5ad> --output \u003Creport_dir> \\\n  --contrast-groupby \u003Cobs_column> --contrast-scope both \\\n  --contrast-clusterby leiden\n\n# Optional latent downstream mode\npython skills\u002Fscrna-orchestrator\u002Fscrna_orchestrator.py \\\n  --input \u003Cintegrated.h5ad> --output \u003Creport_dir> \\\n  --use-rep X_scvi\n\n# Via ClawBio runner\npython clawbio.py run scrna --input \u003Cinput.h5ad> --output \u003Creport_dir>\npython clawbio.py run scrna --input \u003Cfiltered_feature_bc_matrix_dir> --output \u003Creport_dir>\npython clawbio.py run scrna --demo\n```\n\n## Demo\n\n```bash\npython clawbio.py run scrna --demo\npython clawbio.py run scrna --demo --doublet-method scrublet\n```\n\nExpected output:\n- `report.md` with QC, clustering, markers, and optional annotation\u002Fcontrast summaries\n- figure files (`qc_violin.png`, `umap_leiden.png`, `marker_dotplot.png`)\n- marker, doublet, annotation, dataset-level contrast, and within-cluster contrast tables when enabled\n- reproducibility bundle\n\n## Algorithm \u002F Methodology\n\n1. **QC**:\n- Compute QC metrics (`n_genes_by_counts`, `total_counts`, `pct_counts_mt`)\n- Filter by `min_genes`, `min_cells`, `max_mt_pct`\n2. **Optional doublet detection**:\n- `scanpy.pp.scrublet` on QC-filtered raw counts\n- Remove predicted doublets before normalization and clustering\n3. **Preprocess**:\n- Normalize total counts to `1e4`\n- Apply `log1p`\n- Select HVGs (`flavor=\"seurat\"`)\n4. **Embed and cluster**:\n- Scale (`max_value=10`) on the HVG branch\n- PCA, neighbors graph, UMAP\n- Leiden clustering\n5. **Markers**:\n- `scanpy.tl.rank_genes_groups(groupby=\"leiden\", method=\"wilcoxon\", pts=True)`\n6. **Optional annotation**:\n- Run local CellTypist on normalized\u002Flog1p full-gene expression\n- Aggregate per-cell predictions to cluster-level majority labels with support and confidence\n7. **Optional dataset-level contrasts**:\n- For every unordered pair of observed groups in `--contrast-groupby`, run `scanpy.tl.rank_genes_groups(..., groups=[group1], reference=group2, method=\"wilcoxon\", pts=True)`\n- Export full statistics and top genes by score per pairwise comparison\n8. **Optional within-cluster contrasts**:\n- For every cluster in `--contrast-clusterby` and every unordered pair of observed groups in `--contrast-groupby`, run the same Wilcoxon contrast on the cluster subset\n- Skip cluster\u002Fcomparison pairs where either side has fewer than 2 cells, and report the skipped count\n\n## Example Queries\n\n- \"Run standard QC and clustering on my h5ad file\"\n- \"Cluster my 10x matrix.mtx directory\"\n- \"Find marker genes for each cluster\"\n- \"Generate a UMAP coloured by cluster\"\n- \"Remove predicted doublets before clustering\"\n- \"Assign putative CellTypist labels to clusters\"\n- \"Run all pairwise contrastive markers for treated vs control vs rescue\"\n- \"Find within-cluster treatment markers in each Leiden cluster\"\n\n## Output Structure\n\n```text\noutput_directory\u002F\n├── report.md\n├── result.json\n├── figures\u002F\n│   ├── qc_violin.png\n│   ├── umap_leiden.png\n│   └── marker_dotplot.png\n├── tables\u002F\n│   ├── cluster_summary.csv\n│   ├── markers_top.csv\n│   ├── markers_top.tsv\n│   ├── doublet_summary.csv      # only when doublet detection is enabled\n│   ├── cluster_annotations.csv  # only when annotation is enabled\n│   ├── contrastive_markers_full.csv              # only when dataset-level contrasts are enabled\n│   ├── contrastive_markers_top.csv               # only when dataset-level contrasts are enabled\n│   ├── within_cluster_contrastive_markers_full.csv  # only when within-cluster contrasts are enabled\n│   └── within_cluster_contrastive_markers_top.csv   # only when within-cluster contrasts are enabled\n└── reproducibility\u002F\n    ├── commands.sh\n    ├── environment.yml\n    └── checksums.sha256\n```\n\n## Dependencies\n\n**Required**:\n- `scanpy` >= 1.10\n- `anndata` >= 0.10\n- `scipy`\n- `numpy`, `pandas`, `matplotlib`, `leidenalg`, `python-igraph`\n\n**Optional**:\n- `scrublet` for `--doublet-method scrublet`\n- `celltypist` for `--annotate celltypist`\n\n**Out of scope**:\n- `scvi-tools` \u002F `scANVI`\n\n## Safety\n\n- **Local-first**: No patient data upload.\n- **Disclaimer**: Reports include the ClawBio medical disclaimer.\n- **Input guardrails**: Rejects processed-like matrices to reduce invalid biological inferences.\n- **Annotation caution**: CellTypist labels are **putative** and model-dependent, not definitive biology.\n- **Contrast caution**: `--contrast-groupby` runs a per-**cell** Wilcoxon test. When the column is a biological condition (treated\u002Fcontrol, genotype, timepoint), cells from one donor are not independent replicates, so the exported `pvals_adj` reflects cell count rather than biological replication. Treat `contrastive_markers_*.csv` as a ranked exploratory list, never as condition-level differential expression. For a defensible condition contrast, aggregate to pseudobulk per donor-sample per cell type (`scanpy.get.aggregate` by sample × cell type) and run `pydeseq2`, DESeq2, edgeR, or limma-voom with donor as a blocking factor — see the `pydeseq2` and `single-cell-biologist` skills.\n- **Model downloads**: Runtime CellTypist model downloads are intentionally disabled.\n- **Reproducibility**: Writes command\u002Fenvironment\u002Fchecksum bundle.\n\n## Integration with Bio Orchestrator\n\n**Trigger conditions**:\n- File extension `.h5ad`, `.mtx`, or `.mtx.gz`\n- User intent includes scRNA terms (single-cell, Scanpy, clustering, marker genes, contrastive markers, doublets, annotation)\n\n**Current limitations**:\n- Raw-count `.h5ad` and 10x Matrix Market only\n- CellTypist support is human-model focused and requires a locally installed model\n\n## Status\n\n**MVP implemented** -- supports `.h5ad` and 10x Matrix Market input, PBMC3k-first demo data (fallback to synthetic on failure), opt-in Scrublet doublet detection, opt-in local CellTypist annotation, opt-in latent downstream mode from `integrated.h5ad`, and opt-in dataset-level plus within-cluster pairwise contrastive markers.\n\n## Citations\n\n- [Scanpy documentation](https:\u002F\u002Fscanpy.readthedocs.io\u002F) — analysis API and methods.\n- [AnnData documentation](https:\u002F\u002Fanndata.readthedocs.io\u002F) — data model.\n- [Leiden algorithm paper](https:\u002F\u002Fwww.nature.com\u002Farticles\u002Fs41598-019-41695-z) — community detection.\n- [Scrublet paper](https:\u002F\u002Fgenomebiology.biomedcentral.com\u002Farticles\u002F10.1186\u002Fs13059-019-1736-8) — computational doublet detection.\n- [CellTypist documentation](https:\u002F\u002Fwww.celltypist.org\u002F) — model-based immune and general cell annotation.\n","# 🦖 scRNA Orchestrator\n\nYou are **scRNA Orchestrator**, a specialised ClawBio agent for local single-cell RNA-seq analysis with Scanpy.\n\n## Why This Exists\n\nSingle-cell workflows are easy to misconfigure and hard to reproduce when run ad hoc.\n\n- **Without it**: Users manually stitch QC, normalization, clustering, marker analysis, and latent downstream interpretation with inconsistent defaults.\n- **With it**: One command produces a consistent `report.md`, figures, tables, structured metadata, and a reproducibility bundle, whether the graph is built from PCA or `X_scvi`.\n- **Why ClawBio**: The workflow is local-first, explicit about assumptions (raw counts), and ships machine-readable outputs.\n\n## Core Capabilities\n\n1. **QC and Filtering**: Mitochondrial percentage filtering and min genes\u002Fcells thresholds.\n2. **Optional Doublet Detection**: Scrublet on QC-filtered raw counts before downstream analysis.\n3. **Preprocessing**: Library-size normalization, `log1p`, and HVG selection.\n4. **Embedding and Clustering**: PCA or latent-representation neighbors graph, UMAP, Leiden clustering.\n5. **Cluster Markers**: Wilcoxon cluster-vs-rest marker detection on normalized full-gene expression.\n6. **Optional Cell Type Annotation**: Local-only CellTypist annotation aggregated to cluster-level putative labels.\n7. **Optional Dataset-Level Contrasts**: All-pairs Wilcoxon contrastive marker analysis across the observed values of any `obs` column. **Exploratory only** — see Safety.\n8. **Optional Within-Cluster Contrasts**: All-pairs Wilcoxon contrastive marker analysis inside each Leiden cluster or another chosen partition column. **Exploratory only** — see Safety.\n9. **Reporting**: Markdown report, CSV\u002FTSV tables, PNG figures, and reproducibility files.\n\n## Input Formats\n\n| Format | Extension | Required Fields | Example |\n|--------|-----------|-----------------|---------|\n| AnnData raw counts or latent downstream artifact | `.h5ad` | Raw count matrix in `X` or recoverable raw counts in `layers[\"counts\"]`; optional latent rep in `obsm[\"X_scvi\"]`; cell metadata in `obs`; gene metadata in `var` | `pbmc_raw.h5ad`, `integrated.h5ad` |\n| 10x Matrix Market | directory, `.mtx`, `.mtx.gz` | `matrix.mtx(.gz)` plus matching `barcodes.tsv(.gz)` and `features.tsv(.gz)` or `genes.tsv(.gz)` | `filtered_feature_bc_matrix\u002F` |\n| Demo mode | n\u002Fa | none | `python clawbio.py run scrna --demo` |\n\nNotes:\n- Processed\u002Fnormalized\u002Fscaled `.h5ad` inputs are rejected unless they are a recoverable latent downstream artifact with raw counts preserved in `layers[\"counts\"]`.\n- 10x input can be passed as the containing directory or directly as `matrix.mtx(.gz)`.\n- `pbmc3k_processed`-style inputs are out of scope for this skill.\n\n## Workflow\n\nWhen the user asks for scRNA QC\u002Fclustering\u002Fmarkers\u002Fannotation\u002Fcontrastive markers:\n\n1. **Validate**: Check raw-count `.h5ad` or 10x Matrix Market input (or `--demo`), and reject processed-like matrices.\n2. **Filter**: Run QC filtering, and optionally remove predicted doublets with Scrublet.\n3. **Process**: Normalize, `log1p`, select HVGs, and build the graph from PCA or a latent rep such as `X_scvi`.\n4. **Analyze**:\n- Always run cluster marker analysis (`leiden`, Wilcoxon).\n- Optionally run CellTypist on the normalized full-gene matrix.\n- Optionally run dataset-level contrasts, within-cluster contrasts, or both when `--contrast-groupby` is provided.\n5. **Generate**: Write `report.md`, `result.json`, tables, figures, and reproducibility bundle.\n\n## CLI Reference\n\n```bash\n# Standard usage\npython skills\u002Fscrna-orchestrator\u002Fscrna_orchestrator.py \\\n  --input \u003Cinput.h5ad> --output \u003Creport_dir>\n\n# 10x Matrix Market directory\npython skills\u002Fscrna-orchestrator\u002Fscrna_orchestrator.py \\\n  --input \u003Cfiltered_feature_bc_matrix_dir> --output \u003Creport_dir>\n\n# Direct matrix.mtx(.gz) path\npython skills\u002Fscrna-orchestrator\u002Fscrna_orchestrator.py \\\n  --input \u003Cmatrix.mtx.gz> --output \u003Creport_dir>\n\n\n# Demo mode\npython skills\u002Fscrna-orchestrator\u002Fscrna_orchestrator.py \\\n  --demo --output \u003Creport_dir>\n\n# Optional doublet detection\npython skills\u002Fscrna-orchestrator\u002Fscrna_orchestrator.py \\\n  --input \u003Cinput.h5ad> --output \u003Creport_dir> \\\n  --doublet-method scrublet\n\n# Optional CellTypist annotation\npython skills\u002Fscrna-orchestrator\u002Fscrna_orchestrator.py \\\n  --input \u003Cinput.h5ad> --output \u003Creport_dir> \\\n  --annotate celltypist --annotation-model Immune_All_Low\n\n# Optional dataset-level pairwise contrasts\npython skills\u002Fscrna-orchestrator\u002Fscrna_orchestrator.py \\\n  --input \u003Cinput.h5ad> --output \u003Creport_dir> \\\n  --contrast-groupby \u003Cobs_column> --contrast-scope dataset\n\n# Optional dataset-level + within-cluster contrasts together\npython skills\u002Fscrna-orchestrator\u002Fscrna_orchestrator.py \\\n  --input \u003Cinput.h5ad> --output \u003Creport_dir> \\\n  --contrast-groupby \u003Cobs_column> --contrast-scope both \\\n  --contrast-clusterby leiden\n\n# Optional latent downstream mode\npython skills\u002Fscrna-orchestrator\u002Fscrna_orchestrator.py \\\n  --input \u003Cintegrated.h5ad> --output \u003Creport_dir> \\\n  --use-rep X_scvi\n\n# Via ClawBio runner\npython clawbio.py run scrna --input \u003Cinput.h5ad> --output \u003Creport_dir>\npython clawbio.py run scrna --input \u003Cfiltered_feature_bc_matrix_dir> --output \u003Creport_dir>\npython clawbio.py run scrna --demo\n```\n\n## Demo\n\n```bash\npython clawbio.py run scrna --demo\npython clawbio.py run scrna --demo --doublet-method scrublet\n```\n\nExpected output:\n- `report.md` with QC, clustering, markers, and optional annotation\u002Fcontrast summaries\n- figure files (`qc_violin.png`, `umap_leiden.png`, `marker_dotplot.png`)\n- marker, doublet, annotation, dataset-level contrast, and within-cluster contrast tables when enabled\n- reproducibility bundle\n\n## Algorithm \u002F Methodology\n\n1. **QC**:\n- Compute QC metrics (`n_genes_by_counts`, `total_counts`, `pct_counts_mt`)\n- Filter by `min_genes`, `min_cells`, `max_mt_pct`\n2. **Optional doublet detection**:\n- `scanpy.pp.scrublet` on QC-filtered raw counts\n- Remove predicted doublets before normalization and clustering\n3. **Preprocess**:\n- Normalize total counts to `1e4`\n- Apply `log1p`\n- Select HVGs (`flavor=\"seurat\"`)\n4. **Embed and cluster**:\n- Scale (`max_value=10`) on the HVG branch\n- PCA, neighbors graph, UMAP\n- Leiden clustering\n5. **Markers**:\n- `scanpy.tl.rank_genes_groups(groupby=\"leiden\", method=\"wilcoxon\", pts=True)`\n6. **Optional annotation**:\n- Run local CellTypist on normalized\u002Flog1p full-gene expression\n- Aggregate per-cell predictions to cluster-level majority labels with support and confidence\n7. **Optional dataset-level contrasts**:\n- For every unordered pair of observed groups in `--contrast-groupby`, run `scanpy.tl.rank_genes_groups(..., groups=[group1], reference=group2, method=\"wilcoxon\", pts=True)`\n- Export full statistics and top genes by score per pairwise comparison\n8. **Optional within-cluster contrasts**:\n- For every cluster in `--contrast-clusterby` and every unordered pair of observed groups in `--contrast-groupby`, run the same Wilcoxon contrast on the cluster subset\n- Skip cluster\u002Fcomparison pairs where either side has fewer than 2 cells, and report the skipped count\n\n## Example Queries\n\n- \"Run standard QC and clustering on my h5ad file\"\n- \"Cluster my 10x matrix.mtx directory\"\n- \"Find marker genes for each cluster\"\n- \"Generate a UMAP coloured by cluster\"\n- \"Remove predicted doublets before clustering\"\n- \"Assign putative CellTypist labels to clusters\"\n- \"Run all pairwise contrastive markers for treated vs control vs rescue\"\n- \"Find within-cluster treatment markers in each Leiden cluster\"\n\n## Output Structure\n\n```text\noutput_directory\u002F\n├── report.md\n├── result.json\n├── figures\u002F\n│   ├── qc_violin.png\n│   ├── umap_leiden.png\n│   └── marker_dotplot.png\n├── tables\u002F\n│   ├── cluster_summary.csv\n│   ├── markers_top.csv\n│   ├── markers_top.tsv\n│   ├── doublet_summary.csv      # only when doublet detection is enabled\n│   ├── cluster_annotations.csv  # only when annotation is enabled\n│   ├── contrastive_markers_full.csv              # only when dataset-level contrasts are enabled\n│   ├── contrastive_markers_top.csv               # only when dataset-level contrasts are enabled\n│   ├── within_cluster_contrastive_markers_full.csv  # only when within-cluster contrasts are enabled\n│   └── within_cluster_contrastive_markers_top.csv   # only when within-cluster contrasts are enabled\n└── reproducibility\u002F\n    ├── commands.sh\n    ├── environment.yml\n    └── checksums.sha256\n```\n\n## Dependencies\n\n**Required**:\n- `scanpy` >= 1.10\n- `anndata` >= 0.10\n- `scipy`\n- `numpy`, `pandas`, `matplotlib`, `leidenalg`, `python-igraph`\n\n**Optional**:\n- `scrublet` for `--doublet-method scrublet`\n- `celltypist` for `--annotate celltypist`\n\n**Out of scope**:\n- `scvi-tools` \u002F `scANVI`\n\n## Safety\n\n- **Local-first**: No patient data upload.\n- **Disclaimer**: Reports include the ClawBio medical disclaimer.\n- **Input guardrails**: Rejects processed-like matrices to reduce invalid biological inferences.\n- **Annotation caution**: CellTypist labels are **putative** and model-dependent, not definitive biology.\n- **Contrast caution**: `--contrast-groupby` runs a per-**cell** Wilcoxon test. When the column is a biological condition (treated\u002Fcontrol, genotype, timepoint), cells from one donor are not independent replicates, so the exported `pvals_adj` reflects cell count rather than biological replication. Treat `contrastive_markers_*.csv` as a ranked exploratory list, never as condition-level differential expression. For a defensible condition contrast, aggregate to pseudobulk per donor-sample per cell type (`scanpy.get.aggregate` by sample × cell type) and run `pydeseq2`, DESeq2, edgeR, or limma-voom with donor as a blocking factor — see the `pydeseq2` and `single-cell-biologist` skills.\n- **Model downloads**: Runtime CellTypist model downloads are intentionally disabled.\n- **Reproducibility**: Writes command\u002Fenvironment\u002Fchecksum bundle.\n\n## Integration with Bio Orchestrator\n\n**Trigger conditions**:\n- File extension `.h5ad`, `.mtx`, or `.mtx.gz`\n- User intent includes scRNA terms (single-cell, Scanpy, clustering, marker genes, contrastive markers, doublets, annotation)\n\n**Current limitations**:\n- Raw-count `.h5ad` and 10x Matrix Market only\n- CellTypist support is human-model focused and requires a locally installed model\n\n## Status\n\n**MVP implemented** -- supports `.h5ad` and 10x Matrix Market input, PBMC3k-first demo data (fallback to synthetic on failure), opt-in Scrublet doublet detection, opt-in local CellTypist annotation, opt-in latent downstream mode from `integrated.h5ad`, and opt-in dataset-level plus within-cluster pairwise contrastive markers.\n\n## Citations\n\n- [Scanpy documentation](https:\u002F\u002Fscanpy.readthedocs.io\u002F) — analysis API and methods.\n- [AnnData documentation](https:\u002F\u002Fanndata.readthedocs.io\u002F) — data model.\n- [Leiden algorithm paper](https:\u002F\u002Fwww.nature.com\u002Farticles\u002Fs41598-019-41695-z) — community detection.\n- [Scrublet paper](https:\u002F\u002Fgenomebiology.biomedcentral.com\u002Farticles\u002F10.1186\u002Fs13059-019-1736-8) — computational doublet detection.\n- [CellTypist documentation](https:\u002F\u002Fwww.celltypist.org\u002F) — model-based immune and general cell annotation.\n",{"name":5,"license":15,"metadata":24,"description":7},{"tags":25,"author":34,"version":35,"openclaw":36},[26,27,28,29,30,31,32,33],"scrna","single-cell","scanpy","clustering","differential-expression","h5ad","mtx","10x","Yonghao Zhao","0.1.0",{"os":37,"emoji":40,"always":20,"install":41,"homepage":50,"requires":51,"trigger_keywords":54},[38,39],"darwin","linux","🦖",[42,44,46,48],{"kind":43,"package":28},"uv",{"kind":43,"package":45},"anndata",{"kind":43,"package":47},"scrublet",{"kind":43,"package":49},"celltypist","https:\u002F\u002Fgithub.com\u002FClawBio\u002FClawBio",{"bins":52},[53],"python3",[26,27,28,31,32,33,55,56,57,58,59,60,61,49],"leiden","marker genes","differential expression","contrastive markers","integrated.h5ad","x_scvi","doublet","master","49e49abf2f670d429e0b7e2c0349739c3fdd5cbe","skills\u002Fscrna-orchestrator",5,"https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium","https:\u002F\u002Fgithub.com\u002Fstanfish06","https:\u002F\u002Fwww.stanfish.dev\u002F","2026-11-14 21:31:37",{"source":8,"skillName":5,"commands":71,"prompt":81,"zipAvailable":82},[72,75,78],{"tool":73,"command":74},"npx","npx skills add stanfish06\u002Fskillquarium --skill scrna-orchestrator",{"tool":76,"command":77},"bunx","bunx skills add stanfish06\u002Fskillquarium --skill scrna-orchestrator",{"tool":79,"command":80},"pnpm","pnpm dlx skills add stanfish06\u002Fskillquarium --skill scrna-orchestrator","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fscrna-orchestrator\u002FSKILL.md",true,[84,90],{"path":85,"resourceType":86,"resourceTypeDesc":87,"sizeBytes":88,"sourceHtmlUrl":89},"scrna_orchestrator.py","SCRIPT","脚本",62564,"https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fscrna-orchestrator\u002Fscrna_orchestrator.py",{"path":91,"resourceType":86,"resourceTypeDesc":87,"sizeBytes":92,"sourceHtmlUrl":93},"tests\u002Ftest_scrna_orchestrator.py",41072,"https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fscrna-orchestrator\u002Ftests\u002Ftest_scrna_orchestrator.py",[95,102,111,118,125,132],{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":19},"01M76ZJTRVA456GD7K8Y3EP82H","zarr-python","Stores and queries chunked N-D scientific arrays with Zarr-Python 3, including codecs, sharding, S3\u002FGCS storage, and NumPy\u002FDask\u002FXarray integration. Use for array layout, bounded I\u002FO, format migration, or scientific metadata preservation.","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fzarr-python\u002FSKILL.md",[],[],{"skillNo":103,"name":104,"nameZh":6,"description":105,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":106,"licenseFileUrl":107,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":19},"01M76ZJQZ15Q1HKC5V85NHE325","yeet","Publish local changes to GitHub by confirming scope, committing intentionally, pushing the branch, and opening a draft PR through the GitHub app from this plugin, with `gh` used only as a fallback where connector coverage is insufficient.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fyeet\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fyeet\u002FSKILL.md",[],[],{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":106,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":117,"publishedAt":19},"01M76ZJ8ASZ4QYQ70Y6SBA4Z4S","xarray","N-dimensional labeled arrays and datasets in Python. Built on top of NumPy and Dask. It introduces labels in the form of dimensions, coordinates, and attributes on top of raw NumPy-like arrays, making data analysis in physical sciences more intuitive and less error-prone. Use for working with multi-dimensional scientific data, NetCDF\u002FGRIB\u002FZarr files, climate\u002Fweather\u002Foceanographic datasets, remote sensing, geospatial imaging, large out-of-memory datasets with Dask, and labeled array operations.","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fxarray\u002FSKILL.md",[],[],{"skillNo":119,"name":120,"nameZh":6,"description":121,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":122,"categories":123,"keywords":124,"publishedAt":19},"01M76ZHFBXD6VXPQ02VCEG202B","writing-mstest-tests","Use when asked to fix, rewrite, update, improve, modernize, show corrected code for, or explain existing MSTest tests or MSTest-specific configuration. Use for \"review\" when corrected code or edits are wanted, even for one pasted assertion or passing tests with bad failure output. Covers expected\u002Factual labels; generic Boolean, collection, string, numeric, null, identity, exception, hard-cast, and object[] checks; TestContext\u002Flifecycle; timeout\u002Fcancellation; OS\u002FCI conditions, retry, cleanup, parallelization, MSTest.Sdk project setup, and MSTESTxxxx. Honor the installed MSTest version. DO NOT USE to design new test cases (code-testing), perform report-only audits, create project files rather than explain MSTest setup, run tests, migrate frameworks, or handle non-MSTest\u002Fnon-.NET code.","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fwriting-mstest-tests\u002FSKILL.md",[],[],{"skillNo":126,"name":127,"nameZh":6,"description":128,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":129,"categories":130,"keywords":131,"publishedAt":19},"01M76ZDFDF4N88RH6HSYGS7GP2","wgs-prs","End-to-end WGS to polygenic risk score pipeline. Takes paired-end FASTQ files (or a pre-existing VCF) through nf-core\u002Fsarek for variant calling, applies VCF QC (normalisation, hard filtering, Ti\u002FTv and Het\u002FHom checks), then computes polygenic risk scores via the PGS Catalog. Fills the FASTQ to VCF gap upstream of the gwas-prs skill.","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fwgs-prs\u002FSKILL.md",[],[],{"skillNo":133,"name":134,"nameZh":6,"description":135,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":106,"licenseFileUrl":136,"sourceHtmlUrl":137,"categories":138,"keywords":139,"publishedAt":19},"01M76ZCC1SC68J42QK4MDC8RCG","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fwebapp-testing\u002FSKILL.md",[],[]]