You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How can I use your model finetuned on tahoe for instance to predict the gene expression matrix of cells perturbed by a drug given my own gene expression matrix of control cells? That would a very useful notebook to have :).
Raf
Hi,
Thanks for the great suggestion! We haven't tested this "one data to another data" finetuning transfer before.
One naive way is to directly load the pretrained tahoe ckpt via model.ckpt_path=/path/to/ckpt, but it might require some minor fixed if the metadata vocabulary (e.g., drugs, cell lines) of your data does not match that of Tahoe100M.
Another important thing is that diffusion framework needs early stopping even for training from scratch on one dataset. Finetuning might face similar issues.
Which dataset (if it's public) you use? I can try to create some small demo for it.
Hi Katarina,
I do believe if you implement this predictions it would be very valuable as Stack did (they predicted all perturbed data from unperturbed data from tabula sapiens). At the end they got all drug induced perturbed data for all cells from tabula sapiens. What would be awesome would be to make a script to predict any perturbation in tahoe (a given drug at a given perturbation) on unperturbed data from tabula sapiens. For instance, you can take skin data such as : https://datasets.cellxgene.cziscience.com/88930108-9c98-43a7-826d-ce454dd0c930.h5ad
Here the idea is to not make any finetuning. Just take your a model trained on tahoe and take as input an unperturbed data and predict a perturbed data as state and stack do.
I can assure you that many people would want to use this script !!
Raf
Thanks for the suggestion! We have added an experimental inference-only API and a Colab-style notebook for this use case.
The new notebook is here:
examples/inference_only_tahoe_issue1_demo.ipynb
It demonstrates how to use the Tahoe-finetuned checkpoint to take control cells from an .h5ad file, align them to the Tahoe checkpoint gene space,
specify a supported Tahoe drug condition, and write the predicted expression matrix as a new .h5ad.
the Tahoe checkpoint is a drug-perturbation checkpoint, so the requested perturbation must exist in the Tahoe drug-condition vocabulary;
the input .h5ad genes are aligned to the checkpoint selected-gene file;
the cell type must exist in the checkpoint cell-type vocabulary;
this is inference-only and does not require paired perturbed cells;
for novel .h5ad inputs, the result should be treated as out-of-distribution inference rather than a validated benchmark setting.
The notebook also includes a small sanity-metric section. Since the public demo .h5ad does not include true perturbed ground truth, that section uses the input control cells as a placeholder target only to show how the metrics code works. If users have a real perturbed ground-truth .h5ad, they can replace the placeholder truth matrix with the aligned ground-truth matrix to compute pred-vs-truth R², MSE, MAE, Pearson correlation, and MMD.
Activity
KatarinaYuan commentedon Mar 16, 2026
Hi,
Thanks for the great suggestion! We haven't tested this "one data to another data" finetuning transfer before.
One naive way is to directly load the pretrained tahoe ckpt via
model.ckpt_path=/path/to/ckpt, but it might require some minor fixed if the metadata vocabulary (e.g., drugs, cell lines) of your data does not match that of Tahoe100M.Another important thing is that diffusion framework needs early stopping even for training from scratch on one dataset. Finetuning might face similar issues.
Which dataset (if it's public) you use? I can try to create some small demo for it.
raphaelmourad commentedon Mar 19, 2026
Hi Katarina,
I do believe if you implement this predictions it would be very valuable as Stack did (they predicted all perturbed data from unperturbed data from tabula sapiens). At the end they got all drug induced perturbed data for all cells from tabula sapiens. What would be awesome would be to make a script to predict any perturbation in tahoe (a given drug at a given perturbation) on unperturbed data from tabula sapiens. For instance, you can take skin data such as : https://datasets.cellxgene.cziscience.com/88930108-9c98-43a7-826d-ce454dd0c930.h5ad
Here the idea is to not make any finetuning. Just take your a model trained on tahoe and take as input an unperturbed data and predict a perturbed data as state and stack do.
I can assure you that many people would want to use this script !!
Raf
KatarinaYuan commentedon Apr 7, 2026
Hi,
Sorry for the late response (too busy last few weeks). Let me look into this.
KatarinaYuan commentedon Aug 23, 2026
Thanks for the suggestion! We have added an experimental inference-only API and a Colab-style notebook for this use case.
The new notebook is here:
examples/inference_only_tahoe_issue1_demo.ipynbIt demonstrates how to use the Tahoe-finetuned checkpoint to take control cells from an
.h5adfile, align them to the Tahoe checkpoint gene space,specify a supported Tahoe drug condition, and write the predicted expression matrix as a new
.h5ad.The corresponding CLI is:
python ./src/apps/run/predict_h5ad.py \ --checkpoint finetuned_tahoe100m.ckpt \ --selected-gene-file tahoe100m_real_selected_genes.pkl \ --input-h5ad control_cells.h5ad \ --output-h5ad predicted_cells.h5ad \ --perturbation "[('Dexamethasone', 0.5, 'uM')]" \ --cell-type oocyte \ --gene-column feature_name \ --batch-size 128 \ --start-time 100A few important caveats:
The notebook also includes a small sanity-metric section. Since the public demo .h5ad does not include true perturbed ground truth, that section uses the input control cells as a placeholder target only to show how the metrics code works. If users have a real perturbed ground-truth .h5ad, they can replace the placeholder truth matrix with the aligned ground-truth matrix to compute pred-vs-truth R², MSE, MAE, Pearson correlation, and MMD.