This repository contains the Hi-TPH dataset, a large-scale Hierarchical dataset for TCR-pHLA binding prediction, and corresponding codes used for data collection and benchmarks.

Install basic packages using env.yaml/requirements.txt or the following instructions:
conda create -n hitph python=3.8
conda activate hitph
# remove '-i https://pypi.tuna.tsinghua.edu.cn/simple/' if necessary
pip install pandas==2.0.3 numpy==1.24.3 scikit-learn tqdm jupyter notebook -i https://pypi.tuna.tsinghua.edu.cn/simple/
conda install pytorch==1.13.0 pytorch-cuda=11.6 -c pytorch -c nvidia
# pip --trusted-host pypi.tuna.tsinghua.edu.cn install torch==1.13.0+cu116 --extra-index-url https://download.pytorch.org/whl/cu116
pip install transformers==4.36.2 datasets==2.16.1 tokenizers==0.15.0 -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip install tape_proteins biopython==1.83 -i https://pypi.tuna.tsinghua.edu.cn/simple/
# for plotting and running notebooks
conda install matplotlib seaborn jupyter notebook
An alternative Python 3.10 environment (AMPLIFY needs python>=3.10):
conda create -n py310 python=3.10
conda activate py310
pip install pandas==2.0 numpy==1.26 scikit-learn tqdm -i https://pypi.tuna.tsinghua.edu.cn/simple/
# AMPLIFY needs python>=3.10, torch==2.2, xformers==0.0.24, ...
# details see: https://github.com/chandar-lab/AMPLIFY/blob/main/pyproject.toml
pip install torch==2.2.0 xformers==0.0.24 --index-url https://download.pytorch.org/whl/cu118 -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip install transformers==4.38 accelerate==0.27 deepspeed==0.13 -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip install tape_proteins biopython==1.83 -i https://pypi.tuna.tsinghua.edu.cn/simple/
# for plotting and running notebooks
conda install matplotlib seaborn jupyter notebook
data_preprocess folder descripes detailed data collection and processing procedures.
data_preprocess/README.md for instructions.data details:
| peptide | HLA | TCR | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| CDR3a | CDR3b | TRAV/J | TRBV/J | Va.seq | Vb.seq | |||||
| Hi-TpH-level-I.csv | β | β | ||||||||
| Hi-TpH-level-II.csv | β | β | β | |||||||
| Hi-TpH-level-III.csv | β | β | β | β | ||||||
| Hi-TpH-level-IV.csv | β | β | β | β | β | β | β | β | ||
| immrep2023_solutions.csv | β | β | β | β | β | β | β | β | ||
| Hi-TpH-hla_allele2seq.json | Dictionary for mapping HLA allele to HLA amino acid sequences (customized for Hi-TPH) | |||||||||
| Hi-TpH-tcr_gene2seq.json | Dictionary for mapping TCR gene name to amino acid sequences (customized for Hi-TPH) | |||||||||
| hla_allele2seq.json | Dictionary for mapping HLA allele to HLA amino acid sequences | |||||||||
| tcr_gene2seq.json | Dictionary for mapping TCR gene name to amino acid sequences | |||||||||
The split Level I-IV benchmark datasets are saved in benchmarks_dataset folder.
Run benchmarks of different levels as follows (in benchmarks folder):
[Settings] First, change the path in the following file to your ownοΌ
bash files in benchmarks/scripts: **_path, e.g., data_path.plm_models.py in benchmarks: **_checkpoint, e.g., esm2_8m_checkpoint.[Training] See benchmarks/scripts/train_**.sh to run train_main.py for training models.
--finetune; if not finetune PLMs, remove it.[Evaluation] After Training, you can test the model with test_main.py.
benchmarks/scripts/eval_**.sh to run test_main.pyNote: we have uploaded checkpoints of Hi-TPH-PLMs to HuggingFaceπ€: Jiadong001/Hi-TPH-PLMs.
We thank the developers and maintainers of the public biological databases and datasets that enabled this work, including:
25 commits
Jupyter Notebook
97.1%
Python
2.9%
This repository contains the Hi-TPH dataset, a large-scale Hierarchical dataset for TCR-pHLA binding prediction, and corresponding codes used for data collection and benchmarks.

