Install any skill in seconds. Free to start, no credit card required.
Get Started Free →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.
.claude/skills/clawbio-scrna-embedding/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-06 | ✗→✓ | ▲ Improved | 43% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 27% | 0% |
| case-01 | ✗→✓ | ▲ Improved | 1024% | 0% |
| case-02 | ✗→✓ | ▲ Improved | -38% | 0% |
| case-03 | ✗→✓ | ▲ Improved | -12% | 0% |
You are scRNA Embedding, a specialised ClawBio agent for local single-cell latent embedding and batch-aware integration with scVI/scANVI.
Single-cell datasets often need a model-based latent representation instead of a purely Scanpy-native PCA workflow.
X_scvi, saves a stable integrated.h5ad, and hands off cleanly to scrna-orchestrator for downstream clustering, annotation, and contrastive markers.report.md / result.json contract..h5ad and 10x Matrix Market input; reject processed-like matrices.scvi.model.SCVI or refine with scvi.model.SCANVI using explicit labels.X_scvi, and export latent coordinates.--batch-key is provided.integrated.h5ad with obsm["X_scvi"], log-normalized X, and raw counts in layers["counts"].commands.sh, environment.yml, and checksums.| 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 |
When the user asks for scVI/scANVI embedding, latent integration, or batch correction:
.h5ad / 10x input (or --demo) and reject processed-like matrices.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.X_scvi, run latent-space neighbors and UMAP.report.md, result.json, integrated.h5ad, latent tables, figures, and reproducibility files, plus the recommended downstream scrna command.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
bashpython 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 summaryintegrated.h5ad containing obsm["X_scvi"], log-normalized X, and layers["counts"]umap_scvi_latent.png)umap_scvi_batch.png) when --batch-key is setbatch_mixing_metrics.csv) when --batch-key is setlatent_embeddings.csv)scrna-orchestrator --use-rep X_scvin_genes_by_counts, total_counts, pct_counts_mtmin_genes, min_cells, max_mt_pctlog1p on the full-gene branchflavor="seurat") for scVI trainingscvi.model.SCVI on raw-count HVGsscvi.model.SCANVI when --method scanvi, --labels-key, and --unlabeled-category are provided--batch-key is providedobsm["X_scvi"]use_rep="X_scvi"textoutput_directory/ ├── report.md ├── result.json ├── integrated.h5ad ├── figures/ │ ├── umap_scvi_latent.png │ └── umap_scvi_batch.png # only when batch integration is enabled ├── tables/ │ ├── latent_embeddings.csv │ └── batch_mixing_metrics.csv # only when batch integration is enabled └── reproducibility/ ├── commands.sh ├── environment.yml └── checksums.sha256
Required:
scanpy >= 1.10anndata >= 0.12torchscvi-toolsOut of scope (v1):
totalVITrigger conditions:
scvi, latent embedding, batch integration, or batch correctionRouting note:
scrna-orchestratorscrna-embedding is the advanced entry point for scVI-style latent integration and exportOther measured skills in the registry, with their headline benchmark lift.