I tried obgen in openbabel/tools and it generated a reasonable 3D
structure. I tried to reproduce obgen in pybel with the same procedure,
which is
        pymol = pybel.readstring('smi', 'CCC(=O)OCC.CCC(=O)OCC.CC[O-]')
        mol = pymol.OBMol
        builder = ob.OBBuilder()
        mol.AddHydrogens(False, True)
        pff = pybel._forcefields['mmff94']
        pff.SteepestDescent(500, 1.0e-4)
        pff.WeightedRotorSearch(250, 50)
        pff.SteepestDescent(500, 1.0e-4)
It still generates structures with overlapping atoms. Can anybody help


On Thu, Feb 15, 2018 at 3:23 PM, Xianghai Sheng <xsh...@ucmerced.edu> wrote:

> Hi,
> I am trying to convert a smiles string into 3D structure in my program,
> but the 3D structure I get sometimes have overlapping atoms, especially
> when there are multiple fragments in the smiles string. An example is
> 'CC(=O)OCC.CC(=O)OCC.CC[O-]', and the code I wrote to generate 3D structure
> is:
>         mol = pybel.readstring('smi', 'CC(=O)OCC.CC(=O)OCC.CC[O-]')
>         mol.addh()
>         mol.make3D()
>         mol.write('gjf')
> However, when I do 'obabel test.smi -O test.gjf --gen3d' in the command
> line, I get a reasonable 3D structure. I can see how make3D() is
> implemented in pybel but I am wondering how it is implemented in obabel to
> treat the multi-fragment problem and how I can generate reasonable 3D
> structure in python.
> Best,
> Xianghai
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
OpenBabel-discuss mailing list

Reply via email to