Agent skill

Sc Differential Abundance

by TianGzlab in TianGzlab/OmicsClaw

Load when testing whether cell-type / cluster proportions or neighbourhood densities differ between conditions in a multi-sample scRNA AnnData via Milo, scCODA, simple proportion screen, or R…

Apache-2.0Auto-check passedResearch & Science

Install Sc Differential Abundance

skills CLI
$ npx skills add TianGzlab/OmicsClaw --skill sc-differential-abundance -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install TianGzlab/OmicsClaw sc-differential-abundance --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/TianGzlab/OmicsClaw.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/singlecell/scrna/sc-differential-abundance .claude/skills/sc-differential-abundance && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
sc-differential-abundance
GitHub stars
161
Token cost
~2.1k tokens
SKILL.md length
675 words
Files
10 (incl. references)
Skills in repo
88
Repo updated
First seen
Licence
Apache-2.0

At a glance

Load when testing whether cell-type / cluster proportions or neighbourhood densities differ between conditions in a multi-sample scRNA AnnData via Milo, scCODA, simple proportion screen, or R…

  • Works in 6 steps: Load AnnData; validate --method, --fdr,… → Run preflight on --condition-key,… → Build the universal composition summary… → …
  • Tasks that involve Bioinformatics
  • SKILL.md covers When to use, Use in an analysis step, Inputs & Outputs and Flow, plus 5 more sections
  • Runs Python scripts from its folder; calls python

What it does

Sc Differential Abundance is an agent skill from TianGzlab/OmicsClaw. Load when testing whether cell-type / cluster proportions or neighbourhood densities differ between conditions in a multi-sample scRNA AnnData via Milo, scCODA, simple proportion screen, or R Monte-Carlo permutation. Skip when ranking marker genes (use sc-markers); per-cell DE (use sc-de).

Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 12 other files, including reference files (for example `_api.py`, `examples/example_step.py` and `references/methodology.md`).

It sits in Research & Science, covering Bioinformatics and DataFrames. It works with AnnData. The repository describes itself as: Conversational & memory-enabled AI research partner for multi-omics analysis. CLI + Desktop App (installers in Releases). From biological idea to full research paper. The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Bioinformatics
  • Tasks that involve DataFrames

Example prompts

  • “/sc-differential-abundance”

