Agent skill

Sc Batch Integration

by TianGzlab in TianGzlab/OmicsClaw

Load when integrating multi-sample scRNA-seq with Harmony, scVI, scANVI, BBKNN, Scanorama, SIMBA, or supported R-backed methods to remove batch effects.

Apache-2.0Auto-check passedResearch & Science

Install Sc Batch Integration

skills CLI
$ npx skills add TianGzlab/OmicsClaw --skill sc-batch-integration -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install TianGzlab/OmicsClaw sc-batch-integration --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/TianGzlab/OmicsClaw.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/singlecell/scrna/sc-batch-integration .claude/skills/sc-batch-integration && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
sc-batch-integration
GitHub stars
161
Token cost
~2.1k tokens
SKILL.md length
841 words
Files
12 (incl. references)
Skills in repo
88
Repo updated
First seen
Licence
Apache-2.0

At a glance

Load when integrating multi-sample scRNA-seq with Harmony, scVI, scANVI, BBKNN, Scanorama, SIMBA, or supported R-backed methods to remove batch effects.

  • Tasks that involve Bioinformatics
  • SKILL.md covers When to use, Steps, Inputs & Outputs and Gotchas, plus 4 more sections
  • Runs Python scripts from its folder; calls python

What it does

Sc Batch Integration is an agent skill from TianGzlab/OmicsClaw. Load when integrating multi-sample scRNA-seq with Harmony, scVI, scANVI, BBKNN, Scanorama, SIMBA, or supported R-backed methods to remove batch effects. Skip when the data is one sample (no batch effect to integrate); upstream merging only (use sc-multi-count).

Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 14 other files, including reference files (for example `_api.py`, `examples/example_step.py` and `references/methodology.md`).

It sits in Research & Science, covering Bioinformatics. It works with UMAP. The repository describes itself as: Conversational & memory-enabled AI research partner for multi-omics analysis. CLI + Desktop App (installers in Releases). From biological idea to full research paper. The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Bioinformatics

Example prompts

  • “/sc-batch-integration”

Requirements

  • Python 3

What it can do on your machine

Read from SKILL.md and the folder at commit 90a3bec. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Sc Batch Integration loads about 2.1k tokens when it runs, and up to ~4.5k if it reads all its reference files. Until then it costs about 71 tokens; SKILL.md has 841 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~71
When it runs · the whole SKILL.md, loaded when a task matches
~2.1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from TianGzlab/OmicsClaw at commit 90a3bec, republished under its Apache-2.0 licence (© TianGzlab). 841 words, ~2,062 tokens.

