Hi,
I would like to know if it was possible to force the internal OBMol copy in OBForceField to have the same partial charges as defined in mol2 file? And also the same for the atom types (that are of course also defined in GAFF)?
I put some python codes below as an example. That's how far I can go... Also I am not restricted to Python only. The solution can be also in C++ (if there is one).
Thanks for your help!
Jerome.
from openbabel import openbabel as ob obconv = ob.OBConversion() obconv.SetInFormat("mol2") OBMol = ob.OBMol() obconv.ReadFile(OBMol, "molecule.mol2") forcefield = ob.OBForceField.FindForceField("GAFF") forcefield.Setup(OBMol) forcefield.SetLogLevel(ob.OBFF_LOGLVL_HIGH) forcefield.SetLogToStdErr() forcefield.PrintFormalCharges() forcefield.PrintTypes() forcefield.GetAtomTypes(OBMol) forcefield.GetPartialCharges(OBMol) atom = OBMol.GetAtom(1) pairdata = ob.toPairData(atom.GetData("FFAtomType")) print(pairdata.GetAttribute(), pairdata.GetValue()) pairdata = ob.toPairData(atom.GetData("FFPartialCharge")) print(pairdata.GetAttribute(), pairdata.GetValue())