Skip to content

xujing363/ODFormer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ODFormer: a Virtual Organoid for Predicting Personalized Therapeutic Responses in Pancreatic Cancer

Paper License

ODFormer introduces a virtual organoid framework that integrates bulk and organoid transcriptomes with drug context to predict patient-specific therapeutic responses in pancreatic cancer. The repository provides the core model definition, pretrained checkpoints, and training/evaluation scripts used in the manuscript “ODFormer: a Virtual Organoid for Predicting Personalized Therapeutic Responses in Pancreatic Cancer.”


Highlights

  • Multi-modal transformer backbone that jointly encodes bulk tumor, organoid, and drug representations.
  • Pretrained scPDACGPT encoders for transcriptomic embedding initialization.
  • End-to-end response prediction via a transformer regressor head.
  • Reproducible seeds and deterministic settings for consistent experiments.

Repository Structure

ODFormer.py              # Model definition (ODFormer, transformer regressor, encoders)
Pretrained_models.py     # scPDACGPT/GPT backbone configs and load utilities
Training_Evaluating.py   # Training & evaluation pipeline
untils.py                # Data and helper utilities

Installation

python -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install torch numpy

Additional dependencies may be required depending on your CUDA setup and local environment.


Pretrained Weights

Place pretrained scPDACGPT checkpoints in the paths referenced by ODFormer.py:

  • ../../100_Bulk_scPDACGPT.pth
  • ../../100_funetuning_noMask_scPDACGPT.pth

You can modify these paths directly in ODFormer.py to match your storage layout.


Training & Evaluation

Run the training and evaluation pipeline:

python Training_Evaluating.py

Key components:

  • Model: ODFormer.py (TransformerRegressor, positional encoding, encoder loading)
  • Utilities: untils.py (data loading and preprocessing)

Reproducibility

  • Global seed is set to 2024 inside ODFormer.py.
  • CUDA deterministic flags are enabled when available.

Citation

If you use this code in your research, please cite:

ODFormer: a Virtual Organoid for Predicting Personalized Therapeutic Responses in Pancreatic Cancer

License

This repository is released for academic research use. Please contact the authors for commercial licensing.


Contact

For questions, please open an issue or contact the corresponding authors of the manuscript.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages