openforcefield / openff-bespokefit

Automated tools for the generation of bespoke SMIRNOFF format parameters for individual molecules.
https://docs.openforcefield.org/bespokefit
MIT License
61 stars 9 forks source link

How is cpmd being parameterised when it failed in bespokefit #293

Closed xiki-tempula closed 1 year ago

xiki-tempula commented 1 year ago

Description

So I want to use bespokefit to parameterised like 50 cpmds. I use openff-bespoke executor launch to launch an executor and then use openff-bespoke executor submit to submitted these 50 cpmds. However, I found that one cpmd failed out of these 50 cpmds when checking the status via openff-bespoke executor list. The cpmd failed via RuntimeError: ConvergenceFailure: The optimization failed to converge. by the way. Then use the openff-bespoke combine to generate the offxml with the successful 49 cpmds and parameterised these 50 cpmds with this offxml. However, it seems that I could successfully parameterised all 50 cpmds, including the failed cpmd.

I wonder how is this failed cpmd being parameterised? For the torsion in that failed cpmd that is not derived successfully by bespokefit. Do I get an empty torsion (like zero force constant), or do I get a openFF 2.0 torsion (which is the starting ff)? Thanks.

jthorton commented 1 year ago

Hi @xiki-tempula, Bespokefit appends any newly derived torsions to the bottom of the proper torsion section of the base force field specified in the settings. In this case, you have OpenFF-2 + BespokeFit torsions. For your molecule that failed you should see it has the base OpenFF torsions you can check this by applying the torsions to the molecule using the following and checking thesmarts strings (BespokeFit torsions have large and complex patterns). If the molecule shared some torsions with another molecule in the set, it might have a mix of bespoke and base torsions.


from openff.toolkit import Molecule, ForceField

mol = Molecule.from_file("failed_compound.sdf")
ff = ForceField("bespokefit_ff.offxml")

labels = ff.label_molecules(mol.to_topology())[0]["ProperTorsions"]
for atoms, parameter in labels.items():
    print(atoms, parameter)
xiki-tempula commented 1 year ago

I see. Thanks.