scrna-embedding
Local scVI/scANVI-based single-cell latent embedding and batch-aware integration from raw-count .h5ad or 10x Matrix Market input, with stable integrated…
Skill by Yonghao Zhao
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/clawbio-scrna-embedding
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: ml
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
- Runs as
- Python package
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/scrna-embedding
What's inside
- Skill name
scrna-embedding- Description
- Local scVI/scANVI-based single-cell latent embedding and batch-aware integration from raw-count .h5ad or 10x Matrix Market input, with stable integrated AnnData export for downstream latent analysis.
- License
- MIT
- Metadata
- author: Yonghao Zhao · version: 0.1.0
- Instructions
- 173 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
Files (3)
- SKILL.md
- scrna_embedding.py
- test_scrna_embedding.py · tests/
SKILL.md (first lines)
# 🧬 scRNA Embedding You are **scRNA Embedding**, a specialised ClawBio agent for local single-cell latent embedding and batch-aware integration with scVI/scANVI. ## Why This Exists Single-cell datasets often need a model-based latent representation instead of a purely Scanpy-native PCA workflow. - **Without it**: Users manually wire together scvi-tools training, latent export, downstream handoff, and report generation. - **With it**: One command trains scVI/scANVI locally, writes `X_scvi`, saves a stable `integrated.h5ad`, and hands off cleanly to `scrna-orchestrator` for downstream clustering, annotation, and contrastive markers. - **Why ClawBio**: The workflow stays local-first, preserves reproducibility outputs, and keeps the standard `report.md` / `result.json` contract. ## Core Capabilities 1. **Raw-count Input Validation**: Accept raw-count `.h5ad` and 10x Matrix Market input; reject processed-like matrices. 2. **scVI/scANVI Latent Embedding**: Train `scvi.model.SCVI` or refine with `scvi.model.SCANVI` using explicit labels. 3. **Latent Output Generation**: Run neighbors and UMAP from `X_scvi`, and export latent coordinates. 4. **Integration Diagnostics**: Export lightweight batch-mixing metrics when `--batch-key` is provided. 5. **Integrated Export**: Save `integrated.h5ad` with `obsm["X_scvi"]`, log-normalized `X`, and raw counts in `layers["counts"]`. 5. **Reproducibility Bundle**: Emit `commands.sh`, `environment.yml`, and checksums. ## Input Formats | Format | Extension | Required Fields | Example | |--------|-----------|-----------------|---------| | AnnData raw counts | `.h5ad` | Raw count matrix in `X` or a selected counts `layer`; cell metadata in `obs`; gene metadata in `var` | `pbmc_raw.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-embedding --demo` | ## Workflow When the user asks for scVI/scANVI embedding, latent integration, or batch correction: 1. **Validate**: Check raw-count `.h5ad` / 10x input (or `--demo`) and reject processed-like matrices. 2. **Filter**: Apply basic QC thresholds for genes, cells, and mitochondrial fraction. 3. **Train**: Fit `scvi.model.SCVI` on HVG raw counts, optionally using `--batch-key`, and refine with `scvi.model.SCANVI` when `--method scanvi` plus explicit labels are provided. 4. **Project**: Export `X_scvi`, run latent-space neighbors and UMAP. 5. **Generate**: Write a minimal `report.md`, `result.json`, `integrated.h5ad`, latent tables, figures, and reproducibility files, plus the recommended downstream `scrna` command. ## CLI Reference ```bash # Standard usage python skills/scrna-embedding/scrna_embedding.py \ --input <input.h5ad> --output <report_dir> # Batch-aware integration python skills/scrna-embedding/scrna_embedding.py \ --input <input.h5ad> --output <report_dir> \ --batch-key sample_id # scANVI with explicit labels python skills/scrna-embedding/scrna_embedding.py \ --input <input.h5ad> --output <report_dir> \ --method scanvi --labels-key cell_type --unlabeled-category Unknown # 10x Matrix Market directory python skills/scrna-embedding/scrna_embedding.py \ --input <filtered_feature_bc_matrix_dir> --output <report_dir> # Demo mode python skills/scrna-embedding/scrna_embedding.py \ --demo --output <report_dir> # Via ClawBio runner python clawbio.py run scrna-embedding --input <input.h5ad> --output <report_dir> python clawbio.py run scrna-embedding --demo ``` ## Demo ```bash python clawbio.py run scrna-embedding --demo python clawbio.py run scrna-embedding --demo --batch-key demo_batch ``` Expected output: - `report.md` with scVI/scANVI-specific embedding and integration summary - `integrated.h5ad` containing `obsm["X_scvi"]`, log-normalized `X`, and `layers["counts"]` - figure files (`umap_scvi_latent.png`) - optional batch figure (`umap_scvi_batch.png`) when `--batch-key` is set - batch diagnostics table (`batch_mixing_metrics.csv`) when `--batch-key` is set - latent export table (`latent_embeddings.csv`) - reproducibility bundle - downstream command for `scrna-orchestrator --use-rep X_scvi` ## Algorithm / Methodology 1. **QC**: - Compute `n_genes_by_counts`, `total_counts`, `pct_counts_mt` - Filter by `min_genes`, `min_cells`, `max_mt_pct` 2. **Feature selection**: - Normalize + `log1p` on the full-gene branch - Select HVGs (`flavor="seurat"`) for scVI training 3. **Latent model**: - Train `scvi.model.SCVI` on raw-count HVGs - Optionally refine with `scvi.model.SCANVI` when `--method scanvi`, `--labels-key`, and `--unlabeled-category` are provided - Include batch covariate when `--batch-key` is provided 4. **Latent downstream analysis**: - Save `obsm["X_scvi"]` - Run neighbors with `use_rep="X_scvi"` - Compute UMAP - Export per-cell latent coordinates to CSV 5. **Batch diagnostics**: - Compute lightweight mixing diagnostics from the neighbor graph and batch labels - Report cross-batch neighbor fraction, neighbor entropy, and batch silhouette ## Example Queries - "Run scVI on my h5ad file" - "Run scANVI on my labeled h5ad file" - "Integrate my batches with scvi-tools" - "Build a latent embedding for this 10x matrix" - "Export an integrated h5ad with X_scvi" ## Output Structure ```text output_directory/
From ClawBio/ClawBio, MIT.
More from ClawBio/ClawBio
- 0.825score
polars-bio
ClawBio (adapted from K-Dense scientific-agent-skills/polars-bio)
Fast genomic interval operations (overlap, nearest, merge, coverage, cluster, complement, subtract, count-overlaps), multi-format bioinformatics I/O…
SkillAFreshness: A★ 1.2KClaude Code +9 - 0.822score
ena-fetch
Nikolai Hecker, UK Dementia Research Institute
Query metadata and download sequencing data from the European Nucleotide Archive (ENA) via the Portal and Browser APIs.
SkillAFreshness: A★ 1.2KClaude Code +9 - 0.822score
gi-expression
ClawBio + Genomic Intelligence
Predict tissue / cell-type expression (log TPM + TPM) from 9,198–500,000 bp of DNA around a TSS, at least 4,599 bp each side (anything but exactly 9,198 bp…
SkillAFreshness: A★ 1.2KClaude Code +9 - 0.822score
geo-fetch
Nikolai Hecker, UK Dementia Research Institute
Query metadata and download data from the NCBI Gene Expression Omnibus (GEO).
SkillAFreshness: A★ 1.2KClaude Code +9 - 0.822score
ukb-ppp-region-fetch
ClawBio
Fetch a regional slice of plasma pQTL summary statistics from the UK Biobank Pharma Proteomics Project (UKB-PPP; Sun 2023 Nature) for a specific (protein…
SkillAFreshness: A★ 1.2KClaude Code +9 - 0.822score
eqtl-catalogue-region-fetch
ClawBio
Fetch a region of cis-eQTL summary statistics from EBI eQTL Catalogue v7+ via tabix-on-FTP.
SkillAFreshness: A★ 1.2KClaude Code +9 - 0.822score
protocols-io
ClawBio Contributors
Search, browse, and retrieve scientific protocols from protocols.io via REST API.
SkillAFreshness: A★ 1.2KClaude Code +9 - 0.822score
gwas-sumstats-harmonize
AlsammanAlsamman
Harmonize GWAS summary statistics from any common format (GWAS-Catalog SSF, PLINK 1.9/2, REGENIE, METAL, BOLT, SAIGE) to one canonical table (SNP CHR BP EA…
SkillAFreshness: A★ 1.2KClaude Code +9 - 0.822score
prs-applicability-gate
Rinat Rizvanov
Deterministic gate for ONE already-computed polygenic score result and ONE person: returns SUPPORTED (raw score, standardised score and reference percentile…
SkillAFreshness: A★ 1.2KClaude Code +9 - 0.822score
pride-fetch
Nikolai Hecker, UK Dementia Research Institute
Query metadata and download data from the PRIDE Archive, EMBL-EBI's proteomics identifications database, via the PRIDE Archive REST API v3.
SkillAFreshness: A★ 1.2KClaude Code +9 - 0.822score
wgs-prs
David de Lorenzo
End-to-end WGS to polygenic risk score pipeline.
SkillAFreshness: A★ 1.2KClaude Code +9 - 0.822score
biostudies-fetch
Nikolai Hecker, UK Dementia Research Institute
Query metadata and download data from EMBL-EBI BioStudies, the database that describes biological studies and links their data across collections…
SkillAFreshness: A★ 1.2KClaude Code +9
Signals
- Stars
- 1,166
- Forks
- 288
- Open issues
- 27
- Last commit (this folder)
- May 24, 2026 (5 months ago)
- Last release
- Sep 11, 2026 (1 month ago)
From GitHub (fetched Oct 24, 2026).
Details
- Version
- 0.1.0
- License
- MIT
- Repository
- github.com/ClawBio/ClawBio
- Website
- clawbio.github.io/ClawBio/
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from Yonghao Zhao
- 0.815score
diff-visualizer
Yonghao Zhao
Rich downstream visualisation and reporting for bulk RNA-seq differential expression and scRNA marker/contrast outputs.
SkillAFreshness: A★ 1.2KClaude Code +9 - 0.776score
scrna-orchestrator
Yonghao Zhao
Local Scanpy pipeline for single-cell RNA-seq QC, optional doublet detection, clustering, marker discovery, optional CellTypist annotation, optional latent…
SkillBFreshness: B★ 1.2KClaude Code +9
Cite this page
scrna-embedding skill. Agent Mart. https://agentmart.dev/skills/clawbio-scrna-embedding (last updated 2026-10-24)