Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protein-Protein or Protein-Peptide alchemistry? #682

Open
amin-sagar opened this issue Jan 9, 2024 · 6 comments
Open

Protein-Protein or Protein-Peptide alchemistry? #682

amin-sagar opened this issue Jan 9, 2024 · 6 comments

Comments

@amin-sagar
Copy link

Dear OpenFE team.
Thanks for this awesome work.
This is related to #633 #634 and #636
I would like to start with a protein-peptide co-crystal structure and modify the peptide by

  1. doing amino acid mutations
  2. adding small groups like methyl, acetyl etc.

Are there any special instructions for doing such calculations or should I treat my peptide as a small molecule and follow the lysozyme-benzene tutorial?
I would be really grateful for any suggestions.
Best,
Amin.

@IAlibay
Copy link
Member

IAlibay commented Jan 9, 2024

@amin-sagar, thanks for your question.

Unfortunately at this time, treating an alchemical peptide with an appropriate protein force field is not be feasible. You could treat it as a small molecule but although you would have to stick to either GAFF or OpenFF small molecule force fields and AM1-BCC partial charges (both of which are not very adequate for treating peptides).

@amin-sagar
Copy link
Author

Thanks @IAlibay
Is there a way to support espaloma? https://github.com/choderalab/espaloma
It seems to work well with peptides and openMM.
i.e. design the alchemical transformation, parameterize using espaloma and run the simulations?
Best,
Amin

@IAlibay
Copy link
Member

IAlibay commented Jan 9, 2024

So I think we can use espaloma for the small molecule, so you could have your peptide be parameterized with this and have the protein prepped with whichever AMBER FF version you want.

To do think I think you'd need to set the small molecule forcefield to whichever version of espaloma you want to try out. I haven't tried this out at all though - @mikemhenry might know if there's some issues to be careful of.

@amin-sagar
Copy link
Author

Thanks @IAlibay @mikemhenry
I tried doing a protein-peptide FEP with a simple W to A mutation which is known to drastically reduce affinity.
First I assigned charges using espaloma and used openff-2.1.1 as the small molecule force field. For one of the repetitions, I get some results.
forward_reverse_convergence
But, for the other repetitions, there doesn't seem to be acceptable convergence
mbar_overlap_matrix
This is not unexpected as openff is probably not the best force field for peptides.
I then tried to use espaloma by setting
"small_molecule_forcefield": "espaloma-0.3.2" but I get

Parameterizing molecules
Source 'espaloma-0.3.2.offxml' could not be read. If this is a file, ensure that the path is correct.
Looked in the following paths and found no files named 'espaloma-0.3.2.offxml':
    /mnt/Comp_Chem/Projects/Tests/Test_OpenFE/Test_Bic1/test_espaloma/network_setup/transformations
    /home/amin/mambaforge/envs/openfe_env/lib/python3.11/site-packages/openforcefields/offxml
    /home/amin/mambaforge/envs/openfe_env/lib/python3.11/site-packages/smirnoff99frosst/offxml
    /home/amin/mambaforge/envs/openfe_env/lib/python3.11/site-packages/openff/amber_ff_ports/offxml
If 'espaloma-0.3.2.offxml' is present as a file, ensure it is in a known SMIRNOFF encoding.
Valid formats are: ['XML']
Parsing failed while trying to parse source as a file with the following exception and message:
<class 'openff.toolkit.utils.exceptions.SMIRNOFFParseError'>
syntax error: line 1, column 0

Done with all simulations! Analyzing the results....
Here is the result:
	dG = None ± None


Error: The protocol unit 'Parent to W2A repeat 2 generation 0' failed with the error message:
ValueError: No registered small molecule template generators could load force field 'espaloma-0.3.2'
Available installed force fields are:
  GAFFTemplateGenerator: ['gaff-1.4', 'gaff-1.8', 'gaff-1.81', 'gaff-2.1', 'gaff-2.11']
  SMIRNOFFTemplateGenerator: ['tip3p_fb-1.0.0', 'openff-1.3.0', 'tip5p', 'openff-2.1.1', 'openff-2.2.0-rc1', 'tip4p_ew-1.0.0', 'openff-1.3.1-alpha.1', 'opc3-1.0.1', 'openff-1.2.1', 'spce-1.0.0', 'tip3p_fb', 'openff-2.0.0-rc.1', 'tip3p_fb-1.1.1', 'tip4p_fb-1.0.1', 'tip4p_ew', 'tip3p_fb-1.1.0', 'openff-2.0.0-rc.2', 'tip4p_fb-1.0.0', 'openff-1.0.0-RC1', 'openff-1.0.0-RC2', 'opc', 'openff-1.2.0', 'tip3p-1.0.0', 'tip3p', 'openff-2.0.0', 'openff-1.3.1', 'tip3p-1.0.1', 'openff-1.1.0', 'opc-1.0.0', 'opc-1.0.2', 'openff-1.0.1', 'opc3-1.0.0', 'openff-2.1.0-rc.1', 'tip5p-1.0.0', 'opc3', 'openff-1.1.1', 'opc-1.0.1', 'spce', 'openff-1.0.0', 'openff-2.1.0', 'tip4p_fb', 'smirnoff99Frosst-1.0.9', 'smirnoff99Frosst-1.0.6', 'smirnoff99Frosst-1.0.4', 'smirnoff99Frosst-1.0.0', 'smirnoff99Frosst-1.1.0', 'smirnoff99Frosst-1.0.3', 'smirnoff99Frosst-1.0.7', 'smirnoff99Frosst-1.0.5', 'smirnoff99Frosst-1.0.2', 'smirnoff99Frosst-1.0.8', 'smirnoff99Frosst-1.0.1', 'ff14sb_off_impropers_0.0.2', 'ff14sb_off_impropers_0.0.4', 'ff14sb_off_impropers_0.0.3', 'ff14sb_off_impropers_0.0.1']
  EspalomaTemplateGenerator: ['espaloma-0.2.2']