Install basic packages using env.yaml/requirements.txt or the following instructions:
conda create -n hitph python=3.8
conda activate hitph
# remove '-i https://pypi.tuna.tsinghua.edu.cn/simple/' if necessary
pip install pandas==2.0.3 numpy==1.24.3 scikit-learn tqdm jupyter notebook -i https://pypi.tuna.tsinghua.edu.cn/simple/
conda install pytorch==1.13.0 pytorch-cuda=11.6 -c pytorch -c nvidia
# pip --trusted-host pypi.tuna.tsinghua.edu.cn install torch==1.13.0+cu116 --extra-index-url https://download.pytorch.org/whl/cu116
pip install transformers==4.36.2 datasets==2.16.1 tokenizers==0.15.0 -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip install tape_proteins biopython==1.83 -i https://pypi.tuna.tsinghua.edu.cn/simple/
# for plotting and running notebooks
conda install matplotlib seaborn jupyter notebook
An alternative Python 3.10 environment (AMPLIFY needs python>=3.10):
conda create -n py310 python=3.10
conda activate py310
pip install pandas==2.0 numpy==1.26 scikit-learn tqdm -i https://pypi.tuna.tsinghua.edu.cn/simple/
# AMPLIFY needs python>=3.10, torch==2.2, xformers==0.0.24, ...
# details see: https://github.com/chandar-lab/AMPLIFY/blob/main/pyproject.toml
pip install torch==2.2.0 xformers==0.0.24 --index-url https://download.pytorch.org/whl/cu118 -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip install transformers==4.38 accelerate==0.27 deepspeed==0.13 -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip install tape_proteins biopython==1.83 -i https://pypi.tuna.tsinghua.edu.cn/simple/
# for plotting and running notebooks
conda install matplotlib seaborn jupyter notebook
data_preprocess folder descripes detailed data collection and processing procedures.
data_preprocess/README.md for instructions.data details:
| peptide | HLA | TCR | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| CDR3a | CDR3b | TRAV/J | TRBV/J | Va.seq | Vb.seq | |||||
| Hi-TpH-level-I.csv | β | β | ||||||||
| Hi-TpH-level-II.csv | β | β | β | |||||||
| Hi-TpH-level-III.csv | β | β | β | β | ||||||
| Hi-TpH-level-IV.csv | β | β | β | β | β | β | β | β | ||
| immrep2023_solutions.csv | β | β | β | β | β | β | β | β | ||
| Hi-TpH-hla_allele2seq.json | Dictionary for mapping HLA allele to HLA amino acid sequences (customized for Hi-TPH) | |||||||||
| Hi-TpH-tcr_gene2seq.json | Dictionary for mapping TCR gene name to amino acid sequences (customized for Hi-TPH) | |||||||||
| hla_allele2seq.json | Dictionary for mapping HLA allele to HLA amino acid sequences | |||||||||
| tcr_gene2seq.json | Dictionary for mapping TCR gene name to amino acid sequences | |||||||||
The split Level I-IV benchmark datasets are saved in benchmarks_dataset folder.
Run benchmarks of different levels as follows (in benchmarks folder):
[Settings] First, change the path in the following file to your ownοΌ
bash files in benchmarks/scripts: **_path, e.g., data_path.plm_models.py in benchmarks: **_checkpoint, e.g., esm2_8m_checkpoint.[Training] See benchmarks/scripts/train_**.sh to run train_main.py for training models.
--finetune; if not finetune PLMs, remove it.[Evaluation] After Training, you can test the model with test_main.py.
benchmarks/scripts/eval_**.sh to run test_main.pyNote: we have uploaded checkpoints of Hi-TPH-PLMs to HuggingFaceπ€: Jiadong001/Hi-TPH-PLMs.
We thank the developers and maintainers of the public biological databases and datasets that enabled this work, including:
25 commits
Jupyter Notebook
97.1%
Python
2.9%