> > > Yes - it'll be there in the next release though. > > In the meanwhile you need to use the Gen3D Operation with code > something similar to the following Python code: > > gen3d = openbabel.OBOp.FindType("Gen3D") > gen3d.Do(myOBMol) > > Hello Noel, and thank you very much for the advice! It sort of works now.
The following code in Java produces some sort of 3D coordinates, with errors that the parameter files for the MM geometry optimization cannot be found (I am guessing that's because I've copied the openbabel jar into my project's lib folder). import org.openbabel.*; public class Main { public static void main(String[] args) throws Exception { System.loadLibrary("openbabel_java"); OBConversion conv = new OBConversion(); OBMol mol = new OBMol(); conv.SetInFormat("smi"); conv.ReadString(mol, "C(Cl)(=O)CCC(=O)Cl"); conv.SetOutFormat("sdf"); OBOp gen3d = OBOp.FindType("Gen3D"); gen3d.Do(mol); System.out.print(conv.WriteString(mol)); } } The output produced is as follows. OpenBabel05091014533D 12 11 0 0 0 0 0 0 0 0999 V2000 1.0000 0.0000 0.0000 C 0 0 0 0 0 0.1290 1.5086 0.0000 Cl 0 0 0 0 0 0.3862 -1.0631 0.0000 O 0 0 0 0 0 2.4820 0.0000 0.0000 C 0 0 0 0 0 2.9894 1.4328 0.0000 C 0 0 0 0 0 4.4714 1.4328 0.0000 C 0 0 0 0 0 5.0852 0.3697 0.0000 O 0 0 0 0 0 5.3424 2.9414 0.0000 Cl 0 0 0 0 0 2.8524 -0.5242 -0.8561 H 0 0 0 0 0 2.8337 -0.4977 0.8795 H 0 0 0 0 0 2.6189 1.9570 0.8561 H 0 0 0 0 0 2.6377 1.9305 -0.8795 H 0 0 0 0 0 1 4 1 0 0 0 1 3 2 0 0 0 1 2 1 0 0 0 4 5 1 0 0 0 4 9 1 0 0 0 4 10 1 0 0 0 5 6 1 0 0 0 5 11 1 0 0 0 5 12 1 0 0 0 6 8 1 0 0 0 6 7 2 0 0 0 M END $$$$ ============================== *** Open Babel Error in OpenBabel::OBForceFieldMMFF94::ParseParamFile Cannot open parameter file ============================== *** Open Babel Error in OpenBabel::OBForceFieldUFF::ParseParamFile Cannot open UFF.prm ============================== *** Open Babel Error in OpenBabel::OBForceFieldUFF::SetTypes Cannot open UFF.prm Next, I will compare the 3D geometries generated by CDK and those generated by OpenBabel by overlaying the two resultant geometries with PM6 and B3LYP/6-311+G(d,p) optimized geometries (with G09) and calculating the RMSD for a few hundred compounds, for each approach to see which method is most accurate. I am guessing you guys would bet that both should be very similar, as the methodology used by OpenBabel and CDK is essentially the same? In any case, thank you for the help, I don't need to do it through system calls and writing to disk now. Regards, Leonid Chepelev
------------------------------------------------------------------------------
_______________________________________________ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss