Closed TangYiChing closed 2 months ago
Looks like you are right. The codes for relaxation are originally copied from here, where the value of the tolerance is manually multiplied with the unit kcal/mol. About 4 months ago, the codes would throw an error maybe due to some updates of openmm, and thus I dropped the unit (here). I just tried again, and it now looks ok to recover the unit specification.
Further, I found that the codes I referenced above is actually a simplified version adapted from AlphaFold 2 amber relax, so maybe it will be helpful to take a look at the AF2 codes if you are still not sure about some configurations during the relaxation.
Just in case someone has the same issue, I modified the script to fix the issue:
from openmm import unit
def openmm_relax(pdb, out_pdb=None, excluded_chains=None, inverse_exclude=False):
tolerance = 2.39 * unit.kilojoules_per_mole/unit.nanometer
stiffness = 10.0 * unit.kilojoules_per_mole/unit.nanometer / (angstroms ** 2)
#tolerance = 2.39 * kilocalories_per_mole
#stiffness = 10.0 * kilocalories_per_mole / (angstroms ** 2)
Hi,
It seems that the openmm's Simulation.minimizeEnergy() method has a default unit set to kilojoule/model, while kilocalories_per_mole was used at the beginning of the openmm_relax function in the script relax. py. What would you suggest to make sure the units are consistent?
ref: (http://docs.openmm.org/7.3.0/api-python/generated/simtk.openmm.app.simulation.Simulation.html)