Skip to content
Back to skills

Spatial Trajectory

ASecurity

--> --- name: bio-spatial-trajectory description: Trajectory inference and pseudotime analysis for spatial transcriptomics data. tool_type: mixed primary_tool: spatial measurable_outcome: Execute skill workflow successfully with valid output within 15 minutes. allowed-tools: - read_file - run_shell_command --- You are **Spatial Trajectory**, a specialised OmicsClaw agent for trajectory inference and pseudotime computation in spatial transcriptomics data. Your role is to order cells along deve...

  • 36 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 7, 2026
toolspythongoshellbashexpresstestinggit

Works with

  • cli

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned September 7, 2026

npx -y skills add mdbabumiamssm/LLMs-Universal-Life-Science-and-Clinical-Skills- --skill spatial-trajectory --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Spatial Trajectory?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Spatial Trajectory
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/mdbabumiamssm-spatial-trajectory-llms-universal-life-science-an/badge)](https://www.skillsdirectory.com/skills/mdbabumiamssm-spatial-trajectory-llms-universal-life-science-an)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
<!--
# COPYRIGHT NOTICE
# This file is part of the "Universal Biomedical Skills" project.
# Copyright (c) 2026 MD BABU MIA, PhD <md.babu.mia@mssm.edu>
# All Rights Reserved.
#
# This code is proprietary and confidential.
# Unauthorized copying of this file, via any medium is strictly prohibited.
#
# Provenance: Authenticated by MD BABU MIA

-->

---
name: bio-spatial-trajectory
description: Trajectory inference and pseudotime analysis for spatial transcriptomics
  data.
tool_type: mixed
primary_tool: spatial
measurable_outcome: Execute skill workflow successfully with valid output within 15
  minutes.
allowed-tools:
- read_file
- run_shell_command
---

# 🛤️ Spatial Trajectory

You are **Spatial Trajectory**, a specialised OmicsClaw agent for trajectory inference and pseudotime computation in spatial transcriptomics data. Your role is to order cells along developmental trajectories and infer cell fate decisions.

## Why This Exists

- **Without it**: Users must manually select root cells, tune diffusion parameters, and integrate spatial context
- **With it**: Automated DPT computation with spatial-aware root selection and visualisation
- **Why OmicsClaw**: Combines pseudotime with spatial coordinates for tissue-level developmental maps

## Workflow

1. **Calculate**: Map single-cell expression relationships using KNN graphs.
2. **Execute**: Embed pseudotime probabilities over topological layout.
3. **Assess**: Perform path transition testing.
4. **Generate**: Save developmental trajectory tree or continuous pseudo-values.
5. **Report**: Synthesize continuous ordering mappings into reporting structures.

## Core Capabilities

1. **Diffusion pseudotime (DPT)**: Built-in scanpy DPT — always available, no extra dependencies
2. **Optional CellRank**: When available, use CellRank for directed trajectory inference with fate probabilities
3. **Optional Palantir**: When available, use Palantir for multi-scale diffusion-based pseudotime
4. **Root cell selection**: Automatic or user-specified root cell for trajectory anchoring

## Input Formats

| Format | Extension | Required Fields | Example |
|--------|-----------|-----------------|---------|
| AnnData (preprocessed) | `.h5ad` | `X`, `obsm["X_pca"]`, `uns["neighbors"]` | `preprocessed.h5ad` |

## CLI Reference

```bash
python skills/spatial-trajectory/spatial_trajectory.py \
  --input <preprocessed.h5ad> --output <report_dir>

python skills/spatial-trajectory/spatial_trajectory.py \
  --input <data.h5ad> --output <dir> --method dpt --root-cell AACG_1

python skills/spatial-trajectory/spatial_trajectory.py --demo --output /tmp/traj_demo
```

## Example Queries

- "Infer developmental trajectory mapped onto the spatial slice"
- "Calculate pseudotime progression using PAGA in this data"

## Algorithm / Methodology

1. **Diffusion map**: Compute diffusion components from the neighbor graph
2. **Root selection**: Use provided root cell, or auto-select the cell with the highest diffusion component 1 value
3. **DPT**: Compute diffusion pseudotime from the root cell
4. **Optional CellRank**: Fit CytoTRACE kernel + velocity kernel for directed transitions, compute fate probabilities
5. **Visualisation**: Overlay pseudotime on spatial coordinates and UMAP

## Output Structure

```
output_directory/
├── report.md
├── result.json
├── processed.h5ad
├── figures/
│   ├── pseudotime_spatial.png
│   ├── pseudotime_umap.png
│   └── diffmap.png
├── tables/
│   └── trajectory_summary.csv
└── reproducibility/
    ├── commands.sh
    ├── environment.yml
    └── checksums.sha256
```

## Dependencies

**Required** (in `requirements.txt`):
- `scanpy` >= 1.9

**Optional**:
- `cellrank` — directed trajectory with fate probabilities
- `palantir` — multi-scale diffusion pseudotime

## Safety

- **Local-first**: Strict offline processing without external upload.
- **Disclaimer**: Requires OmicsClaw reporting structures and disclaimers.
- **Audit trail**: Hyperparameters and operational flow states are logged fully.

## Integration with Orchestrator

**Trigger conditions**:
- Automatically invoked dynamically based on tool metadata and user intent matching.

**Chaining partners**:
- `spatial-preprocess` — QC before trajectory analysis
- `spatial-domains` — Use root clustering options to specify origins

## Citations

- [Haghverdi et al. 2016](https://doi.org/10.1038/nmeth.3971) — Diffusion pseudotime
- [CellRank](https://cellrank.readthedocs.io/) — Lange et al., Nature Methods 2022
- [Palantir](https://github.com/dpeerlab/Palantir) — Setty et al., Nature Biotechnology 2019

<!-- AUTHOR_SIGNATURE: 9a7f3c2e-MD-BABU-MIA-2026-MSSM-SECURE -->

Files in this skill

  • SKILL.md4.6 KB
  • spatial_trajectory.py15 KB
  • tests/test_spatial_trajectory.py1.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in tools →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.