Deep Learning for Antibody-Antigen Interaction Prediction
ImaPEp
ImaPEp[1] is a computational tool for predicting the binding probability between antibody paratopes and antigen epitopes. This repository provides the necessary scripts for training models and performing predictions on antibody-antigen complexes using structural data.
Installation
Documentation: 3BioCompBio/ImaPEp
This tool is most user friendly one. If you have torch environment, you don’t need to do anything else. Just clone the repository and you are ready to go. To be noticed, it doesn’t support CPU mode, only GPU mode.
Usage
The repository contains scripts and examples for prediction. It also includes pre-trained models for immediate use.
For single prediction, you can started with the following command by read single complex and naming the chains:
|
The Order of the chain
According to the repository, the order of the chain matters. The first chain must to by heavy chain (H) The second chain must to by light chain (L) Rest of the chains are antigen chains (B and C)
For batch prediction, you can put all complexes in a folder (PS, don’t put too many files in a folder if you are using linux system. It would make reading the folder very slow). Then, you need to prepare a csv file which named job.txt
as is show in the 3BioCompBio/ImaPEp/tree/main/data/test. The first column is the sample id without the file extension, the second column is the parameter for chains. It looks like this:
1h0d_BA_C,BAC 1a14_HL_N,HLN
And then, you can run the script:
|
Once you see the progress bar, you are good to go.
20%|████ | 710/3600 [08:55<36:20, 1.33it/s]
Results
It would save the results in an csv file named scores_*.txt
in the current folder. The format is like this, the first column is the sample id with the chains, the second column is the binding probability score between the paratope and epitope.
14-2zdock.1004,0.6466 14-2.zdock.1005,0.4243 14-2.zdock.1006,0.3589 14-2.zdock.1007,0.3602 14-2.zdock.1008,0.4168 14-2.zdock.1009,0.6492
EpiScan
Installation
EpiScan also friendly to user as long as you have a working python environment with ESM. But it had some issue with the location of it’s path. As suggested in the repo, you need to run the command in the directory of EpiScan
in the EpiScan
which has another EpiScan
. And then, you’ll get error for no module named EpiScan
. To fix it, you need to add the path of EpiScan
to your PYTHONPATH
environment variable. Or the easiest way is to copy the folder EpiScan
to the EpiScan
(root directory) → EpiScan
(Working directory) → EpiScan
(Module directory/the directory want be copied) → commands
(Actual code directory). Which is wired, but it works.
Usage
You can run the command like this:
|
For piblic_sep_testAg.tsv
, we need to prepare 3 columns: receptor id, ligand id, and epitope annotation (0 and 1 for each residues. 1 stands selected epitope). You can find an example in the dataProcess/public
folder.
EpiPred
AbEpiTope-1.0
Errors
Loading ESM-IF1 model... Traceback (most recent call last): File "/raid/home/wenkanl2/Epitope_tools/AbEpiTope-1.0/RunTest.py", line 11, indata.encode_proteins(STRUCTUREINPUTS, ENCDIR, TMPDIR) # use atom_radius for setting custom antibody-antigen interface Å distance for example 4.5Å, interface data.encode_proteins(STRUCTUREINPUTS, ENCDIR, TMPDIR, atom_radius=4.5) File "/raid/home/wenkanl2/Epitope_tools/AbEpiTope-1.0/abepitope/main.py", line 125, in encode_proteins esmif1_util = ESMIF1Model(esmif1_modelpath=esmif1_modelpath, device=self.device) File "/raid/home/wenkanl2/Epitope_tools/AbEpiTope-1.0/abepitope/esmif1_utilities.py", line 28, in __init__ model_data = torch.load(str(torch_hubfile), map_location=self.device) File "/home/wenkanl2/miniconda3/envs/inverse/lib/python3.9/site-packages/torch/serialization.py", line 1529, in load raise pickle.UnpicklingError(_get_wo_message(str(e))) from None _pickle.UnpicklingError: Weights only load failed. This file can still be loaded, to do so you have two options, do those steps only if you trust the source of the checkpoint. (1) In PyTorch 2.6, we changed the default value of the `weights_only` argument in `torch.load` from `False` to `True`. Re-running `torch.load` with `weights_only` set to `False` will likely succeed, but it can result in arbitrary code execution. Do it only if you got the file from a trusted source. (2) Alternatively, to load with `weights_only=True` please check the recommended steps in the following error message. WeightsUnpickler error: Unsupported global: GLOBAL argparse.Namespace was not an allowed global by default. Please use `torch.serialization.add_safe_globals([argparse.Namespace])` or the `torch.serialization.safe_globals([argparse.Namespace])` context manager to allowlist this global if you trust this class/function. Check the documentation of torch.load to learn more about types accepted by default with weights_only https://pytorch.org/docs/stable/generated/torch.load.html.
Different version of pytorch. Adding weights_only=False
in the torch.load
in abepitope/esmif1_utilities.py
by line 28 solve the problem.
ESM Ecoding Error:
AbEpiTope-1 replies on biotite
to read the PDB file and get the sequence for ESM encoding. However, biotite
only accepted standard PDB file. It would throw error for structure like “ZDOCK” docking results. The easiest way to fix it is read the PDB file with PyMOL
and save it again as a new PDB file. Then, it would work.
BConformeR
Deep Learning for Antibody-Antigen Interaction Prediction