Download SKILL.mdSave it as .claude/skills/sc-batch-integration/SKILL.md (or your agent's skills folder). This skill also uses 11 other files; get the full folder from GitHub.
name
sc-batch-integration
description
Load when integrating multi-sample scRNA-seq with Harmony, scVI, scANVI, BBKNN, Scanorama, SIMBA, or supported R-backed methods to remove batch effects. Skip when the data is one sample (no batch effect to integrate); upstream merging only (use sc-multi-count).
trigger
batch integration, batch effect, harmony, scvi, bbknn, merge samples
tags
singlecell, scrna, batch-integration, harmony, scvi, scanvi, bbknn, scanorama, simba

sc-batch-integration

When to use

Correct batch effects in merged, normalised scRNA data. The nine methods are Harmony (default), scVI, scANVI, BBKNN, Scanorama, SIMBA, fastMNN, Seurat CCA and Seurat RPCA. Check batch/condition confounding before correction: a batch fully confounded with the biological contrast cannot be separated statistically.

Steps

Start a notebook step with python skills/_sdk/notebook/run.py new integration. Inside it, use integration = load_skill("sc-batch-integration"), then adata = integration.integrate(adata, method="harmony", batch_key="batch"). This returns the corrected representation; choose neighbours, UMAP and clustering separately with sc-clustering. After BBKNN, call load_skill("sc-clustering").cluster(adata, use_existing_graph=True) to keep the corrected graph. The default clustering call rebuilds it and loses BBKNN's batch correction. The CLI additionally builds neighbours/UMAP and writes the legacy report. See examples/example_step.py for a runnable PBMC example.

Inputs & Outputs

Input is AnnData with a batch column and normalised X. Keep counts in layers['counts'] for scVI/scANVI and R integration. Existing PCA is optional. The API returns AnnData and separate table/Figure helpers; it writes no output directory. R methods retain the existing H5AD bridge and need zellkonverter.

CLI outputs are processed.h5ad, report.md, result.json and reproducibility/{commands.sh,requirements.txt}. Non-empty tables are written to tables/{integration_summary,batch_sizes,cluster_sizes,batch_mixing_matrix,integration_metrics}.csv. Label-dependent tables and plots are optional. Plot data, including UMAP coordinates, live under figure_data/, not tables/umap.csv. See references/output_contract.md for the conditional inventory.

Gotchas

  • result.json.data.requested_method, executed_method, fallback_used and fallback_reason record scANVI's fallback to scVI when labels are absent. Supply --labels-key to choose an existing label column.
  • tables/integration_metrics.csv omits unavailable LISI/ASW values; this is not evidence of good or bad integration. Label-free input has no label ASW.
  • _api.py:303: run_info(adata) contains a small JSON summary. The retained Seurat bridge also returns old R UMAP coordinates under the private uns['_omicsclaw_legacy_integration_umap'] key. The CLI moves these to obsm['X_umap'] and removes the private key; the API adds no UMAP to obsm.
  • _api.py:39: obsm['X_harmony'] uses existing PCA only when the requested PCA size would exceed the data's rank. Normal-sized input still recomputes PCA.
  • _api.py:182: SIMBA uses a temporary working directory; do not run it concurrently in threads. Its returned AnnData can be a cell-subset copy.

Key CLI

bash
python skills/singlecell/scrna/sc-batch-integration/sc_integrate.py --demo --output /tmp/sc_integrate_demo
python skills/singlecell/scrna/sc-batch-integration/sc_integrate.py --input merged.h5ad --output results/integration --method harmony --batch-key sample_id --seed 0
python skills/singlecell/scrna/sc-batch-integration/sc_integrate.py --input labelled.h5ad --output results/scanvi --method scanvi --labels-key cell_type --no-gpu --n-epochs 200

--seed controls Harmony, Scanorama and scVI/scANVI and the Python CLI UMAP. It does not control SIMBA or the retained R integration bridge.

API

<!-- api:begin generated from _api.py; regenerate with run.py api <skill dir> --write -->
integrate(adata, *, method: str='harmony', batch_key: str='batch', harmony_theta: float=2.0, n_pcs: int=50, n_latent: int=30, n_epochs: int | None=None, use_gpu: bool=True, labels_key: str | None=None, bbknn_neighbors_within_batch: int=3, scanorama_knn: int=20, integration_features: int=2000, integration_pcs: int=30, simba_n_top_genes: int=3000, simba_n_components: int=15, simba_k: int=15, simba_num_workers: int=4, random_state: int=0)

Integrate batches and return AnnData with a corrected representation.

harmony reads log-normalised expression and batch labels, writes obsm['X_harmony'] and preserves cells and genes. It recomputes PCA on ordinary inputs; when n_pcs exceeds the small input's rank, it reuses an existing PCA or computes the largest valid PCA. No neighbours or UMAP are computed. Diagnostics are available through :func:run_info.

:param method: harmony (default), scvi, scanvi, bbknn, scanorama, simba, fastmnn, seurat_cca or seurat_rpca. BBKNN writes its batch-balanced neighbour graph, not a new embedding. :param batch_key: Batch column in obs; default batch. :param harmony_theta: Harmony diversity penalty; default 2.0. :param n_pcs: Requested Harmony components; default 50. :param n_latent: scVI/scANVI latent dimensions; default 30. :param n_epochs: Training epochs; None uses 400 for scVI, 200 for scANVI. :param use_gpu: Request a GPU for scVI/scANVI; default True, CPU if unavailable. :param labels_key: scANVI labels; None searches cell_type/leiden/louvain/ seurat_clusters. With no labels it falls back to scVI and records why. :param bbknn_neighbors_within_batch: BBKNN neighbours per batch; default 3. :param scanorama_knn: Scanorama matching neighbours; default 20. :param integration_features: R integration variable genes; default 2000. :param integration_pcs: R integration components; default 30. :param simba_n_top_genes: SIMBA variable genes; default 3000. :param simba_n_components: SIMBA inter-batch components; default 15. :param simba_k: SIMBA inter-batch neighbours; default 15. :param simba_num_workers: SIMBA training workers; default 4. :param random_state: Backend seed; default 0. Passed to Harmony, Scanorama and scVI/scANVI. SIMBA and the retained R bridge do not expose this seed. SIMBA runs in a temporary working directory; do not call it concurrently from multiple threads. :returns: AnnData, modified in place for Python methods except SIMBA. SIMBA and R methods can return a cell-subset copy. scVI/scANVI require raw counts in layers['counts']; other Python methods use X. :raises ValueError: The method, batch column or PCA dimensions are invalid. :raises ImportError: The chosen optional backend is unavailable.

Show full SKILL.md (155 more words)Show less
run_info(adata, *, keep: bool=True) -> dict

Return integration diagnostics; set keep=False to remove them from uns.

integration_metrics(adata, *, batch_key: str='batch', label_key: str | None=None, embedding_key: str='X_harmony') -> pd.DataFrame

Return LISI and ASW diagnostics; unavailable metrics are logged and omitted.

LISI values are also attached to obs["ilisi"] and, with labels, obs["clisi"]. The corrected embedding and batch column must exist.

batch_mixing_table(adata, *, batch_key: str='batch', label_key: str | None=None) -> pd.DataFrame

Return each label's fraction of cells from each batch; empty without labels.

batch_sizes_table(adata, *, batch_key: str='batch') -> pd.DataFrame

Return batch labels and cell counts, largest first.

batch_sizes_figure(adata, *, batch_key: str='batch')

Return a Figure of cell counts per batch; the caller owns saving and closing it.

<!-- api:end -->

See also

sc-multi-count merges samples; sc-clustering clusters the returned representation; sc-cell-annotation supplies labels. CLI tuning details are in references/parameters.md.

Dependencies

Python packages this skill's script needs. They are not installed for you — check before a long run.

anndata, bbknn, harmonypy, matplotlib, numpy, pandas, phate, scanorama, scanpy, scikit-learn, scipy, scvi-tools, seaborn, simba-bio, torch

© TianGzlab, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 11 other files (references) in skills/singlecell/scrna/sc-batch-integration of TianGzlab/OmicsClaw.

  • SKILL.md
  • _api.py
  • examples/example_step.py
  • references/methodology.md
  • references/output_contract.md
  • references/parameters.md
  • references/r_visualization.md
  • sc_integrate.py
  • tests/__init__.py
  • tests/test_integration_api.py
  • tests/test_sc_integrate.py
  • tests/test_sc_integrate_methods.py

Open the folder on GitHubat commit 90a3bec

Compare with similar skills

Sc Batch Integration next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Sc Batch Integration compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Sc Batch Integration this skillTianGzlab/OmicsClaw161—~2.1kAutomated safety check: PassApache-2.0
Scarf Single CellNygenAnalytics/scarf126—~5.6kAutomated safety check: PassBSD-3-Clause
ScanpyK-Dense-AI/scientific-agent-skills48k1 repos~5.1kAutomated safety check: PassBSD-3-Clause
Spatial S2 Normalize ClusterQING1105/ezST101—~428Automated safety check: PassMIT
Umap Tsne Analysisaipoch/medical-research-skills2k—~2.7kAutomated safety check: PassMIT
Bio Single Cell ClusteringGPTomics/bioSkills1.2k1 repos~3.5kAutomated safety check: PassMIT

Similar skills

  • Scarf Single Cell

    NygenAnalytics/scarf

    Analyze single-cell data with core Scarf, the out-of-core Zarr DataStore library with immutable artifacts and pipeline runs.

    126 GitHub stars~5.6k tokensUpdated yesterday
    Research & ScienceAuto-check passed
  • Scanpy

    K-Dense-AI/scientific-agent-skills

    Performs Scanpy single-cell RNA-seq QC, normalization, HVG selection, PCA/UMAP/t-SNE, clustering, exploratory marker ranking, pseudobulk preparation, visualization, and Seurat or…

    48k GitHub starsUsed in 1 repo~5.1k tokens
    Research & ScienceAuto-check passed
  • Stage 2 of the spatial transcriptomics workflow — normalize 10x Visium data and cluster spatial spots.

    101 GitHub stars~428 tokensUpdated 1 mo ago
    Research & ScienceAuto-check passed
  • Umap Tsne Analysis

    aipoch/medical-research-skills

    A skill your agent uses when performing sample-level dimensionality reduction and visualization on abundance or OTU-style matrices with a companion group file, generating UMAP and/or t-SNE…

    2k GitHub stars~2.7k tokensUpdated 21 days ago
    Research & ScienceAuto-check passed
  • Bio Single Cell Clustering

    GPTomics/bioSkills

    Dimensionality reduction and graph-based clustering for single-cell RNA-seq with Scanpy (Python) and Seurat (R).

    1.2k GitHub starsUsed in 1 repo~3.5k tokens
    Research & ScienceAuto-check passed
  • Plots spatial transcriptomics expression, clusters, and annotations on tissue using Squidpy and Scanpy.

    1.2k GitHub starsUsed in 1 repo~3.6k tokens
    Research & ScienceAuto-check passed

More from TianGzlab/OmicsClaw

All 88 skills in this repo
  • Bulkrna De

    TianGzlab/OmicsClaw

    Load when comparing gene expression between two conditions in bulk RNA-seq count data.

    161 GitHub starsUsed in 1 repo~867 tokens
    Auto-check passed
  • Bulkrna Cosinor Rhythm

    TianGzlab/OmicsClaw

    Load when the user needs Deterministic fixed-period 24-hour single-component cosinor OLS rhythm analysis for a bulk RNA time-course CSV.

    161 GitHub stars~840 tokensUpdated today
    Auto-check passed
  • Bulkrna Qc

    TianGzlab/OmicsClaw

    Load when checking a bulk RNA-seq count matrix for library-size outliers, gene detection rates, and sample-sample correlation before DE.

    161 GitHub starsUsed in 1 repo~789 tokens
    Auto-check passed
  • Sc Fastq Qc

    TianGzlab/OmicsClaw

    Load when checking raw single-cell FASTQ read quality (Phred / GC / adapter / length) before counting.

    161 GitHub starsUsed in 1 repo~1k tokens
    Auto-check passed
  • Sc Filter

    TianGzlab/OmicsClaw

    Load when removing low-quality cells and lowly-detected genes from a single-cell AnnData using QC-derived thresholds or tissue presets.

    161 GitHub starsUsed in 1 repo~2.1k tokens
    Auto-check passed
  • Sc Markers

    TianGzlab/OmicsClaw

    Load when ranking cluster-level marker genes from a clustered single-cell AnnData via Scanpy Wilcoxon / t-test / logreg or COSG specificity.

    161 GitHub starsUsed in 1 repo~2.2k tokens
    Auto-check passed

Works with

Questions about Sc Batch Integration

What does Sc Batch Integration do?

Load when integrating multi-sample scRNA-seq with Harmony, scVI, scANVI, BBKNN, Scanorama, SIMBA, or supported R-backed methods to remove batch effects. Sc Batch Integration is an agent skill from TianGzlab/OmicsClaw. Load when integrating multi-sample scRNA-seq with Harmony, scVI, scANVI, BBKNN, Scanorama, SIMBA, or supported R-backed methods to remove batch effects.

When should I use Sc Batch Integration?

Sc Batch Integration fits situations like: tasks that involve Bioinformatics.

How do I install Sc Batch Integration in Claude Code?

Run `npx skills add TianGzlab/OmicsClaw --skill sc-batch-integration -a claude-code`. Or copy the skill folder (skills/singlecell/scrna/sc-batch-integration in TianGzlab/OmicsClaw) into .claude/skills/sc-batch-integration in your project. Claude Code loads it when a task matches its description.

How do I install Sc Batch Integration in Codex?

Run `npx skills add TianGzlab/OmicsClaw --skill sc-batch-integration -a codex`. Or copy the skill folder (skills/singlecell/scrna/sc-batch-integration in TianGzlab/OmicsClaw) into .agents/skills/sc-batch-integration in your project. Codex loads it when a task matches its description.

Can I use Sc Batch Integration in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add TianGzlab/OmicsClaw --skill sc-batch-integration -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/sc-batch-integration, .gemini/skills/sc-batch-integration, .github/skills/sc-batch-integration and .opencode/skills/sc-batch-integration in your project.

What does Sc Batch Integration need to run?

Going by SKILL.md and its folder, Sc Batch Integration needs Python for the scripts in its folder and the command-line tools its instructions call (python). Our summary lists: Python 3.

Does Sc Batch Integration access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Sc Batch Integration safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Sc Batch Integration use?

Sc Batch Integration is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Sc Batch Integration use?

About 2.1k tokens (SKILL.md is roughly 8.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.5k tokens, read only when the agent opens those files.

What are the alternatives to Sc Batch Integration?

Skills that share tags, products or a category with Sc Batch Integration: Scarf Single Cell (NygenAnalytics/scarf, 126 stars), Scanpy (K-Dense-AI/scientific-agent-skills, 48k stars), Spatial S2 Normalize Cluster (QING1105/ezST, 101 stars) and Umap Tsne Analysis (aipoch/medical-research-skills, 2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Sc Batch Integration?

TianGzlab (a GitHub organization) maintains it in TianGzlab/OmicsClaw, which has 161 GitHub stars. The repository holds 88 skills in this directory. The repository was last updated on October 7, 2026.

Source: TianGzlab/OmicsClaw on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.