bulkrna-batch-correction
Load when removing batch effects from a multi-cohort bulk RNA-seq dataset using ComBat (R or Python implementation). Skip when there is only one batch…
от lilinji★ 18 звёзд на GitHub
Установить bulkrna-batch-correction в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
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.csvtables/batch_metrics.csvtables/corrected_counts.csvtables/corrected_expression.csvtables/counts.csvfigures/batch_assessment.pngreport.mdresult.json
Flow
- Load expression matrix + batch metadata.
- Try R
sva::ComBatfirst; on import failure, fall back to Python ComBat (bulkrna_batch_correction.py:427warns "R ComBat not available (...); using Python fallback."). - The Python fallback short-circuits with a warning at
:165("Only 1 batch detected; returning data unchanged.") when--batch-infodescribes a single batch. The R path has no equivalent guard. - 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:165returns the input unchanged with a warning when only one batch is detected — but only when the Python ComBat path runs. The Rsva::ComBatpath at:421does not have this guard, so a single-batch run on an R-equipped system may proceed with nonsense output. Verifyresult.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 Rsva— 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 × batchbefore 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.csvintobulkrna-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(inresult.jsonandbatch_metrics.csv) measure batch clustering tightness. A drop indicates batch effect has been reduced; absolute values depend on how separable the batches were originally.
Key CLI
python omicsclaw.py run bulkrna-batch-correction --demo
python omicsclaw.py run bulkrna-batch-correction \
--input counts.csv --batch-info batches.csv --output results/
python omicsclaw.py run bulkrna-batch-correction \
--input counts.csv --batch-info batches.csv --output results/ \
--mode non-parametric
See also
references/parameters.md— every CLI flag and tuning hintreferences/methodology.md— parametric vs non-parametric ComBat, R↔Python differences, design-confound caveatsreferences/output_contract.md— exact output directory layout- Adjacent skills:
bulkrna-qc(run upstream to spot batch effects),bulkrna-coexpression/bulkrna-survival(downstream — corrected matrix safe for these),bulkrna-de(NOT downstream-safe — DE always wants raw counts),sc-batch-integration(single-cell sibling: Harmony/scVI/etc.)
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- bulkrna_batch_correction.py
- references/methodology.md
- references/output_contract.md
- references/parameters.md
- skill.yaml
FAQ
Что делает скилл bulkrna-batch-correction?
Load when removing batch effects from a multi-cohort bulk RNA-seq dataset using ComBat (R or Python implementation). Skip when there is only one batch; single-cell batch integration (use sc-batch-integration); spatial multi-slice integration (use spatial-integrate).
Как установить скилл bulkrna-batch-correction?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл bulkrna-batch-correction запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
theme-factory
AnthropicToolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
access
AnthropicManage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
configure
AnthropicSet up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
access
AnthropicManage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…