GHeinzelmann / BAT.py

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

Example Crashes #30

Closed tkram01 closed 1 year ago

tkram01 commented 1 year ago

Hello,

I am trying to run the example for the 2.1 release using Amber20 and am getting a crash.

$AMBERHOME/bin/amber.python BAT.py -i input-dd.in -s equil

Traceback (most recent call last):
  File "/data/BAT.py-2.1/BAT/BAT.py", line 581, in <module>
    build.create_box(comp, hmr, pose, mol, num_waters, water_model, ion_def, neut, buffer_x, buffer_y, buffer_z, stage, ntpr, ntwr, ntwe, ntwx, cut, gamma_ln, barostat, receptor_ff, ligand_ff, dt, dec_method)
  File "/data/BAT.py-2.1/BAT/lib/build.py", line 1120, in create_box
    box_volume = scripts.box_volume()
  File "/data/BAT.py-2.1/BAT/lib/scripts.py", line 81, in box_volume
    box_volume=float(ratio * x_axis * y_axis * z_axis)
UnboundLocalError: local variable 'ratio' referenced before assignment

This is caused by this error:

/amber/bin/teLeap: Fatal Error!

Atom .R<LIG 1>.A<C9 13> has force field coordination 4
       but only 3 bonded neighbors.
       The cause may be an incorrect atom type, and
       the effect may be a crash very soon (if running interactively).
tkram01 commented 1 year ago

Also happens with HEAD

GHeinzelmann commented 1 year ago

Hi, thanks for your interest in the BAT code. The first message appears because there was a problem in the solvation step, which is why the “ratio” variable is not defined.

The message below suggests that the issue comes from the parameters assigned to the ligand, or the protonation step. Are you using the system from the tutorial or a new one?

tkram01 commented 1 year ago

I'm using the system from the tutorial.

tkram01 commented 1 year ago

This is being caused by using too old a version of open babel. Upgrading to 2.4.1 fixed the issue.

quantaosun commented 1 year ago

I also used obabel=2.4.1, but the error still there. Any one any thoughts ?

GHeinzelmann commented 1 year ago

Hi. I would suggest taking a look at the ligand after the protonation step with obabel, which is inside the build_files folder inside the equil folder. You can then check if the protonation looks strange in the atoms where the error appeared.

Alternatively, you can attempt to protonate and obtain the parameters for the ligand using obabel/antechamber separately from the program workflow. The obtained parameters can then be added to the program workflow, as explained in the User Guide.