spatial-communication
БесплатноБез исполняемых скриптовНе проверенLoad when computing ligand-receptor cell-cell communication on a preprocessed spatial AnnData with `obs[cell_type_key]` (default `leiden`) via LIANA…
от mdbabumiamssm★ 36 звёзд на GitHubОб этом скилле
spatial-communication
When to use
The user has a preprocessed spatial AnnData with cell-type labels
(obs[cell_type_key], default leiden) and wants ligand-receptor
cell-cell communication scored. Four backends:
liana(default) — LIANA consensus across multiple L-R methods. Tunables--liana-expr-prop,--liana-min-cells,--liana-n-perms.cellphonedb— Permutation test with mean expression statistic. Tunables--cellphonedb-iterations,--cellphonedb-threshold.fastccc— Fast permutation-free percentile-based score. Tunables--fastccc-min-percentile.cellchat_r— CellChat (R) viarpy2interop. Tunables--cellchat-min-cells,--cellchat-prob-type.
Species: --species human (default) or mouse. For non-spatial
L-R use sc-cell-communication; for pathway scoring use
spatial-enrichment.
Inputs & Outputs
| Input | Format | Required |
|---|---|---|
| Preprocessed spatial AnnData | .h5ad with obsm["spatial"], obs[cell_type_key] (default leiden) |
yes (unless --demo) |
| Output | Path | Notes |
|---|---|---|
| Annotated AnnData | processed.h5ad |
uns["ccc_results"] (canonical L-R DataFrame); per-method copy at uns["liana_results"] / uns["cellphonedb_results"] / uns["fastccc_results"] / uns["cellchat_results"]; uns["communication_summary"] (pathway-level); uns["communication_signaling_roles"] (sender/receiver scores); uns["spatial_communication"] (run metadata) |
| L-R interactions | tables/lr_interactions.csv |
full L-R list |
| Top interactions | tables/top_interactions.csv |
top-N filtered |
| Pathway summary | tables/communication_summary.csv |
aggregate per pathway |
| Signaling roles | tables/signaling_roles.csv |
sender/receiver per cell type |
| Source-target | tables/source_target_summary.csv |
per source-target pair counts |
| Run summary | tables/communication_run_summary.csv |
params used |
| Report | report.md + result.json |
always |
Flow
- Load AnnData, validate
obs[cell_type_key]exists with ≥ 2 categories (_lib/communication.py:764-765). - Sync
obsm["spatial"]↔obsm["X_spatial"](spatial_communication.py:79-81); cast cell-type column to Categorical. - Dispatch to chosen backend (LIANA / CellPhoneDB / FastCCC / CellChat-R).
- Write canonical L-R results to
uns["ccc_results"]+ per-methoduns[METHOD_RESULT_KEYS[method]](_lib/communication.py:735-739). - Compute pathway-level summary, signaling roles, source-target summary.
- Save tables +
processed.h5ad+ report.
Gotchas
obs[cell_type_key]is REQUIRED — no auto-fallback._lib/communication.py:764-765raisesValueErrorwhen the column is missing. Runspatial-annotateorspatial-domainsfirst.- Default cell-type column is
leiden, notcell_type.spatial_communication.py:1065defaults--cell-type-keyto"leiden". If your AnnData usescell_type, pass--cell-type-key cell_typeexplicitly. - CellChat backend needs an R install with CellChat.
--method cellchat_rinvokes R viarpy2. Install CellChat in your R environment first; missing R / rpy2 / CellChat surfaces as a runtime error inside the dispatch step (not atparser.error), so the failure happens after argument parsing succeeds. - FastCCC
--fastccc-min-percentilemust be in [0, 1].spatial_communication.py:985rejects values outside that range withparser.error. - Output
unskeys are unconditionally written, even with 0 interactions._lib/communication.py:735-739writes emptyuns["ccc_results"]/uns["communication_summary"]if no L-R pairs pass thresholds — distinguish "no signal" from "method failed" by inspectingtables/communication_run_summary.csv. - Per-method copy uses
METHOD_RESULT_KEYSmapping._lib/communication.py:68-73mapsliana → uns["liana_results"],cellphonedb → uns["cellphonedb_results"],fastccc → uns["fastccc_results"],cellchat_r → uns["cellchat_results"]. Downstream readers should preferuns["ccc_results"]for portability.
Key CLI
# Demo
python omicsclaw.py run spatial-communication --demo --output /tmp/comm_demo
# LIANA consensus (default)
python omicsclaw.py run spatial-communication \
--input preprocessed.h5ad --output results/ \
--method liana --species human --cell-type-key cell_type \
--liana-expr-prop 0.1 --liana-min-cells 5 --liana-n-perms 1000
# CellPhoneDB permutation test
python omicsclaw.py run spatial-communication \
--input preprocessed.h5ad --output results/ \
--method cellphonedb --cellphonedb-iterations 1000 --cellphonedb-threshold 0.1
# CellChat (R via rpy2)
python omicsclaw.py run spatial-communication \
--input preprocessed.h5ad --output results/ \
--method cellchat_r --species mouse \
--cellchat-min-cells 10 --cellchat-prob-type triMean
See also
references/parameters.md— every CLI flag, per-method tunablesreferences/methodology.md— when each backend winsreferences/output_contract.md—
Установить spatial-communication в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл spatial-communication?
Load when computing ligand-receptor cell-cell communication on a preprocessed spatial AnnData with `obs[cell_type_key]` (default `leiden`) via LIANA (default), CellPhoneDB, FastCCC, or CellChat (R). Skip when running scRNA-only L-R inference (use `sc-cell-communication`) or when no cell-type labels exist (run `spatial-annotate` or `spatial-domains` first).
Как установить скилл spatial-communication?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл spatial-communication запускает скрипты?
Нет, скилл состоит только из инструкций (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