Scrna orchestrator

From ComeOnOliver/skillshub · View interactive version

Scrna orchestrator is an AI agent skill from the GitHub repository ComeOnOliver/skillshub. 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/X_scvi, and optional two-group contrastive marker analysis from raw-count .h5ad or 10x Matrix Market input.

How to use this skill

Skill file

🦖 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.

Core Capabilities

  1. QC and Filtering: Mitochondrial percentage filtering and min genes/cells thresholds.
  2. Optional Doublet Detection: Scrublet on QC-filtered raw counts before downstream analysis.
  3. Preprocessing: Library-size normalization, log1p, and HVG selection.
  4. Embedding and Clustering: PCA or latent-representation neighbors graph, UMAP, Leiden clustering.
  5. Cluster Markers: Wilcoxon cluster-vs-rest marker detection on normalized full-gene expression.
  6. Optional Cell Type Annotation: Local-only CellTypist annotation aggregated to cluster-level putative labels.
  7. Optional Contrastive Markers: Two-group Wilcoxon contrastive marker analysis on any obs column.
  8. Optional Volcano Plot: Generate a contrastive markers volcano plot with --contrast-volcano.
  9. Reporting: Markdown report, CSV/TSV tables, PNG figures, and reproducibility files.

Input Formats

| Format | Extension | Required Fields | Example |

|--------|-----------|-----------------|---------|

| 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 |

| 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/ |

| Demo mode | n/a | none | python clawbio.py run scrna --demo |

Notes:

Workflow

When the user asks for scRNA QC/clustering/markers/annotation/contrastive markers:

  1. Validate: Check raw-count .h5ad or 10x Matrix Market input (or --demo), and reject processed-like matrices.
  2. Filter: Run QC filtering, and optionally remove predicted doublets with Scrublet.
  3. Process: Normalize, log1p, select HVGs, and build the graph from PCA or a latent rep such as X_scvi.
  4. Analyze:
  1. 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>

# 10x Matrix Market directory
python skills/scrna-orchestrator/scrna_orchestrator.py \
  --input <filtered_feature_bc_matrix_dir> --output <report_dir>

# Direct matrix.mtx(.gz) path
python skills/scrna-orchestrator/scrna_orchestrator.py \
  --input <matrix.mtx.gz> --output <report_dir>


# Demo mode
python skills/scrna-orchestrator/scrna_orchestrator.py \
  --demo --output <report_dir>

# Optional doublet detection
python skills/scrna-orchestrator/scrna_orchestrator.py \
  --input <input.h5ad> --output <report_dir> \
  --doublet-method scrublet

# Optional CellTypist annotation
python skills/scrna-orchestrator/scrna_orchestrator.py \
  --input <input.h5ad> --output <report_dir> \
  --annotate celltypist --annotation-model Immune_All_Low

# Optional two-group contrastive markers
python skills/scrna-orchestrator/scrna_orchestrator.py \
  --input <input.h5ad> --output <report_dir> \
  --contrast-groupby <obs_column> --contrast-group1 <group_a> --contrast-group2 <group_b>

# Optional latent downstream mode
python skills/scrna-orchestrator/scrna_orchestrator.py \
  --input <integrated.h5ad> --output <report_dir> \
  --use-rep X_scvi

# Optional contrastive markers volcano plot
python skills/scrna-orchestrator/scrna_orchestrator.py \
  --input <input.h5ad> --output <report_dir> \
  --contrast-groupby <obs_column> --contrast-group1 <group_a> --contrast-group2 <group_b> \
  --contrast-volcano

# Via ClawBio runner
python clawbio.py run scrna --input <input.h5ad> --output <report_dir>
python clawbio.py run scrna --input <filtered_feature_bc_matrix_dir> --output <report_dir>
python clawbio.py run scrna --demo

Demo

python clawbio.py run scrna --demo
python clawbio.py run scrna --demo --doublet-method scrublet

Expected output:

Algorithm / Methodology

  1. QC:
  1. Optional doublet detection:
  1. Preprocess:
  1. Embed and cluster:
  1. Markers:
  1. Optional annotation:
  1. Optional contrastive markers v1:
  1. Optional volcano plot:

Example Queries

Output Structure

output_directory/
├── report.md
├── result.json
├── figures/
│   ├── qc_violin.png
│   ├── umap_leiden.png
│   ├── marker_dotplot.png
│   └── contrastive_markers_volcano.png  # only when contrast volcano is enabled
├── tables/
│   ├── cluster_summary.csv
│   ├── markers_top.csv
│   ├── markers_top.tsv
│   ├── doublet_summary.csv      # only when doublet detection is enabled
│   ├── cluster_annotations.csv  # only when annotation is enabled
│   ├── contrastive_markers_full.csv     # only when contrastive markers are enabled
│   └── contrastive_markers_top.csv      # only when contrastive markers are enabled
└── reproducibility/
    ├── commands.sh
    ├── environment.yml
    └── checksums.sha256

Dependencies

Required:

Optional:

Out of scope:

Safety

Integration with Bio Orchestrator

Trigger conditions:

Current limitations:

Status

MVP implemented -- supports .h5ad input and --demo PBMC3k-first demo data (fallback to synthetic on failure), plus opt-in Scrublet doublet detection, opt-in local CellTypist annotation, opt-in latent downstream mode from integrated.h5ad, and opt-in two-group contrastive markers with volcano plots.

Citations

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.