Scrna Embedding logo

Scrna Embedding

OrganizationPopular
ClawBio
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 AnnData export for downstream latent analysis.

Overview

PublisherClawBio
RepositoryClawBio
Skill namescrna-embedding
Stars
1.2K
Forks
280
Bundled files
2
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 2 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by ClawBio on GitHub. Read the source before you install it.

Installation

Install the Scrna Embedding AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/ClawBio/ClawBio/tree/main/skills/scrna-embedding
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ClawBio/ClawBio.git /tmp/ClawBio
mkdir -p .claude/skills
cp -r /tmp/ClawBio/skills/scrna-embedding .claude/skills/scrna-embedding
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Scrna Embedding in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Scrna Embedding on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Scrna Embedding is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

🧬 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"].
  6. Reproducibility Bundle: Emit commands.sh, environment.yml, and checksums.

Input Formats

FormatExtensionRequired FieldsExample
AnnData raw counts.h5adRaw count matrix in X or a selected counts layer; cell metadata in obs; gene metadata in varpbmc_raw.h5ad
10x Matrix Marketdirectory, .mtx, .mtx.gzmatrix.mtx(.gz) plus matching barcodes.tsv(.gz) and features.tsv(.gz) or genes.tsv(.gz)filtered_feature_bc_matrix/
Demo moden/anonepython 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
  1. Feature selection:
  • Normalize + log1p on the full-gene branch
  • Select HVGs (flavor="seurat") for scVI training
  1. 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
  1. Latent downstream analysis:
  • Save obsm["X_scvi"]
  • Run neighbors with use_rep="X_scvi"
  • Compute UMAP
  • Export per-cell latent coordinates to CSV
  1. 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/
├── 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

Dependencies

Required:

  • scanpy >= 1.10
  • anndata >= 0.12
  • torch
  • scvi-tools

Out of scope (v1):

  • totalVI
  • multimodal integration
  • condition-level DE
  • remote model downloads

Safety

  • Local-first: No patient data upload.
  • Disclaimer: Reports include the ClawBio medical disclaimer.
  • Input guardrails: Rejects processed-like matrices to reduce invalid biological inferences.
  • No remote model fetches: v1 uses only local code and local data.
  • Reproducibility: Writes command/environment/checksum bundle.

Integration with Bio Orchestrator

Trigger conditions:

  • User explicitly asks for scvi, latent embedding, batch integration, or batch correction
  • Input is single-cell data and the request is specifically model-based embedding rather than generic Scanpy clustering

Routing note:

  • Generic single-cell clustering / marker requests still belong to scrna-orchestrator
  • scrna-embedding is the advanced entry point for scVI-style latent integration and export

Citations

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Scrna Embedding AI skill do?

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.

Why use Scrna Embedding on TypingMind?

Because you install it once and use it with any model. Scrna Embedding is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Scrna Embedding in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/ClawBio/ClawBio/tree/main/skills/scrna-embedding. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Scrna Embedding?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Scrna Embedding?

As many as you like. As long as a model supports skills, you can use Scrna Embedding with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Scrna Embedding AI skill free?

Yes. It is published on GitHub by ClawBio under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