bulkrna-batch-correcti…
Load when correcting batch effects in bulk expression using R sva ComBat or the legacy Python parametric approximation. Skip…
Load when ranking spatial cluster markers or comparing two spatial groups. Skip when the data is single-cell (use sc-de), bulk (use bulkrna-de), or for spatially variable expression (use spatial-genes).
$ npx -y skills add tiangzlab/omicsclaw --skill spatial-de --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/spatial-deContext preview
The summary Claude sees to decide when to auto-load this skill.
Load when ranking spatial cluster markers or comparing two spatial groups. Skip when the data is single-cell (use sc-de), bulk (use bulkrna-de), or for spatially variable expression (use spatial-genes).
name: spatial-de description: Load when ranking spatial cluster markers or comparing two spatial groups. Skip when the data is single-cell (use sc-de), bulk (use bulkrna-de), or for spatially variable expression (use spatial-genes). trigger: differential expression, marker gene, pseudobulk, Wilcoxon, t-test, PyDESeq2, spatial DE tags: - spatial - differential-expression - markers - wilcoxon - t-test - pydeseq2 - pseudobulk
Rank spatial group markers with Wilcoxon or t-test, or compare conditions with sample-aware PyDESeq2 pseudobulk. Biological sample labels are required; spatial spots do not supply independent replicates.
from skills._sdk.notebook import load_skill, read_input, write_output
library = load_skill("spatial-de")
adata = read_input("processed.h5ad")
library.differential_expression(adata, groupby="leiden")
write_output(library.results(adata), "tables/de_full.csv")The executable example checks known markers in simulated spatial domains.
<!-- api:begin generated from _api.py; regenerate with run.py api <skill dir> --write -->
Test groups and return the same AnnData, with results in its diagnostics.
Scanpy uses raw when present, otherwise log-normalized X. PyDESeq2 uses counts, then raw, then X; provide integer counts and biological samples.
:param adata: Expression and group labels; modified in place. :param method: CLI default wilcoxon; t-test or pydeseq2 for other tests. :param groupby: CLI default leiden; obs column defining comparisons. :param group1: Tested group, or None for each group versus rest. :param group2: Reference group; supply together with group1. :param n_top_genes: CLI default 10 marker genes per group. :param fdr_threshold: CLI default 0.05 adjusted-p-value threshold. :param log2fc_threshold: CLI default 1.0 effect-size threshold. :param parameters: Method-specific CLI parameters from references/parameters.md. :returns: The same AnnData; results returns the full result table. :raises ValueError: Groups, method or sample replication are invalid. :raises ImportError: PyDESeq2 is unavailable; use install_skill_deps.
Return the full or selected marker table without changing expression.
:param adata: AnnData returned by differential_expression. :param markers_only: Default False; True selects the reported top markers. :returns: A new DataFrame with method-native effect and significance columns. :raises ValueError: No differential expression run is recorded.
Read diagnostics and the result tables from the most recent run.
:param adata: AnnData returned by differential_expression. :param keep: Default True; False removes diagnostics before CLI serialization. :returns: Diagnostic dictionary including full_df and markers_df. :raises ValueError: No differential expression run is recorded.
Plot effect size against adjusted significance for one comparison.
:param adata: AnnData returned by differential_expression. :param group: Tested group; None chooses the first reported group. :returns: A matplotlib Figure; no files are written. :raises ValueError: No results exist for the selected group.
<!-- api:end -->
Scanpy ranks every gene, then optionally filters markers. PyDESeq2 requires both group labels and two retained pseudobulk profiles per condition. It uses a paired design when two biological samples contribute to both groups. See [parameters](references/parameters.md) for keyword arguments and [methodology](references/methodology.md) for matrix and design details.
otherwise provide log-normalized X. Count methods prefer `layers['counts']`.
genes pass all filters; inspect the significance columns.
Functions modify AnnData in place and return DataFrames/Figures without writing files. The CLI writes `processed.h5ad`, `tables/de_full.csv`, marker/diagnostic tables, report and result JSON. The [output contract](references/output_contract.md) lists conditional figures.
python skills/spatial/spatial-de/spatial_de.py --input processed.h5ad --output results/de python skills/spatial/spatial-de/spatial_de.py --demo --output /tmp/spatial-de_demo
Use spatial-preprocess before analysis, spatial-genes for autocorrelation, and sc-de or bulkrna-de for their respective modalities.
`anndata`, `matplotlib`, `numpy`, `pandas`, `pydeseq2`, `scanpy`, `scipy`, `seaborn`
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 correcting batch effects in bulk expression using R sva ComBat or the legacy Python parametric approximation. Skip…
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…