Back to Skills

bulk-rna-seq-batch-correction-with-combat

Use omicverse's pyComBat wrapper to remove batch effects from merged bulk RNA-seq or microarray cohorts, export corrected matrices, and benchmark pre/post correction visualisations.

834stars98forksUpdated 2/10/2026

Security Assessment

Safe(100/100)
Security Score100/100

About bulk-rna-seq-batch-correction-with-combat

The 'bulk-rna-seq-batch-correction-with-combat' skill addresses the issue of batch effects in bulk RNA-seq or microarray datasets. When combining multiple expression matrices from different batches, it is common for the data to contain systematic variations unrelated to biological differences. This skill uses the pyComBat wrapper from omicverse to perform batch correction, aligning datasets for downstream analysis by removing these unwanted batch effects. By correcting these inconsistencies, it enables users to derive more reliable conclusions from merged datasets across different cohorts.

Main capabilities include the ability to load expression matrices from different batches, concatenate them on shared genes, and then apply ComBat batch correction. The skill generates corrected matrices while retaining the original data for comparison. Users can benchmark the effectiveness of the correction using visualizations such as PCA plots and boxplots before and after the correction. It also provides options to save both corrected and raw data in CSV format and as AnnData objects, allowing easy future access. The process is designed to be flexible, ensuring compatibility with various input formats and datasets.

This skill is particularly useful for bioinformaticians, data analysts, and researchers working with RNA sequencing data. It serves as an essential tool for harmonizing datasets that span multiple experimental conditions or cohorts, such as those found in large-scale genomic studies. Its ease of use and integration with other omicverse functionalities make it suitable for both new users and experienced researchers aiming to improve data quality before performing downstream analyses like differential expression analysis or pathway enrichment analysis.

FAQ

How do I load my data for batch correction?

You can load your data using `pd.read_pickle()` or `pd.read_csv()` to read pickled or CSV matrices. Ensure that the expression matrices are transposed to gene × sample format and stored as AnnData objects with sample metadata in `adata.obs`.

What should I do if the `batch_correction` layer is missing?

Ensure that the column name specified in `batch_key` matches the batch column name in your `adata.obs`. If the names don't match, ComBat may not perform the correction, and the `batch_correction` layer won't be created.

What is the expected input data format for ComBat?

ComBat expects log-transformed intensity values or similarly distributed count data. If your data is strongly skewed, it is recommended to log-transform it before running batch correction.

Can I use this skill for RNA-seq data from different types of experiments?

Yes, this skill works for any bulk RNA-seq or microarray datasets that span different batches or experimental conditions, as long as they are formatted correctly (gene × sample matrices).

What visualizations can I use to benchmark the correction?

You can generate PCA plots and boxplots before and after batch correction to compare the distribution of data. Visualizing the corrected embeddings with these plots can help confirm that the batch effects have been effectively removed.

All Files

2 files
reference.md1.8 KB
View
SKILL.md3.7 KB
View

Install bulk-rna-seq-batch-correction-with-combat

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill