agentleFS
PharMolixPharMolix/OpenBioMed/skills/spatial-transcriptomics-foundation-model-stofm/SKILL.md

single-cell-foundation-model-stofm

Skill1.1k starsChanged 8 months agoMITView on GitHub

Use this skill when a task involves the local SToFM project in /DATA/disk0/zhaosy/home/SToFM, especially preprocessing spatial transcriptomics data for SToFM, generating cell embeddings with the cell encoder plus SE(2) Transformer pipeline, handling spatial coordinates, or preparing SToFM embeddings for downstream region segmentation or cell type annotation.

Trending

Quiet this year.thin dataabout the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the PharMolix/OpenBioMed repository that our weekly crawl found: only 1 in all, so this is a hint, not a trend. There is no adoption data for this file yet.

Who's talking about PharMolix/OpenBioMed

The biggest 1 of 1 mention linking to the repository that our crawl found. Each line is their own headline.

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. About 0 are common, 7 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

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

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

    Use this skill for the local SToFM repository at /DATA/disk0/zhaosy/home/SToFM.

    line 16
  2. Distinctive:

    Do not use this skill for ordinary scRNA-seq analysis without spatial coordinates.

    line 26
  3. Very specific:

    Check whether the input has already been preprocessed into both data.h5ad and hf.dataset.

    line 31
  4. Distinctive:

    Check that the required checkpoints exist for both the cell encoder and the SE(2) Transformer.

    line 32
  5. Distinctive:

    Prefer the official embedding pipeline before building downstream heads.

    line 33
  6. Very specific:

    Use preprocessing/preprocess.py first unless the dataset is already in the expected SToFM format.

    line 39
  7. Distinctive:

    Do not skip spatial information.

    line 82
  8. Very specific:

    Do not treat hf.dataset alone as sufficient input for the full model.

    line 83
  9. Distinctive:

    Do not assume mouse genes can be used directly.

    line 84
  10. Distinctive:

    Do not run downstream heads on raw expression if the intended workflow is SToFM.

    line 85
  11. Distinctive:

    Do not assume the repo ships checkpoints.

    line 86
  12. Very specific:

    Read references/local-usage.md for paths, required files, and practical checks.

    line 90
  13. Very specific:

    Read references/model-notes.md for the paper-level positioning and the multi-scale workflow.

    line 91

≈ “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

SToFM

Use This Skill When

Use this skill for the local SToFM repository at /DATA/disk0/zhaosy/home/SToFM. It is the right choice when the task involves:

  • preprocessing spatial transcriptomics data into the format expected by SToFM
  • converting mouse genes to the human Geneformer vocabulary when needed
  • generating cell embeddings with the official get_embeddings.py pipeline
  • working with spatial coordinates, sub-slice splitting, or hypernode construction
  • using SToFM embeddings for downstream region segmentation or cell type annotation
  • understanding the repo's two-stage architecture: cell encoder plus SE(2) Transformer

Do not use this skill for ordinary scRNA-seq analysis without spatial coordinates.

Start Here

  1. Confirm the data has usable spatial coordinates.
  2. Check whether the input has already been preprocessed into both data.h5ad and hf.dataset.
  3. Check that the required checkpoints exist for both the cell encoder and the SE(2) Transformer.
  4. Prefer the official embedding pipeline before building downstream heads.

Choose A Path

Preprocessing

Use preprocessing/preprocess.py first unless the dataset is already in the expected SToFM format.

The repo's preprocessing flow:

  • starts from AnnData
  • expects Geneformer-style transcriptome tokenization
  • adds obs["n_counts"]
  • uses var["ensembl_id"]
  • maps mouse gene ids to human ids when needed
  • saves both:
    • hf.dataset for the cell encoder
    • data.h5ad for later spatial loading

Embedding generation

The main official workflow is get_embeddings.py.

This path:

  • loads the pretrained cell encoder
  • loads the SToFM SE(2) Transformer
  • encodes cells from hf.dataset if ce_emb.npy is missing
  • loads spatial coordinates from data.h5ad
  • splits large slices into sub-slices
  • builds hypernodes and attention biases
  • runs the SE(2) Transformer
  • saves final embeddings such as stofm_emb.npy

Downstream tasks

The repo's recommended downstream pattern is simple:

  1. generate SToFM embeddings first
  2. train a task-specific head on top of those embeddings

The README specifically highlights:

  • tissue region semantic segmentation
  • cell type annotation

Guardrails

  • Do not skip spatial information; SToFM is not just a transcriptome encoder.
  • Do not treat hf.dataset alone as sufficient input for the full model; the SE(2) stage also needs spatial structure.
  • Do not assume mouse genes can be used directly; the repo explicitly maps them into the human vocabulary.
  • Do not run downstream heads on raw expression if the intended workflow is SToFM; generate official embeddings first.
  • Do not assume the repo ships checkpoints; they are external downloads.

Read More Only If Needed

  • Read references/local-usage.md for paths, required files, and practical checks.
  • Read references/model-notes.md for the paper-level positioning and the multi-scale workflow.

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.