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

The position constraint of 0.1 angstrom did not work as expected #8

Closed
AndChenCM opened this issue May 27, 2024 · 0 comments
Closed

Comments

@AndChenCM
Copy link
Contributor

Dear authors,

The idea to do a small local relaxation before computing strain energies to fix some inconsistency is great, but the current implementation does not seem to work as expected. You set the max displacement of atoms to be 0.1 Å using the RDKit UFFAddPositionConstraint function here, with forceConstant=1. However, if you check the displacement of atoms using the following code with a regular ligand
6ten_ligand.txt (change the suffix to sdf before testing), you will find the displacement is above the set threshold:

from rdkit import Chem
from rdkit.Chem import ChemicalForceFields

m = Chem.SDMolSupplier('6ten_ligand.sdf')[0]
m = Chem.AddHs(m, addCoords=True)
ff = ChemicalForceFields.UFFGetMoleculeForceField(m)
conf = m.GetConformer()
p = conf.GetAtomPosition(1)
ff.UFFAddPositionConstraint(1, maxDispl=0.1, forceConstant=1)
r = ff.Minimize()
q = conf.GetAtomPosition(1)
assert((p - q).Length() < 0.1)

I did some searches into this problem, and find that the force constant needs to be large enough when the displacement of the atom is larger than maxDispl, so that when the atom moves too far it gets a great energy penalty during minimization. The solution is simply changing forceConstant to 1e5 like what is done in a RDKit test script.

I have created a PR to fix this issue, along with some minor modifications. Please check if it is appropriate.

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

1 participant