A transformer mode for prediction of protein stability index for 28-residue peptides. Performs better than current composition or motif-search based methods and is applicable for protein degron mapping (internal + C-degrons only), in silico scanning/saturation mutagenesis for degron motif detection, and generally stability prediction.
Training:
-
Uses S1, S4, S7 data from the Elledge lab (doi.org/10.1016/j.molcel.2023.08.022)
-
S1: 260K peptides from the human proteome
-
S4: Scanning mutagenesis on a subset of degrons
-
S7: Saturation mutagenesis on a subset of degrons
-
For S7, only degrons with >=60 reads were kept
-
-
90% of data from each table were selected at random and merged into data.csv (569270 sequences)
-
The other 10% was kept for final blind testing
- Checkpoints for epoch 30 and 50 saved
Performance:
Degformer was tested on data from S1, S4, and S7 that was excluded from training/evaluation. Predictions from the Elledge lab paper were only available for S1.
| Dataset | Correlation (ρ) | Mean ΔPSI | Median ΔPSI | σ(ΔPSI) | |
|---|---|---|---|---|---|
| Elledge lab* | S1 S4 S7 |
0.8955 - - |
0.4174 - - |
0.3179 - - |
0.5584 - - |
| Degformer (e30) | S1 S4 S7 |
0.9409 0.9441 0.9089 |
0.3178 0.3065 0.3131 |
0.2475 0.2476 0.2240 |
0.2873 0.2625 0.3010 |
| Degformer (e50) | S1 S4 S7 |
0.9420 0.9463 0.9162 |
0.3148 0.2932 0.3014 |
0.2397 0.2322 0.2150 |
0.2905 0.2607 0.2923 |
* Statistics determined from entire 260K dataset for S1 only
Figure 1: Performance of Degformer e50 on S1 blind set.
Figure 2: in silico saturation mutagenesis recovers diverse degron motifs.
Figure 3: C-degrons are detected by Degformer. Addition of any residues to the ends of C-degrons stabilizes PDGFC (G-end), SNF8 (P-end), TRPC4AP (EE-end), GNMT (R-3) C-terminals (clockwise from top left).
Figure 4: Degron scanning of human GNMT.
Setting up (VSCode):
-
Download repository
-
In VSCode terminal, cd into project folder
-
Create virtual environment (python -m venv degron-env)
-
Activate venv (degron-env/scripts/activate). Check that python interpreter is using the virtual environment in bottom right corner.
-
Install dependencies (torch, pandas, numpy, argparse, seaborn, matplotlib, etc.)
-
If using a GPU make sure the torch package is compatible with the architecture (Blackwell => cu128)
-
For CPU, install CPU-only torch
-
Scripts:
train_v2.py:
-
Main training script using built in transformer model training with Pytorch
-
Model weights stored as .pt
predict.py:
-
Main inference script using model weights from train_v2.py
-
Provide input .csv file where first column is peptide name, and second column is the peptide sequence. Header should be (name, sequence).
-
Set desired model checkpoint in python file. Recommended: peptide_model_epoch50.pt
Modes:
-
Default: predicts deltaPSI and controlPSI for peptides
-
Saturation mutagenesis: predicts PSIs for input peptides, and all possible point mutants
-
Scanning mutagenesis: predicts PSIs for input peptides, with scanning point mutation using specified residue (alanine by default)
-
Protein scanning: provided protein sequence instead of peptide, will predict PSI for all possible 28 residue fragments in order (overlapping adjacent fragments by 27 residues)
Usage:
- Default prediction
python predict.py --input predict_input.csv
- Saturation mutagenesis
python predict.py --input predict_input.csv --mode sat_mut
- Scanning mutagenesis (to Alanine)
python predict.py --input predict_input.csv --mode scan_mut
- Scanning mutagenesis (to Glycine)
python predict.py --input predict_input.csv --mode scan_mut --residue G
- Protein scanning
python predict.py --input predict_input.csv --mode protein
- Fragment index for protein mode is based on position of rightmost residue in protein (add 13 or 14 to the index for fragment center format)
saturation_mut_heatmap.py:
- Input .csv should be the output from predict.py or formatted in the same way
- Capable of generating heatmaps for multiple saturation mutagenesis results at a time
python saturation_mut_heatmap.py predict_output.csv




