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
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.
In this repository45 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- admet-predictionSkill
- antibody-design-iggmSkill
- antibody-structure-prediction-tfoldSkill
- binding-affinity-prediction-prodigySkill
- biomedical-literature-searchSkill
- biomed-skill-creatorSkill
- biomed-skill-routerSkill
- cellxgene-census-querySkill
- chembl-querySkill
- disease-drug-intelligenceSkill
- drug-candidate-discoverySkill
- drug-drug-interaction-analysisSkill
- drug-lead-analysisSkill
- functional-protein-designSkill
- iupac-name-identification-biot5Skill
- kegg-querySkill
- molecule-biochemical-significance-query-biot5Skill
- mutation-design-aavSkill
- mutation-design-gfpSkill
- ppi-string-querySkill
- protein-function-predictionSkill
- protein-ligand-binding-analysis-plipSkill
- protein-mutation-analysisSkill
- protein-structure-design-boltzgenSkill
- protein-subcellular-localization-prediction-biot5Skill
- pubchem-querySkill
- retrosynthesis-planningSkill
- similar-protein-retrievalSkill
- single-cell-atac-seq-peak-calling-annotaionSkill
- single-cell-atac-seq-qc-processingSkill
- single-cell-foundation-model-geneformerSkill
- single-cell-foundation-model-langcellSkill
- single-cell-foundation-model-scgptSkill
- single-cell-multi-omics-analysis-scviSkill
- single-cell-multi-omics-data-harmonizationSkill
- single-cell-proteomics-data-processingSkill
- single-cell-proteomics-peptide-identificationSkill
- single-cell-scrna-seq-analysis-scanpySkill
- spatial-transcriptomics-spatial-data-ioSkill
- structure-prediction-boltz-2Skill
- target-based-lead-designSkill
- target-drug-reportSkill
- text-based-molecule-editingSkill
- uniprot-querySkill
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
- Very specific: line 16
Use this skill for the local SToFM repository at /DATA/disk0/zhaosy/home/SToFM.
- Distinctive: line 26
Do not use this skill for ordinary scRNA-seq analysis without spatial coordinates.
- Very specific: line 31
Check whether the input has already been preprocessed into both data.h5ad and hf.dataset.
- Distinctive: line 32
Check that the required checkpoints exist for both the cell encoder and the SE(2) Transformer.
- Distinctive: line 33
Prefer the official embedding pipeline before building downstream heads.
- Very specific: line 39
Use preprocessing/preprocess.py first unless the dataset is already in the expected SToFM format.
- Distinctive: line 82
Do not skip spatial information.
- Very specific: line 83
Do not treat hf.dataset alone as sufficient input for the full model.
- Distinctive: line 84
Do not assume mouse genes can be used directly.
- Distinctive: line 85
Do not run downstream heads on raw expression if the intended workflow is SToFM.
- Distinctive: line 86
Do not assume the repo ships checkpoints.
- Very specific: line 90
Read references/local-usage.md for paths, required files, and practical checks.
- Very specific: line 91
Read references/model-notes.md for the paper-level positioning and the multi-scale workflow.
≈ “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.
Files
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.pypipeline - 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
- Confirm the data has usable spatial coordinates.
- Check whether the input has already been preprocessed into both
data.h5adandhf.dataset. - Check that the required checkpoints exist for both the cell encoder and the SE(2) Transformer.
- 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.datasetfor the cell encoderdata.h5adfor 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.datasetifce_emb.npyis 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:
- generate SToFM embeddings first
- 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.datasetalone 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.mdfor paths, required files, and practical checks. - Read
references/model-notes.mdfor the paper-level positioning and the multi-scale workflow.
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
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.

