bulkrna-coexpression
Load when discovering bulk gene co-expression modules and hub genes with R WGCNA. Skip direct expression contrasts (use…
Load when correcting batch effects in bulk expression using R sva ComBat or the legacy Python parametric approximation. Skip single-batch inputs; use sc-batch-integration for single-cell data or spatial-integrate for spatial slices.
$ npx -y skills add tiangzlab/omicsclaw --skill bulkrna-batch-correction --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/bulkrna-batch-correctionContext preview
The summary Claude sees to decide when to auto-load this skill.
Load when correcting batch effects in bulk expression using R sva ComBat or the legacy Python parametric approximation. Skip single-batch inputs; use sc-batch-integration for single-cell data or spatial-integrate for spatial slices.
name: bulkrna-batch-correction description: Load when correcting batch effects in bulk expression using R sva ComBat or the legacy Python parametric approximation. Skip single-batch inputs; use sc-batch-integration for single-cell data or spatial-integrate for spatial slices. trigger: batch correction, ComBat, batch effect, harmonize, multi-cohort, batch removal tags: - bulkrna - batch-correction - ComBat - harmonization - batch-effect
Load when correcting batch effects in bulk expression using R sva ComBat or the legacy Python parametric approximation. Skip single-batch inputs; use sc-batch-integration for single-cell data or spatial-integrate for spatial slices.
from skills._sdk.notebook import load_skill, write_output
library = load_skill("bulkrna-batch-correction")
result = library.correct(data, batches=batches, backend="python")
write_output(result, "tables/result.csv")
write_output(library.pca_figure(result, batches=batches), "figures/result.png")Read expression and metadata with `read_input` before calling the library. `examples/example_step.py` constructs a small synthetic dataset and checks its results through the step runner and fresh-kernel replay.
<!-- api:begin generated from _api.py; regenerate with run.py api <skill dir> --write -->
Return corrected expression, leaving the input unchanged.
:param data: Finite nonnegative expression, features by samples; correction uses this scale directly. :param batches: Metadata with sample and batch columns, and optional biological condition. :param mode: CLI default parametric, or non-parametric (requires R sva). :param backend: auto prefers R as the CLI did; r requires R, python uses the legacy parametric approximation. :returns: Corrected DataFrame with run_info diagnostics; values can be negative. :raises ValueError: Data, metadata, mode or backend is invalid. :raises ImportError: An explicitly requested R backend is unavailable. :raises RuntimeError: R fails and the requested mode/design has no Python fallback.
Return backend diagnostics and before/after batch metrics.
:param data: Result of correct. :param keep: Keep diagnostics by default; the CLI passes False. :returns: Diagnostics dictionary. :raises ValueError: No correction diagnostics are attached.
Plot PCA after signed log2(1+abs(x)), accepting negative corrections.
:param data: Original or corrected feature-by-sample expression. :param batches: Metadata containing sample and batch. :returns: Matplotlib Figure. :raises ValueError: Samples lack batch metadata.
<!-- api:end -->
The function library returns DataFrames and Figures. The CLI loads the same library and owns reports and file writes. R runs in a temporary directory using Matrix Market, feature/sample identifiers and metadata. No R intermediate is a permanent CLI output.
Expression CSV with feature identifiers in the first column; metadata CSV with sample and batch, plus optional condition.
CLI outputs:
python skills/bulkrna/bulkrna-batch-correction/bulkrna_batch_correction.py --demo --output /tmp/bulkrna_batch_correction_demo
Run the script with `--help` for real-input arguments.
`matplotlib`, `numpy`, `pandas`, `scipy`, `sva`, `Matrix`
Conversational & memory-enabled AI research partner for multi-omics analysis. CLI + Desktop App (installers in Releases). From biological idea to full research paper.
Load when discovering bulk gene co-expression modules and hub genes with R WGCNA. Skip direct expression contrasts (use…
Load when comparing gene expression between two conditions in bulk RNA-seq count data. Skip
Load when estimating cell-type proportions in bulk RNA-seq samples from a single-cell or
Load when running pathway / GO term enrichment on a bulk RNA-seq DE result list. Skip when
Load when converting Ensembl, Entrez or symbol IDs in a bulk RNA count matrix using an explicit mapping or a small human demo…
Load when querying STRING for the protein-protein interaction neighborhood of a bulk