I also tried espaloma-0.2.2, but I get

Preparing the hybrid topology simulation
Parameterizing molecules
Source 'espaloma-0.2.2.offxml' could not be read. If this is a file, ensure that the path is correct.
Looked in the following paths and found no files named 'espaloma-0.2.2.offxml':
    /mnt/Comp_Chem/Projects/Tests/Test_OpenFE/Test_Bic1/test_espaloma/network_setup/transformations
    /home/amin/mambaforge/envs/openfe_env/lib/python3.11/site-packages/openforcefields/offxml
    /home/amin/mambaforge/envs/openfe_env/lib/python3.11/site-packages/smirnoff99frosst/offxml
    /home/amin/mambaforge/envs/openfe_env/lib/python3.11/site-packages/openff/amber_ff_ports/offxml
If 'espaloma-0.2.2.offxml' is present as a file, ensure it is in a known SMIRNOFF encoding.
Valid formats are: ['XML']
Parsing failed while trying to parse source as a file with the following exception and message:
<class 'openff.toolkit.utils.exceptions.SMIRNOFFParseError'>
syntax error: line 1, column 0

Done with all simulations! Analyzing the results....
Here is the result:
	dG = None ± None


Error: The protocol unit 'Parent to W2A repeat 2 generation 0' failed with the error message:
ValueError: No registered small molecule template generators could load force field 'espaloma-0.2.2'
Available installed force fields are:
  GAFFTemplateGenerator: ['gaff-1.4', 'gaff-1.8', 'gaff-1.81', 'gaff-2.1', 'gaff-2.11']
  SMIRNOFFTemplateGenerator: ['tip3p_fb-1.0.0', 'openff-1.3.0', 'tip5p', 'openff-2.1.1', 'openff-2.2.0-rc1', 'tip4p_ew-1.0.0', 'openff-1.3.1-alpha.1', 'opc3-1.0.1', 'openff-1.2.1', 'spce-1.0.0', 'tip3p_fb', 'openff-2.0.0-rc.1', 'tip3p_fb-1.1.1', 'tip4p_fb-1.0.1', 'tip4p_ew', 'tip3p_fb-1.1.0', 'openff-2.0.0-rc.2', 'tip4p_fb-1.0.0', 'openff-1.0.0-RC1', 'openff-1.0.0-RC2', 'opc', 'openff-1.2.0', 'tip3p-1.0.0', 'tip3p', 'openff-2.0.0', 'openff-1.3.1', 'tip3p-1.0.1', 'openff-1.1.0', 'opc-1.0.0', 'opc-1.0.2', 'openff-1.0.1', 'opc3-1.0.0', 'openff-2.1.0-rc.1', 'tip5p-1.0.0', 'opc3', 'openff-1.1.1', 'opc-1.0.1', 'spce', 'openff-1.0.0', 'openff-2.1.0', 'tip4p_fb', 'smirnoff99Frosst-1.0.9', 'smirnoff99Frosst-1.0.6', 'smirnoff99Frosst-1.0.4', 'smirnoff99Frosst-1.0.0', 'smirnoff99Frosst-1.1.0', 'smirnoff99Frosst-1.0.3', 'smirnoff99Frosst-1.0.7', 'smirnoff99Frosst-1.0.5', 'smirnoff99Frosst-1.0.2', 'smirnoff99Frosst-1.0.8', 'smirnoff99Frosst-1.0.1', 'ff14sb_off_impropers_0.0.2', 'ff14sb_off_impropers_0.0.4', 'ff14sb_off_impropers_0.0.3', 'ff14sb_off_impropers_0.0.1']
  EspalomaTemplateGenerator: ['espaloma-0.2.2']

I couldn't find more details about using espaloma in the documentation.
I would be really grateful for any suggestions and happy to run and share protein-peptide FEP benchmarks using espaloma.

@amin-sagar
Copy link
Author

