This repository contains the code for mamp-ml, a deep learning approach to epitope immunogenicity in plants. If you plan to run on a small number of receptor-epitope combinations (less than 100 receptors), we recommend you use Google Colab. If you plan to run on 10000s+ of receptor-epitope combinations, we recommend you install locally, have access to a GPU (at least A5000) and potentially adjust the code to pull MSAs for receptor structure generation locally (future enhancement). To do so, please see info from localcolab: link here.
-
Danielle M. Stevens
Dept. of Plant & Microbial Biology, University of California, Berkeley -
David Yang
Center for Computational Biology, University of California, Berkeley -
Tatiana Liang
Dept. of Plant & Microbial Biology, University of California, Berkeley -
Tianrun Li
Dept. of Plant Pathology, University of California, Davis -
Brandon Vega
Dept. of Plant & Microbial Biology, University of California, Berkeley -
Gitta Coaker
Dept. of Plant Pathology, University of California, Davis -
Ksenia Krasileva
Dept. of Plant & Microbial Biology, University of California, Berkeley,
Center for Computational Biology, University of California, Berkeley
Eukaryotes detect biomolecules through surface-localized receptors, a central signaling response hub. A subset of receptors survey for pathogens, induce immunity, and restrict pathogen growth. Comparative genomics of both hosts and pathogens has unveiled vast sequence variation in receptors and potential ligands, creating an experimental bottleneck. We have developed mamp-ml, a machine learning framework for predicting plant receptor-ligand interactions. We leveraged existing functional data from over two decades of foundational research, together with the large protein language model ESM-2, to build a pipeline and model that predicts immunogenic outcomes using a combination of receptor-ligand features. Our model achieves 74% prediction accuracy on a held-out test set, even when an experimental structure is lacking. Our approach enables high-throughput screening of LRR receptor-ligand combinations and provides a computational framework for engineering plant immune systems.
Note: We are aware that colab is down and it is currently being fixed. Please use the local version for the time being.
Download the GitHub repo:
git clone https://github.com/DanielleMStevens/mamp-ml.git
Install and initialize conda. If you need instructions for how to install conda, please see the wiki page. If conda fails to initialize, you can also run the command below:
conda init
source ~/.bashrc
To install the software dependencies, AlphaFold2 via colabfold and LRR-Annotation, we will run the following command:
bash mamp-ml/install_software.sh
# you can check for proper install of colabfold by the following command (update the path to
# activate the conda package):
conda activate /content/localcolabfold/colabfold-conda
colabfold_batch --help
Please prepare an excel file in the following format (see example_data.xlsx as an example):
plant_species | receptor | locus_id | receptor_sequence | ligand_sequence
Once your excel file with receptor and ligands sequences is prepared, follow the below pipeline:
# this will transform your excel sheet into a fasta file
bash mamp-ml/prepare_input_data.sh "$(pwd)/data_of_interest.xlsx"
# activate AlphaFold and run (please update your path)
conda activate /content/localcolabfold/colabfold-conda
export PATH="/global/scratch/users/dmstev/localcolabfold/colabfold-conda/bin:$PATH"
colabfold_batch --num-models 1 ./mamp-ml/intermediate_files/receptor_full_length.fasta \
./mamp-ml/intermediate_files/receptor_only/
# once AlphaFold models are complete, run to process the model structures via LRR-Annotation
# and prep data for prediction via mamp-ml
bash mamp-ml/run_preparation_pipeline.sh "$(pwd)/data_of_interest.xlsx"
# deactivate conda environment to activate another (please update your path)
conda deactivate
conda activate /content/esmfold-conda/esmfold-conda
python mamp-ml/main_train.py \
--model esm2_bfactor_weighted \
--eval_only_data_path /content/mamp-ml/intermediate_files/ready_test_data.csv \
--model_checkpoint_path /content/mamp-ml/mamp_ml_weights.pth \
--device cpu \
--disable_wandb
A sucessful run will produce a csv file with processed input data (plant species, receptor, locus_id, ligand and receptor sequence) as well as prediction and their associated softmax probabilities.
Note: If you are an HPC user, you made need to modify your installation. Please visit our wiki page for a guide.
To run this package locally, we recommend having compute with a NIVDIA GPU available and at least 16 GB RAM and 16 GB VRAM. The main step that is slow + memory intensive is running AlphaFold. While we were able to run predictions on a 1080Ti, we found considerable runtime improvements using RTX A5000 cards.
If you use this tool, please cite the following paper:
Stevens et al. 2025. Mamp-ml: a deep learning approach to epitope immunogenicity in plants. BioRxiv.
DOI: 10.1101/2025.07.11.664399
Details on building this pipeline and model can be found in another GitHub Repo: mamp-prediction-ml.
We are always looking to improve mamp-ml to increase prediction accuracy and expand to other LRR-PRR receptors and their protein ligands. Please feel free to contact us if you have recently published a dataset or would like to contribute to make this tool better!
The development of mamp-ml would not have been possible without the data availability of two decades of work across many labs and countries. This work represents the potential growth of the field when data is shared freely and made readily accessible. It is critical moving forward that future research makes all raw data and sequential information readably available in accessible data storage entities such as NCBI, Zenodo, GitHub, among many others. Together, though, as the code of LRR receptors is better understood, we foresee using these building blocks to generate de novo receptors, enabling targeted plant engineering against pathogens and long-term sustainability.
If you are in industry or want to use mamp-ml for commercial purposes, please contact us:
Danielle M. Stevens, dmstev@berkeley.edu
Ksenia Krasileva, kseniak@berkeley.edu
Please feel free to contact me directly with any questions or issues with the code
Danielle Stevens - @dani_m_stevens - dmstev@berkeley.edu
