ModelMicrosoftMicrosoftpublished Oct 16, 2026seen 1w

microsoft/scFM-dataselection

Open original ↗

Captured source

source ↗
published Oct 16, 2026seen 1wcaptured 1whttp 200method plainlicense mitdownloads 0likes 2

scFM-dataselection pretraining checkpoints

Model checkpoints and PCA components for Evaluating the role of pretraining dataset size and diversity on single-cell foundation model performance, DenAdel et al., *Nature Methods* (2026).

Models

| Model | Count | |---|---:| | Geneformer | 125 | | scVI | 125 | | SSL/MLP | 125 | | PCA components | 80 | | Total | 455 |

The full download is approximately 22.4 GB: 375 neural network checkpoints and 80 PCA component matrices.

Within portable-checkpoints/, models are grouped into geneformer/, scvi/, ssl/ and pca/.

The Geneformer, scVI and SSL models cover random sampling, cell-type reweighting and geometric sketching at 1, 10, 25, 50, 75 and 100 percent of the pretraining corpus. The collection also includes perturbation spike-in experiments. See model-index.csv for model folders and training settings.

Download

Use Python 3.10. The examples below were tested on CPU.

from huggingface_hub import snapshot_download

root = snapshot_download(
repo_id="microsoft/scFM-dataselection",
local_dir="scFM-dataselection",
)

From the downloaded directory:

python -m pip install -r requirements.txt

To download individual models, use allow_patterns with the model folders listed in model-index.csv. Include model-index.csv, tools/*, public-resources/* and requirements.txt to use the loading code below.

Load a checkpoint

Run these examples from the downloaded directory. They use small dummy inputs.

import csv
import sys
import numpy as np
import torch

sys.path.insert(0, "tools")
from portable_models import load_model

with open("model-index.csv", newline="") as stream:
rows = list(csv.DictReader(stream))

geneformer = load_model(
"portable-checkpoints/geneformer/random/idx_100pct_seed25"
)
with torch.no_grad():
logits = geneformer(input_ids=torch.tensor([[2, 3, 4, 5]])).logits

ssl = load_model("portable-checkpoints/ssl/random/idx_100pct_seed25")
with torch.no_grad():
latent, reconstruction = ssl(torch.ones(2, 19331))

pca_row = next(row for row in rows if row["family"] == "PCA")
components = load_model(pca_row["portable_directory"])
projection = np.ones((2, 19331), dtype=components.dtype) @ components

For your own data, follow the paper's preprocessing. Geneformer requires ranked gene inputs and normalization using the tokenizer dictionaries in public-resources/geneformer/. SSL and PCA use the paper's 19,331-gene scTab order.

For scVI, provide an AnnData object with raw counts in X and var_names matching the gene_names order in the model's config.json.

scvi_model = load_model(
"portable-checkpoints/scvi/random/idx_100pct_seed25",
adata=your_anndata,
)
latent = scvi_model.get_latent_representation()

License

The model weights, PCA components and loading code are licensed under MIT. Geneformer tokenizer files use Apache-2.0, and the included SSL code uses MIT. See LICENSE and THIRD_PARTY_NOTICES.md for the full terms and copyright notices.

Citation

Please cite the paper when using these checkpoints:

> DenAdel, A., Hughes, M., Thoutam, A., et al. Evaluating the role of pretraining > dataset size and diversity on single-cell foundation model performance. > Nature Methods 23, 1447-1457 (2026). > https://doi.org/10.1038/s41592-026-03120-y

Questions about the checkpoints can be raised in the paper's code repository.

Notability

notability 5.0/10

Microsoft releases niche single-cell data selection model.