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.
74%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./skills/scrna-embedding/SKILL.mdYou 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.# 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 --demopython clawbio.py run scrna-embedding --demo
python clawbio.py run scrna-embedding --demo --batch-key demo_batchExpected 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"output_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.sha256Required:
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 exportClawBio/ClawBio
7282fd7
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.