-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Joseph Watson
committed
Dec 21, 2023
0 parents
commit a4846ac
Showing
15 changed files
with
803 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[submodule "submodules/oligomer_hallucination"] | ||
path = submodules/oligomer_hallucination | ||
url = https://github.com/bwicky/oligomer_hallucination.git | ||
[submodule "alphafold"] | ||
path = alphafold | ||
url = https://github.com/deepmind/alphafold.git | ||
[submodule "submodules/alphafold"] | ||
path = submodules/alphafold | ||
url = https://github.com/google-deepmind/alphafold.git |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
BSD License | ||
|
||
Copyright (c) 2023 University of Washington. Developed at the Institute for | ||
Protein Design by Joseph Watson | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
|
||
Redistributions in binary form must reproduce the above copyright notice, this | ||
list of conditions and the following disclaimer in the documentation and/or | ||
other materials provided with the distribution. | ||
|
||
Neither the name of the University of Washington nor the names of its | ||
contributors may be used to endorse or promote products derived from this | ||
software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY OF WASHINGTON AND CONTRIBUTORS “AS | ||
IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OF WASHINGTON OR CONTRIBUTORS BE | ||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE | ||
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | ||
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
# AlphaFold2 Hallucination for Flexible Peptide Binding | ||
|
||
<p align="center"> | ||
<img src="./.img/Convergence.png" alt="alt text" width="1100px" align="middle"/> | ||
</p> | ||
|
||
## Description | ||
|
||
Code for generating binders to flexible peptides using Hallucination (Activation Maximisation) with AlphaFold2. | ||
|
||
From [Vazquez-Torres, S., Leung, P.J.Y., Venkatesh, P. *et al*., De novo design of high-affinity binders of bioactive helical peptides, *Nature* 2023](https://www.nature.com/articles/s41586-023-06953-1). | ||
|
||
The code is very heavily based upon, and uses much of the code from Basile Wicky and Lukas Milles' [Oligomer Hallucination](https://github.com/bwicky/oligomer_hallucination) code, | ||
described in [Wicky, B.I.M., Milles, L.F. Courbet, A. *et al*., Hallucinating symmetric protein assemblies, *Science* 2022](https://www.science.org/doi/10.1126/science.add1964). | ||
|
||
The underlying method relies on the [AlphaFold2 structure prediction network](https://github.com/google-deepmind/alphafold) from Google Deepmind, | ||
described in [Jumper, J. *et al*., Highly accurate protein structure prediction with AlphaFold, *Nature* 2021](https://www.nature.com/articles/s41586-021-03819-2). | ||
|
||
Author: Joseph L. Watson; joewatchwell. | ||
|
||
## Important Note | ||
|
||
As demonstrated in the Nature article, binders can be generated to flexible peptides using RFdiffusion, which produces higher quality outputs and is several orders of magnitude more compute-efficient. | ||
This code is provided for reproducibility purposes only. | ||
|
||
[RFdiffusion](https://github.com/RosettaCommons/RFdiffusion) was originally described in [Watson, J.L., Juergens, D., Bennett, N.R., Trippe, B.L., Yim, J., Eisenach, H.E., Ahern W. *et al*., | ||
De novo design of protein structure and function with RFdiffusion, *Nature* 2023](https://www.nature.com/articles/s41586-023-06415-8). | ||
|
||
|
||
---- | ||
|
||
# Table of contents | ||
|
||
- [AlphaFold2 Hallucination for Flexible Peptide Binding](#alphafold2-hallucination-for-flexible-peptide-binding) | ||
- [Description](#description) | ||
- [Important Note](#important-note) | ||
- [Table of contents](#table-of-contents) | ||
- [Getting started / installation](#getting-started--installation) | ||
- [Designing binders with AF2 Hallucination](#designing-binders-with-af2-hallucination) | ||
- [Modifying the loss parameters](#modifying-the-loss-parameters) | ||
- [Modifying Hallucination parameters](#modifying-hallucination-parameters) | ||
- [Downstream steps](#downstream-steps) | ||
- [Acknowledgements](#acknowledgements) | ||
|
||
# Getting started / installation | ||
|
||
You'll first need to clone the repository and its submodules: | ||
|
||
``` | ||
git clone --recursive https://github.com/RosettaCommons/AF2_peptide_hallucination.git | ||
``` | ||
|
||
Ensure that you have either [Anaconda or Miniconda](https://conda.io/projects/conda/en/latest/user-guide/install/index.html) installed. | ||
You can then create a conda environment from the provided `.yml` file | ||
``` | ||
conda env create -f env/SE3_PEPTIDE | ||
conda activate SE3_PEPTIDE | ||
``` | ||
By default, we clone the AlphaFold2 repository. If you already have AlphaFold2 installed locally, you can skip this step, but if not: | ||
|
||
``` | ||
cd submodules/alpahafold | ||
python setup.py install | ||
``` | ||
|
||
# Designing binders with AF2 Hallucination | ||
|
||
Once you have installed everything, you're ready to go! | ||
The goal of this project was to be able to design binders to flexible peptides (helical peptides in the Nature article). | ||
The flexibility of the peptides means that there is no single static structure that the peptides adopt, and hence, we want to be able to design binders to a variety of the possible states. | ||
We leveraged the fact that AF2 is a structure prediction network to simultaneously design binders while predicting the structure of the peptide sequence. | ||
Therefore, the only required input is a peptide sequence and the length of the binder you want to Hallucinate. | ||
The arguments are provided through Hydra configs. The default configuration can be found in `config/base.yaml`. You can either build a new config file, or specify arguments at the command line. | ||
|
||
``` | ||
python run.py input.target_sequence=QEDIIRNIARHLAQVGDSMDRSIPPG input.binder_length=100 | ||
``` | ||
|
||
You probably want to change the output path: | ||
|
||
``` | ||
output.out_dir=length_100_binders output.out_prefix=Bid_binders | ||
``` | ||
|
||
By default, we won't override existing files, but this behaviour can be turned off: | ||
|
||
``` | ||
output.cautious=False | ||
``` | ||
|
||
## Modifying the loss parameters | ||
|
||
For simplicity, the losses implemented in this repository are just those used to design binders in the Nature article, with very minor performance improvements. | ||
The default weights on each loss, as defined in the config file, are those used in the article. These can be modified trivially however. At the command line, you could, for example, provide: | ||
|
||
``` | ||
loss.plddt=5 loss.ptm=0 | ||
``` | ||
This would upweight the `plddt` loss (from its default value of 1) and turn off the `pTM` loss. | ||
|
||
These losses are defined in `util/losses.py`. It is very simple to add additional losses, if you so desire. | ||
|
||
## Modifying Hallucination parameters | ||
|
||
The hallucination parameters are taken directly from the [Oligomer Hallucination](https://github.com/bwicky/oligomer_hallucination) repository. You can easily modify things like the Softmax temperature and half-life. For example: | ||
|
||
``` | ||
hallucination.T_init=0.05 hallucination.half_life=500 | ||
``` | ||
Would start with a higher temperature (so higher chance of accepting a "bad" mutation) but a shorter half life (so this chance decays faster). | ||
|
||
## Optimising an existing binder | ||
|
||
You can also try to optimise an existing binder. Here, we provide a specific starting sequence (rather than generating a random one). | ||
|
||
``` | ||
input.binder_sequence=EELTIEVRIEGVDPETAARIEAIFKSVWEPRAKKLSLEGQKALVEALARALVAALKEHGIDARVHVKLIKDGEVVHELEF | ||
``` | ||
|
||
# Downstream steps | ||
|
||
Once you have run some Hallucination trajectories, you'll want to do some downstream processing before ordering. | ||
Following [Wicky, B.I.M., Milles, L.F., Courbet, A. *et al*., *Science* 2022](https://www.science.org/doi/10.1126/science.add1964), who noted that the sequences that AF2 Hallucination produces are generally insoluble, | ||
in the Nature article we redesigned the sequence of the binders with [ProteinMPNN](https://github.com/dauparas/ProteinMPNN), | ||
described in [Dauparas, J. *et al*, Robust deep learning–based protein sequence design using ProteinMPNN, *Science* 2022](https://www.science.org/doi/10.1126/science.add2187). | ||
|
||
We then filtered these sequences based on AF2 pLDDT, pTM, RMSD to the design model, RMSD of the monomer to the binder model (without the peptide), and Rosetta ddg. | ||
|
||
# Acknowledgements | ||
|
||
This work was made possible by the following separate libraries and packages: | ||
|
||
* [Oligomer Hallucination](https://github.com/bwicky/oligomer_hallucination) | ||
* [AlphaFold2](https://github.com/deepmind/alphafold) | ||
* [ProteinMPNN](https://github.com/dauparas/ProteinMPNN) | ||
* [Rosetta](https://www.rosettacommons.org/software) | ||
* [PyRosetta](https://www.pyrosetta.org/) | ||
|
||
Thank you all their contributors and maintainers! | ||
|
||
# Get in touch | ||
|
||
Questions and comments are welcome: | ||
|
||
* Joseph Watson: [[email protected]](mailto:[email protected]) | ||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Base configuration for peptide binder hallucination | ||
|
||
input: | ||
target_sequence: null | ||
binder_length: 70 | ||
binder_sequence: null | ||
|
||
loss: | ||
plddt: 1 | ||
ptm: 1 | ||
rog: 0.1 | ||
contact_prob: 3 | ||
iPAE: 5 | ||
|
||
output: | ||
out_dir: models | ||
cautious: True | ||
out_prefix: binder | ||
output_pae: False | ||
|
||
hallucination: | ||
exclude_AA: C | ||
mutation_rate: "3-1" | ||
select_positions: plddt | ||
mutation_method: frequency_adjusted | ||
T_init: 0.01 | ||
half_life: 1000 | ||
steps: 5000 | ||
|
||
model: | ||
model: 4 | ||
recycles: 1 |
Oops, something went wrong.