agentleFS
cafferychen777cafferychen777/ChatSpatial/.agents/skills/cell-dynamics/SKILL.md

cell-dynamics

Skill45 starsChanged 3 months agoMITView on GitHub

Understand cellular differentiation, state transitions, and dynamic processes through trajectory and velocity analysis. Use when user wants to study development, differentiation, cell fate decisions, or temporal dynamics. Triggers: "trajectory", "pseudotime", "RNA velocity", "differentiation", "cell fate", "how do cells develop", "lineage", "dynamics", "scVelo", "CellRank".

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use analyze_velocity_data tool with method selection:

    line 66
  2. Very specific:

    Use visualize_data with plot_type="velocity":

    line 76
  3. Very specific:

    Use analyze_trajectory_data tool with:

    line 114
  4. Distinctive:

    Do velocity vectors align with spatial gradients?

    line 147

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Cell Dynamics Analysis

Overview

This skill answers: How do cells change over time, and what are their fate decisions?

Two complementary approaches:

  1. RNA Velocity: Infers directionality from spliced/unspliced ratios
  2. Pseudotime/Trajectory: Orders cells along developmental paths

Decision Tree: Which Approach?

Q: Does your data have spliced/unspliced information?
│
├─ YES (velocyto/kallisto processed)
│   │
│   └─ RNA Velocity Analysis
│       ├─ scVelo (deterministic) - Fast, good default
│       ├─ scVelo (dynamical) - More accurate, slower
│       └─ VeloVI - Deep learning, handles noise
│       │
│       └─ Then: CellRank for fate probability
│
└─ NO (standard scRNA-seq/spatial)
    │
    └─ Pseudotime Analysis
        ├─ Palantir - Multi-lineage, fate probabilities
        ├─ DPT (Diffusion Pseudotime) - Classic, fast
        └─ PAGA - Trajectory + clustering

RNA Velocity Workflow

Prerequisites

Data must contain:

  • adata.layers['spliced']: Spliced counts
  • adata.layers['unspliced']: Unspliced counts

Check with: 'spliced' in adata.layers and 'unspliced' in adata.layers

Step 1: Preprocessing for Velocity

Velocity-specific preprocessing:
1. Filter genes by spliced/unspliced detection
2. Normalize spliced and unspliced separately
3. Compute moments (first/second order)

Step 2: Compute Velocity

Use analyze_velocity_data tool with method selection:

ModeSpeedAccuracyWhen to Use
deterministicFastGoodInitial exploration
stochasticModerateBetterPublication, noisy data
dynamicalSlowBestComplex dynamics, time recovery

Step 3: Visualize Velocity

Use visualize_data with plot_type="velocity":

  • subtype="stream": Velocity streamlines on embedding
  • subtype="phase": Phase portraits for specific genes
  • subtype="proportions": Spliced/unspliced ratios
  • subtype="heatmap": Velocity across pseudotime

Step 4: Fate Analysis with CellRank

After velocity computation:

1. Use analyze_trajectory_data with method="cellrank"
2. Identify initial/terminal states
3. Compute fate probabilities
4. Identify lineage driver genes

Pseudotime Workflow (No Velocity Data)

Method Selection

MethodStrengthsWhen to Use
PalantirMulti-lineage, fate probsComplex differentiation
DPTFast, robustSimple trajectories
PAGATopology discoveryUnknown structure

Step 1: Define Root Cell

Critical for pseudotime:

Options for defining root:
1. Known marker gene expression (e.g., stem cell markers)
2. Specific cluster known to be progenitor
3. User-specified cell barcode

Step 2: Compute Trajectory

Use analyze_trajectory_data tool with:

  • method: "palantir", "dpt", or "cellrank"
  • root_cell or root_cluster: Starting point

Step 3: Visualize Trajectory

Use visualize_data with plot_type="trajectory":

  • subtype="pseudotime": Cells colored by pseudotime
  • subtype="fate_map": Fate probability heatmap
  • subtype="gene_trends": Expression along trajectory
  • subtype="circular": Circular trajectory plot

Biological Interpretation

What Velocity Tells You

  • Direction of differentiation: Where cells are heading
  • Dynamic genes: Genes actively changing
  • State transitions: Intermediate cell states
  • Terminal states: End points of differentiation

What Pseudotime Tells You

  • Ordering of cells: Relative developmental time
  • Branching points: Fate decision locations
  • Lineage relationships: Which states lead to which
  • Driver genes: Genes driving transitions

Spatial Context

Combining Velocity with Space

Questions to explore:

  • Do velocity vectors align with spatial gradients?
  • Are terminal states localized to specific regions?
  • How does spatial organization relate to developmental time?

Visualization Tips

  • Overlay velocity arrows on spatial coordinates
  • Color spatial plots by pseudotime
  • Identify spatial zones of active differentiation

Common Analysis Scenarios

Tumor Heterogeneity

Focus on:
- Cancer stem cell identification
- Differentiation hierarchies within tumor
- EMT transitions

Development

Focus on:
- Lineage specification
- Progenitor identification
- Temporal gene programs

Regeneration/Wound Healing

Focus on:
- Activation states
- Re-differentiation paths
- Spatial gradients of repair

Troubleshooting

IssueCauseSolution
No velocity vectorsLow unspliced countsCheck data quality, try VeloVI
Random directionsSteady state cellsFocus on dynamic subpopulations
Wrong root assignmentBiological uncertaintyTry multiple roots, validate with markers
Disconnected trajectoryBatch effectsIntegrate samples, increase neighbors

Output Summary

Successful dynamics analysis provides:

  • Pseudotime values: Ordering of cells
  • Velocity vectors: Direction of change
  • Fate probabilities: Likelihood of terminal states
  • Driver genes: Key regulators of transitions
  • Spatial mapping: Where dynamics occur in tissue

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.