GHeinzelmann / BAT.py

The Binding Affinity Tool (BAT.py) is a fully automated tool for absolute binding free energy calculations on protein-ligand systems, compatible with the AMBER and OpenMM simulation packages.
MIT License
166 stars 45 forks source link

Missing build_files/lig.pdb error when running OpenMM FE simulation with default config #34

Closed NiklasTR closed 5 months ago

NiklasTR commented 5 months ago

Dear @GHeinzelmann - thank you for sharing this ABFE code. I am currently learning more about ABFE methods and decided to try the BAT.py suite this long weekend.

After installing OpenMM and all other required dependencies I started equilibrating pose0 from the default example specified in input-sdr-openmm.in. This process ran without an issue and I performed local OpenMM simulations on an RTX4090 within a couple minutes of all 9 segments. In the next step, the fe simulation, I am running into the following issue:

(abfe) root@bd6f9c20ec44:/BAT.py/BAT# python BAT.py -i input-sdr-openmm.in -s fe
lambda values: [0.009219682876640378, 0.0479413718147626, 0.11504866290284765, 0.20634102285669126, 0.31608425050090994, 0.43738329574426554, 0.5626167042557344, 0.6839157494990901, 0.7936589771433087, 0.8849513370971523, 0.9520586281852375, 0.9907803171233596]
Gaussian weights: [0.02358766819325601, 0.05346966299765944, 0.08003916427167306, 0.10158371336153282, 0.11674626826917732, 0.12457352290670134, 0.12457352290670134, 0.11674626826917732, 0.10158371336153282, 0.08003916427167306, 0.05346966299765944, 0.02358766819325601]
['m', 'n', 'e', 'v']
sdr
[0.0, 0.1, 0.24, 0.56, 1.33, 3.16, 7.5, 17.78, 42.17, 100.0]
[0.009219682876640378, 0.0479413718147626, 0.11504866290284765, 0.20634102285669126, 0.31608425050090994, 0.43738329574426554, 0.5626167042557344, 0.6839157494990901, 0.7936589771433087, 0.8849513370971523, 0.9520586281852375, 0.9907803171233596]
4.0
0.9
Error: 'md08.dcd': No such file or directory
Error: Could not set up input trajectory 'md08.dcd'.
        1 errors encountered reading input.
Error: Error(s) occurred during execution.
Error: 'md08.dcd': No such file or directory
Error: Could not set up input trajectory 'md08.dcd'.
        1 errors encountered reading input.
Error: Error(s) occurred during execution.
Error: 'md08.dcd': No such file or directory
Error: Could not set up input trajectory 'md08.dcd'.
        1 errors encountered reading input.
Error: Error(s) occurred during execution.
Error: 'md08.dcd': No such file or directory
Error: Could not set up input trajectory 'md08.dcd'.
        1 errors encountered reading input.
Error: Error(s) occurred during execution.
Setting up pose0
window: t00 weight: 100.0
Traceback (most recent call last):
  File "BAT.py", line 840, in <module>
    anch = build.build_dec(fwin, hmr, mol, pose, comp, win, water_model, ntpr, ntwr, ntwe, ntwx, cut, gamma_ln, barostat, receptor_ff, ligand_ff, dt, sdr_dist, dec_method, l1_x, l1_y, l1_z, l1_range, min_adis, max_adis, ion_def, other_mol, solv_shell)
  File "/BAT.py/BAT/lib/build.py", line 627, in build_dec
    shutil.copy('../../build_files/%s.pdb' %mol.lower(), './')
  File "/root/miniforge3/envs/abfe/lib/python3.7/shutil.py", line 248, in copy
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/root/miniforge3/envs/abfe/lib/python3.7/shutil.py", line 120, in copyfile
    with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: '../../build_files/lig.pdb'

The first issue is an Error re: a missing md08.dcd files. I am running this script from the BAT subdirectory. The trajectories of the equilibrated complexes are located in equal/pose0. I double checked that all dcd files for the 9 components are there. I also moved the dcd files into /BAT2.py/BAT in order to be extra sure that there is not a path issue.

The second issue is a missing lig.pdb file in the build_files directory. When checking the github repo, I could not find such a file and I did not find a related line in the BAT2 input configuration file.

Is this an error something you have seen before with OpenMM in BAT2? I am happy to share a docker image to more easily reproduce the issue if that is helpful.

Thank you!

GHeinzelmann commented 5 months ago

Hi Niklas, thanks for your interest in the BAT code. Even though you are using a powerful GPU, the equilibration step should take more than a couple of minutes, especially the last simulation which has a total of 60 nanoseconds. From the error files it appears that the trajectory file from OpenMM was not written, so maybe something went wrong with the equilibration simulations. Could you check the OpenMM equilibration output files (output-xx.dat) for any errors? Could be a compatibility problem with the latest OpenMM version, so it would be nice to check. I am also making a few tests here. Thanks

GHeinzelmann commented 5 months ago

No response and it worked fine in my tests, thus I will consider this issue solved.

NiklasTR commented 5 months ago

Hi @GHeinzelmann - thank you for your prompt response 2 weeks ago. I am still looking into resolving this issue but ran into some delays. Closing this issue for now makes sense. I will follow up once I have the issue resolved on my end.