Agent skill
scrna-orchestrator
Local Scanpy pipeline for single-cell RNA-seq QC, clustering, marker discovery, and optional two-group differential expression from raw-count .h5ad.
Install this agent skill to your Project
npx add-skill https://github.com/FreedomIntelligence/OpenClaw-Medical-Skills/tree/main/skills/scrna-orchestrator
Metadata
Additional technical details for this skill
- openclaw
-
{ "os": [ "macos", "linux" ], "emoji": "\ud83e\udd96", "always": false, "install": [ { "bins": [], "kind": "uv", "package": "scanpy" }, { "bins": [], "kind": "uv", "package": "anndata" } ], "homepage": "https://github.com/ClawBio/ClawBio", "requires": { "env": [], "bins": [ "python3" ], "config": [] }, "trigger_keywords": [ "scrna", "single-cell", "scanpy", "h5ad", "leiden", "marker genes", "differential expression" ] }
SKILL.md
๐ฆ scRNA Orchestrator
You are scRNA Orchestrator, a specialised ClawBio agent for local single-cell RNA-seq analysis with Scanpy.
Why This Exists
Single-cell workflows are easy to misconfigure and hard to reproduce when run ad hoc.
- Without it: Users manually stitch QC, normalization, clustering, and marker/DE steps with inconsistent defaults.
- With it: One command produces a consistent
report.md, figures, tables, and reproducibility bundle. - Why ClawBio: The workflow is local-first, explicit about assumptions (raw counts), and ships machine-readable outputs.
Core Capabilities
- QC and Filtering: Mitochondrial percentage filtering and min genes/cells thresholds.
- Preprocessing: Library-size normalization,
log1p, and HVG selection. - Embedding and Clustering: PCA, neighbors graph, UMAP, Leiden clustering.
- Cluster Markers: Wilcoxon cluster-vs-rest marker detection.
- Optional Group DE (v1): Two-group Wilcoxon DE on any
obscolumn. - Optional Volcano Plot: Generate DE volcano plot with
--de-volcano. - Reporting: Markdown report, CSV/TSV tables, PNG figures, reproducibility files.
Input Formats
| Format | Extension | Required Fields | Example |
|---|---|---|---|
| AnnData raw counts | .h5ad |
Raw count matrix in X; cell metadata in obs; gene metadata in var |
pbmc_raw.h5ad |
| Demo mode | n/a | none | python clawbio.py run scrna --demo |
Notes:
- Processed/normalized/scaled
.h5adinputs are rejected with an actionable error. pbmc3k_processed-style inputs are out of scope for this skill.
Workflow
When the user asks for scRNA QC/clustering/markers/DE:
- Validate: Check
.h5adinput (or--demo), and reject processed-like matrices. - Process: Run QC filtering, normalization, HVG selection, PCA, neighbors, UMAP, and Leiden.
- Analyze:
- Always run cluster marker analysis (
leiden, Wilcoxon). - Optionally run DE if
--de-groupby --de-group1 --de-group2are all provided.
- Generate: Write
report.md,result.json, tables, figures, and reproducibility bundle.
CLI Reference
# Standard usage
python skills/scrna-orchestrator/scrna_orchestrator.py \
--input <input.h5ad> --output <report_dir>
# Demo mode
python skills/scrna-orchestrator/scrna_orchestrator.py \
--demo --output <report_dir>
# Optional two-group DE
python skills/scrna-orchestrator/scrna_orchestrator.py \
--input <input.h5ad> --output <report_dir> \
--de-groupby <obs_column> --de-group1 <group_a> --de-group2 <group_b>
# Optional DE volcano plot
python skills/scrna-orchestrator/scrna_orchestrator.py \
--input <input.h5ad> --output <report_dir> \
--de-groupby <obs_column> --de-group1 <group_a> --de-group2 <group_b> \
--de-volcano
# Via ClawBio runner
python clawbio.py run scrna --input <input.h5ad> --output <report_dir>
python clawbio.py run scrna --demo
Demo
python clawbio.py run scrna --demo
Expected output:
report.mdwith QC, clustering, and marker summaries- figure files (
qc_violin.png,umap_leiden.png,marker_dotplot.png) - optional DE figure (
de_volcano.png) when--de-volcanois set - marker tables and reproducibility bundle
Algorithm / Methodology
- QC:
- Compute QC metrics (
n_genes_by_counts,total_counts,pct_counts_mt) - Filter by
min_genes,min_cells,max_mt_pct
- Preprocess:
- Normalize total counts to
1e4 - Apply
log1p - Select HVGs (
flavor="seurat")
- Embed and cluster:
- Scale (
max_value=10) - PCA, neighbors graph, UMAP
- Leiden clustering
- Markers:
scanpy.tl.rank_genes_groups(groupby="leiden", method="wilcoxon", pts=True)
- Optional DE v1:
scanpy.tl.rank_genes_groups(groupby=<de_groupby>, groups=[group1], reference=group2, method="wilcoxon", pts=True)- Export full statistics and top genes by score
- Optional volcano plot:
- Plot
logfoldchangesvs-log10(pvals_adj)(fallback topvalsif needed) - Highlight genes with
p < 0.05and|log2FC| >= 1
Example Queries
- "Run standard QC and clustering on my h5ad file"
- "Find marker genes for each cluster"
- "Generate a UMAP coloured by cluster"
- "Run differential expression for treated vs control"
Output Structure
output_directory/
โโโ report.md
โโโ result.json
โโโ figures/
โ โโโ qc_violin.png
โ โโโ umap_leiden.png
โ โโโ marker_dotplot.png
โ โโโ de_volcano.png # only when DE volcano is enabled
โโโ tables/
โ โโโ cluster_summary.csv
โ โโโ markers_top.csv
โ โโโ markers_top.tsv
โ โโโ de_full.csv # only when DE is enabled
โ โโโ de_top.csv # only when DE is enabled
โโโ reproducibility/
โโโ commands.sh
โโโ environment.yml
โโโ checksums.sha256
Dependencies
Required:
scanpy>= 1.10anndata>= 0.10numpy,pandas,matplotlib,leidenalg,python-igraph
Optional (future):
celltypist(cell-type annotation)scvi-tools(deep generative modeling)
Safety
- Local-first: No patient data upload.
- Disclaimer: Reports include the ClawBio medical disclaimer.
- Input guardrails: Rejects processed-like matrices to reduce invalid biological inferences.
- Reproducibility: Writes command/environment/checksum bundle.
Integration with Bio Orchestrator
Trigger conditions:
- File extension
.h5ad - User intent includes scRNA terms (single-cell, Scanpy, clustering, marker genes, DE)
Current limitations:
- Raw-count
.h5adonly - Seurat input/output is not implemented in Python path
- Multi-group pairwise DE, within-cluster DE, and automated annotation are future work
Citations
- Scanpy documentation โ analysis API and methods.
- AnnData documentation โ data model.
- Leiden algorithm paper โ community detection.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
vcf-annotator
Annotate VCF variants with VEP, ClinVar, gnomAD frequencies, and ancestry-aware context. Generates prioritised variant reports.
chemist-analyst
Analyzes events through chemistry lens using molecular structure, reaction mechanisms, thermodynamics, kinetics, and analytical techniques (spectroscopy, chromatography, mass spectrometry). Provides insights on chemical processes, material properties, reaction pathways, synthesis, and analytical methods. Use when: Chemical reactions, material analysis, synthesis planning, process optimization, environmental chemistry. Evaluates: Molecular structure, reaction mechanisms, yield, selectivity, safety, environmental impact.
bio-alignment-io
Read, write, and convert multiple sequence alignment files using Biopython Bio.AlignIO. Supports Clustal, PHYLIP, Stockholm, FASTA, Nexus, and other alignment formats for phylogenetics and conservation analysis. Use when reading, writing, or converting alignment file formats.
sleep-analyzer
ๅๆ็ก็ ๆฐๆฎใ่ฏๅซ็ก็ ๆจกๅผใ่ฏไผฐ็ก็ ่ดจ้๏ผๅนถๆไพไธชๆงๅ็ก็ ๆนๅๅปบ่ฎฎใๆฏๆไธๅ ถไปๅฅๅบทๆฐๆฎ็ๅ ณ่ๅๆใ
metabolomics-workbench-database
Access NIH Metabolomics Workbench via REST API (4,200+ studies). Query metabolites, RefMet nomenclature, MS/NMR data, m/z searches, study metadata, for metabolomics and biomarker discovery.
bio-hi-c-analysis-matrix-operations
Balance, normalize, and transform Hi-C contact matrices using cooler and cooltools. Apply iterative correction (ICE), compute expected values, and generate observed/expected matrices. Use when normalizing or transforming Hi-C matrices.
Didn't find tool you were looking for?