Hello.
I tried using the new version 1.0.1
I change the forcefield and the charge method with

protocol_settings.forcefield_settings.small_molecule_forcefield = "espaloma-0.3.2.pt"
protocol_settings.partial_charge_settings.partial_charge_method = "espaloma"

Now,

complex_unit = list(complex_dag.protocol_units)[0]
complex_unit.run(dry=True, verbose=True)

gives me

INFO:	Preparing the hybrid topology simulation
INFO:	Parameterizing molecules
/home/amin/mambaforge/envs/openfe_env/lib/python3.11/site-packages/openfe/protocols/openmm_utils/charge_generation.py:91: RuntimeWarning: Using espaloma to assign charges is not well tested
  warnings.warn("Using espaloma to assign charges is not well tested",
/home/amin/mambaforge/envs/openfe_env/lib/python3.11/site-packages/dgl/heterograph.py:92: DGLWarning: Recommend creating graphs by `dgl.graph(data)` instead of `dgl.DGLGraph(data)`.
  dgl_warning(
/home/amin/mambaforge/envs/openfe_env/lib/python3.11/site-packages/openfe/protocols/openmm_utils/charge_generation.py:91: RuntimeWarning: Using espaloma to assign charges is not well tested
  warnings.warn("Using espaloma to assign charges is not well tested",
/home/amin/mambaforge/envs/openfe_env/lib/python3.11/site-packages/dgl/heterograph.py:92: DGLWarning: Recommend creating graphs by `dgl.graph(data)` instead of `dgl.DGLGraph(data)`.
  dgl_warning(
ERROR:	Source 'espaloma-0.3.2.pt' could not be read. If this is a file, ensure that the path is correct.
Looked in the following paths and found no files named 'espaloma-0.3.2.pt':
    /mnt/Comp_Chem/Projects/Tests/Test_OpenFE/Test_Bic2
    /home/amin/mambaforge/envs/openfe_env/lib/python3.11/site-packages/openforcefields/offxml
    /home/amin/mambaforge/envs/openfe_env/lib/python3.11/site-packages/openff/amber_ff_ports/offxml
    /home/amin/mambaforge/envs/openfe_env/lib/python3.11/site-packages/smirnoff99frosst/offxml
If 'espaloma-0.3.2.pt' is present as a file, ensure it is in a known SMIRNOFF encoding.
Valid formats are: ['XML']
Parsing failed while trying to parse source as a file with the following exception and message:
<class 'openff.toolkit.utils.exceptions.SMIRNOFFParseError'>
syntax error: line 1, column 0

INFO:	Using espaloma model found at /home/amin/.espaloma/espaloma-0.3.2.pt
INFO:	Requested to generate parameters for residue <Residue 0 (UNK) of chain 0>
INFO:	Generating a residue template for [H][O][c]1[c]([H])[c]([H])[c]([C]([H])([H])[C@@]2([H])[C](=[O])[N]([H])[C@]3([H])[C](=[O])[N]([H])[C@@]([H])([C]([H])([H])[C](=[O])----rest-of-the-SMILES--- using espaloma-0.3.2.pt
INFO:	Generating a system with charge method from-molecule and openff_unconstrained-2.0.0 to assign nonbonded parameters
INFO:	Requested to generate parameters for residue <Residue 0 (UNK) of chain 0>
INFO:	Generating a residue template for [H][O][c]1[c]([H])[c]([H])[c]([C]([H])([H])[C@@]2([H])[C](=[O])[N]([H])[C@]3([H])[C](=[O])[N]([H])[C@@]([H])([C]([H])([H])[C]----rest-of-the-SMILES--- using espaloma-0.3.2.pt
INFO:	Generating a system with charge method from-molecule and openff_unconstrained-2.0.0 to assign nonbonded parameters
INFO:	Creating hybrid system
INFO:	Setting force field terms
INFO:	Adding forces
INFO:	Hybrid system created
WARNING:	Warning: The openmmtools.multistate API is experimental and may change in future releases
/home/amin/mambaforge/envs/openfe_env/lib/python3.11/site-packages/mdtraj/core/topology.py:84: UserWarning: atom_indices are not monotonically increasing
  warnings.warn("atom_indices are not monotonically increasing")
INFO:	Creating and setting up the sampler
WARNING:	Warning: The openmmtools.multistate API is experimental and may change in future releases

This happens if I use espaloma0.3.2 (i.e. without .pt) as well. The simulation then proceeds as normal. If this warning can be ignored, it seems using espaloma works now. Is there a reason openfe first complains about the file?

Thanks.
Amin.

@amin-sagar
Copy link
Author

I tried copying the espaloma0.3.2.pt file to the simulation folder as this is one of the folders openFE searches. This also runs the simulations. However, I get

Parameterizing molecules
'utf-8' codec can't decode byte 0x80 in position 64: invalid start byte

Can this be ignored?
Thanks.
Amin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants