bulkrna-batch-correction

bulkrna-batch-correction is a skill for Claude Code, Codex from TianGzlab/OmicsClaw. It costs 63 tokens per session (1,155 once invoked), scanned A, original, Apache-2.0.

A tool for correcting batch effects in bulk RNA sequencing data from multiple groups or experiments. A batch effect is an unwanted difference caused by things such as sequencing runs or preparation dates rather than biology.

In plain words
What is it for?
Loading an expression table and batch information, applying ComBat correction, comparing data before and after correction with PCA, and producing corrected tables and a report.
Why use it?
It reduces technical differences that can make samples group by experiment conditions instead of their real biological differences.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/tiangzlab/omicsclaw/bulkrna-batch-correction
Any agent
npx skills add TianGzlab/OmicsClaw --skill bulkrna-batch-correction
Clone the repo
git clone --depth 1 https://github.com/TianGzlab/OmicsClaw

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for bulkrna-batch-correction

README.md
[![agentmods](https://agentmods.dev/badge/skills/tiangzlab/omicsclaw/bulkrna-batch-correction.svg)](https://agentmods.dev/skills/tiangzlab/omicsclaw/bulkrna-batch-correction)
Your own site
<a href="https://agentmods.dev/skills/tiangzlab/omicsclaw/bulkrna-batch-correction"><img src="https://agentmods.dev/badge/skills/tiangzlab/omicsclaw/bulkrna-batch-correction.svg" alt="Measured on agentmods" height="20"></a>
Per session 63 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,155 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00063 $0.01155
Opus 5 $0.00032 $0.00577
Sonnet 5 $0.00013 $0.00231
Haiku 4.5 $0.00006 $0.00115

Measured 6d ago against content hash 339357148f1a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

bulkrna-batch-correction scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (bulkrna_batch_correction.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/bulkrna/bulkrna-batch-correction/SKILL.md · 85 lines

How it starts

The opening of the file, as written. The whole thing — 85 lines — stays where its author put it; the contents beside it link to each section on GitHub.

bulkrna-batch-correction

When to use

Run when bulkrna-qc PCA or sample-correlation heatmap reveals samples clustering by batch (cohort, sequencing run, library prep date) rather than by biology. Applies ComBat — preferring the R sva implementation when available, falling back to a Python port.

Inputs & Outputs

Inputs

  • File types: .csv

Outputs

  • tables/batch_info.csv
  • tables/batch_metrics.csv
  • tables/corrected_counts.csv
  • tables/corrected_expression.csv
  • tables/counts.csv
  • figures/batch_assessment.png
  • report.md
  • result.json

Flow

  1. Load expression matrix + batch metadata.
  2. Try R sva::ComBat first; on import failure, fall back to Python ComBat (bulkrna_batch_correction.py:427 warns "R ComBat not available (...); using Python fallback.").
  3. The Python fallback short-circuits with a warning at :165 ("Only 1 batch detected; returning data unchanged.") when --batch-info describes a single batch. The R path has no equivalent guard.
  4. Render before/after PCA; emit corrected table, batch-metrics table, and report.

Gotchas

  • Single-batch input is a silent no-op (Python fallback only). bulkrna_batch_correction.py:165 returns the input unchanged with a warning when only one batch is detected — but only when the Python ComBat path runs. The R sva::ComBat path at :421 does not have this guard, so a single-batch run on an R-equipped system may proceed with nonsense output. Verify result.json["n_batches"] ≥ 2 before trusting downstream results.
  • R vs Python ComBat give numerically different results. :427's silent fallback to the Python port can produce per-gene corrected values that differ at the 3rd decimal from R sva — usually inconsequential for downstream DE but visible in direct value comparisons. The chosen backend is not recorded in the summary dict; only the warning log distinguishes them.
  • ComBat assumes the biological design is balanced across batches. If condition X is only in batch 1 and condition Y is only in batch 2, ComBat will remove the biology along with the batch effect. No automatic check — sanity-cross-tabulate condition × batch before running, and consider including condition as a covariate in a more sophisticated tool (limma::removeBatchEffect) if confounded.
  • Negative output values are normal for ComBat-on-counts. ComBat operates in log-space and returns gene-by-sample matrices that can contain negative values after back-transform. Do NOT pipe corrected_expression.csv into bulkrna-de (which expects non-negative integer counts) — use the corrected matrix only for visualisation, clustering, or co-expression analysis.
  • Silhouette score interpretation is direction-of-improvement, not absolute. silhouette_before / silhouette_after (in result.json and batch_metrics.csv) measure batch clustering tightness. A drop indicates batch effect has been reduced; absolute values depend on how separable the batches were originally.

Read the full file on GitHub · 85 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 85 lines · 63 tokens per session scan A 339357148f1a

Subscribe to this mod's changes

bulkrna-batch-correction is a skill published in the GitHub repository TianGzlab/OmicsClaw (160 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 63 tokens to every session and 1,155 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

scanpy

Standard single-cell RNA-seq analysis pipeline. Use for QC, normalization, dimensionality reduction (PCA/UMAP/t-SNE), clustering, differential expression, and visualization. Best for exploratory scRNA-seq analysis with established workflows. For deep learning models use scvi-tools; for data format questions use…

synthetic-sciences/openscience · 68 tokens

cellxgene-census-query

Query CZ CELLxGENE Census (61M+ cells). Filter by cell type/tissue/disease, retrieve expression data, and integrate with scanpy/PyTorch for population-scale single-cell analysis. Use this skill when: (1) Querying single-cell expression data by cell type, tissue, or disease, (2) Exploring available single-cell datasets…

PharMolix/OpenBioMed · 105 tokens

single-cell-scrna-seq-analysis-scanpy

Complete single-cell RNA-seq analysis workflow built on Scanpy and AnnData. Use this skill when: (1) Loading diverse single-cell data formats (10X, h5ad, CSV), (2) Performing quality control and filtering, (3) Normalization, dimensionality reduction, and clustering, (4) Marker gene identification and cell type…

PharMolix/OpenBioMed · 85 tokens

single-cell-multi-omics-analysis-scvi

Probabilistic deep learning framework for single-cell multi-omics data analysis. Use this skill when: (1) Analyzing single-cell RNA-seq data with batch correction, (2) Integrating multi-modal data (CITE-seq, ATAC-seq, multi-omics), (3) Performing cell type annotation with scANVI, (4) Spatial transcriptomics…

PharMolix/OpenBioMed · 94 tokens

data-stats-analysis

Perform statistical tests, hypothesis testing, correlation analysis, and multiple testing corrections using scipy and statsmodels. Works with ANY LLM provider (GPT, Gemini, Claude, etc.).

omicverse/omicverse · 40 tokens

single-cell-annotation-skills-with-omicverse

Cell type annotation: SCSA, MetaTiME, CellVote consensus, CellMatch, GPTAnno, weighted KNN label transfer in OmicVerse.

omicverse/omicverse · 42 tokens