spatial-velocity
БесплатноБез исполняемых скриптовНе проверенLoad when estimating RNA velocity on a spatial AnnData with `layers["spliced"]` + `layers["unspliced"]` via scVelo (stochastic / deterministic / dynamical) or…
от mdbabumiamssm★ 36 звёзд на GitHubОб этом скилле
spatial-velocity
When to use
The user has a spatial AnnData with layers["spliced"] and
layers["unspliced"] populated upstream (velocyto / kb-python /
STARsolo) and wants RNA velocity estimated, with PAGA + cluster
summaries and stream / phase / spatial plots. Four backends:
stochastic(default scVelo) — moment-based, fast.deterministic(scVelo) — least-squares fit, no stochastic correction.dynamical(scVelo) — full latent-time inference viarecover_dynamics. Slow on > 5K cells; use--dynamical-n-jobs.velovi— deep generative model with latent time. Tunables--velovi-n-hidden,--velovi-n-latent,--velovi-n-layers.
Cluster column defaults to leiden (--cluster-key). For
trajectory inference without spliced layers use spatial-trajectory.
Inputs & Outputs
| Input | Format | Required |
|---|---|---|
| Spatial AnnData with spliced/unspliced layers | .h5ad with layers["spliced"], layers["unspliced"], obsm["spatial"], obs[cluster_key] (default leiden) |
yes (unless --demo) |
| Output | Path | Notes |
|---|---|---|
| Annotated AnnData | processed.h5ad |
layers["velocity"] (every method); layers["latent_time_velovi"] + layers["fit_t"] (velovi only); obs["velocity_speed"], obs["latent_time"] (velovi); var["fit_scaling"], var["velocity_genes"], var["fit_t_"] (dynamical) |
| Cell-level metrics | tables/cell_velocity_metrics.csv |
per-cell speed / coherence |
| Gene-level summary | tables/gene_velocity_summary.csv |
per-gene fit stats |
| Velocity-gene hits | tables/velocity_gene_hits.csv |
gene filter (R² + likelihood) |
| Cluster summary | tables/velocity_cluster_summary.csv |
per-cluster mean speed |
| Top cells / genes | tables/top_velocity_cells.csv, tables/top_velocity_genes.csv |
ranked summaries |
| Report | report.md + result.json |
always |
Flow
- Load AnnData; verify
layers["spliced"]+layers["unspliced"](_lib/velocity.py:93-100raisesValueErrorif missing). For--demo,add_demo_velocity_layerssynthesises them (spatial_velocity.py:1556). - Common preprocessing:
velocity_min_shared_countsfilter → HVG cap → PCA → neighbours → moments. - For scVelo (
stochastic/deterministic/dynamical): compute velocity, velocity graph;dynamicalrunsrecover_dynamicsfirst. - For
velovi: train deep generative model; write per-cellobs["latent_time"](_lib/velocity.py:551) andobs["velocity_speed"](_lib/velocity.py:215). - Compute PAGA + cluster-mean speed; render stream / phase / heatmap / spatial / PAGA plots.
- Save tables +
processed.h5ad+ report.
Gotchas
layers["spliced"]+layers["unspliced"]REQUIRED._lib/velocity.py:93-100raisesValueErrorif either is missing — there is no auto-fallback. Real data needs upstream velocyto / kb-python / STARsolo.--demosynthesises layers viaadd_demo_velocity_layers(_lib/velocity.py:106-121); demo-synthetic velocities are for CI only, NOT biological inference.dynamicalis much slower thanstochastic.recover_dynamicsis per-gene NB optimisation; expect minutes-to-hours on > 5K cells. Use--dynamical-n-jobs Nand consider--dynamical-n-top-genesto cap the fit set.- velovi writes its own latent time, NOT scVelo's. Inside the velovi branch (
_lib/velocity.py:468-571),:548-551writeslayers["velocity"],layers["latent_time_velovi"],layers["fit_t"], andobs["latent_time"](per-cell mean oflayers["latent_time_velovi"]);:567writesvar["fit_t_"](velovi switch-time). The scVelodynamicalpath runsscv.tl.recover_dynamics(_lib/velocity.py:384) — it writes scVelo's ownvar["fit_*"]family via the library, but does NOT writelayers["latent_time_velovi"]orobs["latent_time"]. obs["velocity_speed"]is computed for every method._lib/velocity.py:207(cluster-mean variant) and_lib/velocity.py:215always populate it — scVelo computes from velocity graph; velovi from latent-time gradient.- Cluster key default is
leiden.spatial_velocity.py:1569defaults--cluster-keyto"leiden". If your annotation column is named differently, pass--cluster-key cell_typeor PAGA / cluster summaries will mis-bin. var["velocity_genes"]semantics differ per backend. Velovi sets it unconditionally toTruefor every gene (_lib/velocity.py:553). scVelo (stochastic/deterministic/dynamical) populates it as a real boolean filter insidescv.tl.velocity(_lib/velocity.py:395) usingmin_r2+min_likelihood. Always cross-check againsttables/velocity_gene_hits.csv(the canonical filtered hit list) before readingvar["velocity_genes"].
Key CLI
# Demo (synthetic spliced/unspliced)
python omicsclaw.py run spatial-velocity --demo --output /tmp/velo_demo
# scVelo stochastic (default)
python omicsclaw.py run spatial-velocity \
--input data_with_spliced.h5ad --output results/ \
--method stochastic --cluster-key leiden
Установить spatial-velocity в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл spatial-velocity?
Load when estimating RNA velocity on a spatial AnnData with `layers["spliced"]` + `layers["unspliced"]` via scVelo (stochastic / deterministic / dynamical) or veloVI (deep generative). Skip when input lacks the spliced/unspliced layers (must be quantified upstream by velocyto / kb-python / STARsolo) or for non-spatial scRNA velocity (use `sc-velocity`).
Как установить скилл spatial-velocity?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл spatial-velocity запускает скрипты?
Нет, скилл состоит только из инструкций (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