Requirements

  • Python 3

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Load AnnData; validate --method, --fdr, --n-neighbors, --prop, --n-permutations.
  2. Run preflight on --condition-key, --sample-key, --cell-type-key — fail fast on missing columns or under-replication.
  3. Build the universal composition summary (counts / proportions / condition means) and save them.
  4. Dispatch to the method-specific runner (run_milo_da / run_sccoda_da / simple proportion test / R proportion test).
  5. Append method-specific summary fields to result.json (n_nhoods / n_effect_rows / n_cell_types / n_significant, plus backend for…
  6. Save figures, report.md, result.json.

What it can do on your machine

Read from SKILL.md and the folder at commit 90a3bec. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Sc Differential Abundance loads about 2.1k tokens when it runs, and up to ~3.3k if it reads all its reference files. Until then it costs about 79 tokens; SKILL.md has 675 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~79
When it runs · the whole SKILL.md, loaded when a task matches
~2.1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from TianGzlab/OmicsClaw at commit 90a3bec, republished under its Apache-2.0 licence (© TianGzlab). 675 words, ~2,067 tokens.

Download SKILL.mdSave it as .claude/skills/sc-differential-abundance/SKILL.md (or your agent's skills folder). This skill also uses 9 other files; get the full folder from GitHub.
name
sc-differential-abundance
description
Load when testing whether cell-type / cluster proportions or neighbourhood densities differ between conditions in a multi-sample scRNA AnnData via Milo, scCODA, simple proportion screen, or R Monte-Carlo permutation. Skip when ranking marker genes (use sc-markers); per-cell DE (use sc-de).
tags
singlecell, scrna, differential-abundance, compositional, milo, sccoda, proportion-test

sc-differential-abundance

When to use

The user has a multi-sample, multi-condition scRNA AnnData and asks "Did the relative abundance of these cell states change between conditions?" — distinct from per-cell DE. Four methods:

  • milo (default) — neighbourhood-level DA, replicate-aware (pertpy).
  • sccoda — Bayesian compositional analysis with a reference cell type (pertpy).
  • simple — exploratory proportion screen, no pertpy needed.
  • proportion_test_r — base-R Monte-Carlo permutation; lollipop plots with bootstrap 95% CI.

For per-cell expression changes between conditions, use sc-de. For ranking what defines a cluster, use sc-markers.

Use in an analysis step

Use load_skill from the notebook SDK; write returned objects with write_output. This runnable example is also in examples/example_step.py. The CLI remains available for standalone reports and galleries.

python
# Recover a threefold change in a synthetic cell type using independent samples.
# Reads multisample_synthetic: four control and four treated samples.
# Calls sc-differential-abundance: test_abundance, composition, proportion_figure.

from skills._sdk.notebook import load_demo, load_skill, write_output

abundance = load_skill('sc-differential-abundance')
adata = load_demo('multisample_synthetic')

table = abundance.test_abundance(adata, method='simple')
counts, proportions = abundance.composition(adata, sample_key='sample',
    condition_key='condition', celltype_key='cell_type')
write_output(table, 'tables/abundance.csv')
write_output(counts, 'tables/sample_counts.csv')
write_output(abundance.proportion_figure(proportions), 'figures/sample_proportions.png')

enriched = table.set_index('cell_type').loc['Enriched']
assert enriched['significant']
assert enriched['log2fc_group_b_over_a'] > 1
assert counts.shape == (8, 3)

Inputs & Outputs

Input is an AnnData with sample, condition and cell-type columns. Each sample must have one condition. The Python API returns composition tables or a method-specific result DataFrame; it does not change the input.

The CLI writes processed.h5ad, annotated_input.h5ad, report.md, result.json, and these common tables: sample_by_celltype_counts.csv, sample_by_celltype_proportions.csv, condition_mean_proportions.csv. The selected method adds simple_da_results.csv, milo_nhood_results.csv, sccoda_effects.csv, or a nonempty proportion_test_results.csv. Figures depend on the method and available results. R exchange files are temporary.

Flow

  1. Load AnnData; validate --method, --fdr, --n-neighbors, --prop, --n-permutations.
  2. Run preflight on --condition-key, --sample-key, --cell-type-key — fail fast on missing columns or under-replication.
  3. Build the universal composition summary (counts / proportions / condition means) and save them.
  4. Dispatch to the method-specific runner (run_milo_da / run_sccoda_da / simple proportion test / R proportion test).
  5. Append method-specific summary fields to result.json (n_nhoods / n_effect_rows / n_cell_types / n_significant, plus backend for milo/sccoda).
  6. Save figures, report.md, result.json.

Gotchas

  • run_info(table)["executed_method"] distinguishes pertpy Milo from the internal milo_like fallback. The fallback reason includes the failed import; it is not the same method as official Milo.
  • The CLI demo has only two samples per condition. Its simple/Milo-like Mann-Whitney tests cannot reach p < 0.05. The step uses multisample_synthetic, with four samples per condition and a known enriched cell type.
  • proportion_test_r permutes cell labels, ignoring sample identity, and uses the existing R seed 42. It requires R; failures propagate from test_abundance rather than being reported as empty successful output.
  • --min-count is accepted by the CLI but has no effect. The API does not expose that unused option.
  • run_info(table) records seeds. random_state controls pertpy and newly computed neighbors; standalone scCODA retains its sampler defaults and reports no effective seed.
  • CLI preflight exits on missing metadata or insufficient replication. The API raises ValueError for missing values or a sample assigned to multiple conditions; composition and condition_proportions use sample-level denominators.

Key CLI

bash
# Demo (built-in synthetic 2-condition × 4-sample data)
python skills/singlecell/scrna/sc-differential-abundance/sc_differential_abundance.py --demo \
  --method milo --output /tmp/sc_da_demo

# Milo (replicate-aware neighbourhood DA)
python skills/singlecell/scrna/sc-differential-abundance/sc_differential_abundance.py \
  --input integrated.h5ad --output results/ \
  --method milo --condition-key treatment --sample-key donor

# scCODA Bayesian compositional analysis
python skills/singlecell/scrna/sc-differential-abundance/sc_differential_abundance.py \
  --input integrated.h5ad --output results/ \
  --method sccoda --reference-cell-type "B cell" \
  --condition-key treatment --sample-key donor --cell-type-key cell_type

# Lightweight proportion screen (no pertpy)
python skills/singlecell/scrna/sc-differential-abundance/sc_differential_abundance.py \
  --input integrated.h5ad --output results/ --method simple
Show full SKILL.md (274 more words)Show less

See also

  • references/parameters.md — every CLI flag, per-method tunables
  • references/methodology.md — when each method wins; pertpy install notes
  • references/output_contract.md — result.json keys per method, table column schemas
  • Adjacent skills: sc-cell-annotation / sc-clustering (upstream — produce the cell-type column), sc-de (parallel — per-cell expression DE between conditions, NOT abundance), sc-markers (parallel — within-sample cluster marker ranking, NOT cross-condition)

Dependencies

Python packages this skill's script needs. They are not installed for you — check before a long run.

anndata, matplotlib, numpy, pandas, pertpy, scanpy, sccoda, scipy, seaborn, statsmodels

API

<!-- api:begin generated from _api.py; regenerate with run.py api <skill dir> --write -->
composition(adata, *, sample_key: str, celltype_key: str, condition_key: str)

Return sample-by-cell-type counts and row-normalized proportions.

Each sample must belong to one condition. No cells or counts are changed.

condition_proportions(adata, *, sample_key: str, celltype_key: str, condition_key: str) -> pd.DataFrame

Return condition means of per-sample proportions, weighting samples equally.

test_abundance(adata, *, method: str='milo', sample_key: str='sample', condition_key: str='condition', celltype_key: str='cell_type', contrast: str | None=None, reference_cell_type: str='automatic', fdr: float=0.05, prop: float=0.1, n_neighbors: int=30, n_permutations: int=1000, random_state: int=0) -> pd.DataFrame

Return differential-abundance results without changing adata.

simple tests sample proportions with two-sided Mann-Whitney and BH. milo uses pertpy, or the existing milo_like neighborhood screen when its import fails; run_info names the executed backend and reason. scCODA uses pertpy or the installed standalone sccoda backend. random_state controls pertpy and newly computed neighbors; standalone sccoda retains its sampler defaults. proportion_test_r uses the existing fixed R seed 42 and permutes cells, ignoring sample identity; its failures propagate instead of returning an empty success result. This function does not apply a minimum-count filter.

proportion_figure(proportions: pd.DataFrame)

Return a sample-by-cell-type proportion heatmap without writing files.

run_info(table: pd.DataFrame, *, keep: bool=True) -> dict

Return backend and seed diagnostics; keep=False removes the table's run record.

<!-- api:end -->

© TianGzlab, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 9 other files (references) in skills/singlecell/scrna/sc-differential-abundance of TianGzlab/OmicsClaw.

  • SKILL.md
  • _api.py
  • examples/example_step.py
  • references/methodology.md
  • references/output_contract.md
  • references/parameters.md
  • references/r_visualization.md
  • sc_differential_abundance.py
  • tests/test_abundance_api.py
  • tests/test_sc_differential_abundance_methods.py

Open the folder on GitHubat commit 90a3bec

Compare with similar skills

Sc Differential Abundance next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Sc Differential Abundance compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Sc Differential Abundance this skillTianGzlab/OmicsClaw161—~2.1kAutomated safety check: PassApache-2.0
Lamindb Data Managementjaechang-hits/SciAgent-Skills3742 repos~4kAutomated safety check: PassApache-2.0
Bio Expression Matrix Sparse HandlingGPTomics/bioSkills1.2k1 repos~5.6kAutomated safety check: PassMIT
Scanpy Single-Cell Analysisdavila7/claude-code-templates33k15 repos~2.8kAutomated safety check: PassMIT
PyDESeq2 Differential Expressiondavila7/claude-code-templates33k11 repos~4kAutomated safety check: PassMIT
Single-Cell Initial AnalysisLigphiDonk/Oh-my--paper7391 repos~1.4kAutomated safety check: PassMIT

Similar skills

  • Lamindb Data Management

    jaechang-hits/SciAgent-Skills

    Open-source FAIR biology data framework. An agent skill from jaechang-hits/SciAgent-Skills.

    374 GitHub starsUsed in 2 repos~4k tokens
    Research & ScienceAuto-check passed
  • Stores and operates on sparse expression matrices for single-cell and large bulk RNA-seq, covering dgCMatrix/dgRMatrix/dgTMatrix when-each-is-fast, the dgCMatrix (CSC, R) <- CSR (Python) implicit…

    1.2k GitHub starsUsed in 1 repo~5.6k tokens
    Research & ScienceAuto-check passed
  • Scanpy Single-Cell Analysis

    davila7/claude-code-templates

    Walks through single-cell RNA-seq analysis with Scanpy: loading .h5ad and 10X data, QC, normalization, PCA and UMAP, Leiden clustering, marker genes and cell type annotation.

    33k GitHub starsUsed in 15 repos~2.8k tokens
    Research & ScienceAuto-check passed
  • PyDESeq2 Differential Expression

    davila7/claude-code-templates

    Runs differential gene expression analysis on bulk RNA-seq counts with PyDESeq2: design formulas, Wald tests, FDR correction and volcano or MA plots.

    33k GitHub starsUsed in 11 repos~4k tokens
    Research & ScienceAuto-check passed
  • Single-Cell Initial Analysis

    LigphiDonk/Oh-my--paper

    Runs a seven-step quality-control and exploration pipeline on scRNA-seq, CyTOF or flow cytometry data and writes a plain-language report of what it found.

    739 GitHub starsUsed in 1 repo~1.4k tokens
    Research & ScienceAuto-check passed
  • Arboreto

    K-Dense-AI/scientific-agent-skills

    Infers candidate gene regulatory networks from bulk or single-cell expression data using AertsLab Arboreto GRNBoost2 and GENIE3.

    48k GitHub starsUsed in 1 repo~2.7k tokens
    Research & ScienceAuto-check passed

More from TianGzlab/OmicsClaw

All 88 skills in this repo
  • Bulkrna Cosinor Rhythm

    TianGzlab/OmicsClaw

    Load when the user needs Deterministic fixed-period 24-hour single-component cosinor OLS rhythm analysis for a bulk RNA time-course CSV.

    161 GitHub stars~840 tokensUpdated 3 days ago
    Auto-check passed
  • Bulkrna Batch Correction

    TianGzlab/OmicsClaw

    Load when correcting batch effects in bulk expression using R sva ComBat or the legacy Python parametric approximation.

    161 GitHub stars~1.2k tokensUpdated 3 days ago
    Auto-check passed
  • Bulkrna Coexpression

    TianGzlab/OmicsClaw

    Load when discovering bulk gene co-expression modules and hub genes with R WGCNA.

    161 GitHub stars~1.3k tokensUpdated 3 days ago
    Auto-check passed
  • Bulkrna De

    TianGzlab/OmicsClaw

    Load when comparing gene expression between two conditions in bulk RNA-seq count data.

    161 GitHub stars~867 tokensUpdated 3 days ago
    Auto-check passed
  • Bulkrna Deconvolution

    TianGzlab/OmicsClaw

    Load when estimating cell-type proportions in bulk RNA-seq samples from a single-cell or signature-matrix reference.

    161 GitHub stars~757 tokensUpdated 3 days ago
    Auto-check passed
  • Bulkrna Enrichment

    TianGzlab/OmicsClaw

    Load when running pathway / GO term enrichment on a bulk RNA-seq DE result list.

    161 GitHub stars~860 tokensUpdated 3 days ago
    Auto-check passed

Works with

Questions about Sc Differential Abundance

What does Sc Differential Abundance do?

Load when testing whether cell-type / cluster proportions or neighbourhood densities differ between conditions in a multi-sample scRNA AnnData via Milo, scCODA, simple proportion screen, or R…. Sc Differential Abundance is an agent skill from TianGzlab/OmicsClaw. Load when testing whether cell-type / cluster proportions or neighbourhood densities differ between conditions in a multi-sample scRNA AnnData via Milo, scCODA, simple proportion screen, or R Monte-Carlo permutation.

When should I use Sc Differential Abundance?

Sc Differential Abundance fits situations like: tasks that involve Bioinformatics; tasks that involve DataFrames.

How do I install Sc Differential Abundance in Claude Code?

Run `npx skills add TianGzlab/OmicsClaw --skill sc-differential-abundance -a claude-code`. Or copy the skill folder (skills/singlecell/scrna/sc-differential-abundance in TianGzlab/OmicsClaw) into .claude/skills/sc-differential-abundance in your project. Claude Code loads it when a task matches its description.

How do I install Sc Differential Abundance in Codex?

Run `npx skills add TianGzlab/OmicsClaw --skill sc-differential-abundance -a codex`. Or copy the skill folder (skills/singlecell/scrna/sc-differential-abundance in TianGzlab/OmicsClaw) into .agents/skills/sc-differential-abundance in your project. Codex loads it when a task matches its description.

Can I use Sc Differential Abundance in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add TianGzlab/OmicsClaw --skill sc-differential-abundance -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/sc-differential-abundance, .gemini/skills/sc-differential-abundance, .github/skills/sc-differential-abundance and .opencode/skills/sc-differential-abundance in your project.

What does Sc Differential Abundance need to run?

Going by SKILL.md and its folder, Sc Differential Abundance needs Python for the scripts in its folder and the command-line tools its instructions call (python). Our summary lists: Python 3.

Does Sc Differential Abundance access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Sc Differential Abundance safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Sc Differential Abundance use?

Sc Differential Abundance is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Sc Differential Abundance use?

About 2.1k tokens (SKILL.md is roughly 8.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.2k tokens, read only when the agent opens those files.

What are the alternatives to Sc Differential Abundance?

Skills that share tags, products or a category with Sc Differential Abundance: Lamindb Data Management (jaechang-hits/SciAgent-Skills, 374 stars), Bio Expression Matrix Sparse Handling (GPTomics/bioSkills, 1.2k stars), Scanpy Single-Cell Analysis (davila7/claude-code-templates, 33k stars) and PyDESeq2 Differential Expression (davila7/claude-code-templates, 33k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Sc Differential Abundance?

TianGzlab (a GitHub organization) maintains it in TianGzlab/OmicsClaw, which has 161 GitHub stars. The repository holds 88 skills in this directory. The repository was last updated on October 7, 2026.

Source: TianGzlab/OmicsClaw on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.