sc-differential-abundance
БесплатноБез исполняемых скриптовНе проверенLoad when testing whether cell-type / cluster proportions or neighbourhood densities differ between conditions in a multi-sample scRNA AnnData via Milo…
от mdbabumiamssm★ 36 звёзд на GitHubОб этом скилле
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.
Inputs & Outputs
| Input | Format | Required |
|---|---|---|
| AnnData with sample + condition + cell-type columns | .h5ad |
yes (unless --demo) |
| Output | Path | Notes |
|---|---|---|
| AnnData (preserved) | processed.h5ad |
unchanged unless milo writes neighbour graph |
| Counts matrix | tables/sample_by_celltype_counts.csv |
always |
| Proportions matrix | tables/sample_by_celltype_proportions.csv |
always |
| Mean-by-condition | tables/condition_mean_proportions.csv |
always |
simple results |
tables/simple_da_results.csv |
when method == simple |
milo neighbourhood results |
tables/milo_nhood_results.csv + figures/milo_logfc_barplot.png |
when method == milo |
proportion_test_r results |
tables/proportion_test_results.csv + per-comparison lollipops |
when method == proportion_test_r |
sccoda effects |
tables/sccoda_effects.csv |
when method == sccoda |
| Composition heatmap | figures/sample_celltype_proportions.png |
always |
| Report | report.md + result.json |
always |
Flow
- Load AnnData; validate
--method,--fdr,--n-neighbors,--prop,--n-permutations. - Run preflight on
--condition-key,--sample-key,--cell-type-key— fail fast on missing columns or under-replication. - Build the universal composition summary (counts / proportions / condition means) and save them.
- Dispatch to the method-specific runner (
run_milo_da/run_sccoda_da/ simple proportion test / R proportion test). - Append method-specific summary fields to
result.json(n_nhoods/n_effect_rows/n_cell_types/n_significant, plusbackendfor milo/sccoda). - Save figures,
report.md,result.json.
Gotchas
- Preflight failure raises
SystemExit(1), notValueError.sc_differential_abundance.py:601prints the missing-column / under-replication problems and exits the process. Common cases:condition/sample/cell_typecolumns missing, or<2samples per condition formilo/sccoda. Pass the actual obs column names (--sample-key donor,--cell-type-key annotation). --inputmissing without--demoraisesSystemExit, notValueError.sc_differential_abundance.py:580doesraise SystemExit("Provide --input or use --demo"). Wrappers expecting standardValueErrorneed to catchSystemExithere.milo/sccodaneed pertpy installed. Both methods route throughrun_milo_da/run_sccoda_dainskills/singlecell/_lib/differential_abundance.py; the pertpy import is lazy and surfaces asImportErrorat call time when pertpy is absent.simpleandproportion_test_rrun without pertpy.proportion_test_rrequires a working R install but no pertpy.sc_differential_abundance.py:383raisesFileNotFoundError(f"R script not found: {r_script}")if the bundled R helper is missing from the install — typically when the package was installed without the R extra.result.jsoncount keys are additive per method, not exclusive. All four methods writeresult.json["n_cell_types"](set at the universal summary initialiser,sc_differential_abundance.py:636);miloadditionally writesn_nhoods(:695),sccodaadditionally writesn_effect_rows(:754),proportion_test_roverwritesn_cell_typesfrom itsclusterscolumn (:429). Downstream tools that just need "how many things were tested" can readn_cell_typesuniversally.--reference-cell-typeissccoda-only. Other methods ignore the value silently. Default"automatic"lets scCODA pick.
Key CLI
# Demo (built-in synthetic 2-condition × 4-sample data)
python omicsclaw.py run sc-differential-abundance --demo \
--method milo --output /tmp/sc_da_demo
# Milo (replicate-aware neighbourhood DA)
python omicsclaw.py run sc-differential-abundance \
--input integrated.h5ad --output results/ \
--method milo --condition-key treatment --sample-key donor
# scCODA Bayesian compositional analysis
python omicsclaw.py run sc-differential-abundance \
--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 omicsclaw.py run sc-differential-abundance \
--input integrated.h5ad
Установить sc-differential-abundance в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл sc-differential-abundance?
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) or for per-cell DE (use sc-de).
Как установить скилл sc-differential-abundance?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл sc-differential-abundance запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set 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…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic