Trains scVI/scANVI models for single-cell latent embeddings and batch integration from raw-count .h5ad or 10x inputs, exporting stable integrated AnnData.
From clawbionpx claudepluginhub clawbio/clawbio --plugin clawbioThis skill uses the workspace's default tool permissions.
scrna_embedding.pytests/test_scrna_embedding.pyProvides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
Calculates TAM/SAM/SOM using top-down, bottom-up, and value theory methodologies for market sizing, revenue estimation, and startup validation.
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.# 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
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 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.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 export