Downloads · 30 days
0
0% of all-time downloads
Zekkenwang/PHbinder-PSGM
PHbinder-PSGM is a machine learning model from Zekkenwang. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This is a cascaded framework for peptide-HLA binding prediction (PHBinder) and HLA pseudo-sequence generation (PSGM). The PHbinder model is designed to predict the binding affinity between peptides and their correspon…
Downloads · 30 days
0
0% of all-time downloads
All-time downloads
22
Public
Repo size
5.2 GB
Likes
0
Public
Click a slice to open those files.
.pt1.3 GB · 34%
From the Hugging Face model README
This is a cascaded framework for peptide-HLA binding prediction (PHBinder) and HLA pseudo-sequence generation (PSGM). The PHbinder model is designed to predict the binding affinity between peptides and their corresponding MHC molecules (HLA). The PSGM model generates candidate HLA-I pseudo-sequences based on a given peptide and maps them to a corresponding list of HLA-I alleles.
First, clone this repository to your local machine:
git clone https://github.com/Zekkenwang/PHbinder-PSGM.git
cd PHbinder-PSGM
It is highly recommended to use Conda or venv to create an isolated Python virtual environment to avoid package conflicts.
Create a virtual environment using Conda:
conda create -n ph_binding_env python=3.9 # Python 3.9 or higher is recommended
conda activate ph_binding_env
Install dependencies:
pip install -r requirements.txt
To skip the training process and use our pre-trained models directly for prediction, please download the model weights from our Hugging Face Hub repository:
https://huggingface.co/Zekkenwang/PHbinder-PSGM
After downloading, please organize the files into the models/ directory of your cloned repository, following this structure:
PHbinder-PSGM/
└── models/
├── esm2_t30_150_UR50D/
├── phbinder/
├── psgm/
└── phbinder_pretrain/
Note: If the models directory or its subdirectories (phbinder, psgm, phbinder_pretrain) do not exist, please create them manually before placing the downloaded files.
This section provides detailed instructions on how to replicate and use the PHbinder model. PHbinder includes a pre-training phase using ESM2+LoRA, which significantly improves training efficiency and model performance.
To start the training process, run the following command:
python scripts/phbinder.py
Expected Output:
PHbinder-PSGM/models/phbinder_pretrain.PHbinder-PSGM/models/phbinder.To predict whether a peptide is an epitope using the pre-trained model, you must first download the model weights and place them in the specified models/phbinder/ and models/phbinder_pretrain/ directories.
Then, run:
python scripts/predict_phbinder.py
This will evaluate the model on an external dataset. We have provided an example evaluation using the dataset in external_data. If you wish to use your own dataset, please update the EXTERNAL_DATA_PATH and PREDICTION_OUTPUT_PATH in the phbinder_config to your desired input and output paths.
To train the PSGM model, execute the following command:
python scripts/train_psgm.py
Expected Output:
PHbinder-PSGM/models/psgm.Use the pre-trained PSGM model to generate HLA-I pseudo-sequences from a given list of peptides and map them to a corresponding list of HLA Alleles. You must first download the model weights and place them in the specified models/psgm/ directory.
Run the following script for generation:
python scripts/predict_psgm.py
This will generate predictions on an external dataset, with an example provided in external_data. To evaluate on your own data, modify the EXTERNAL_DATA_PATH and PREDICTION_OUTPUT_PATH in the psgm_config file to your specific input and output file paths.