choderalab / openmoltools

An open set of tools for automating tasks relating to small molecules
MIT License
63 stars 30 forks source link

`generateOEMolFromTopologyResidue` failing in perses tests #295

Closed hannahbrucemacdonald closed 4 years ago

hannahbrucemacdonald commented 4 years ago

We are seeing the traceback:

2020-02-11T21:51:20.0083920Z File "/usr/share/miniconda/envs/test/lib/python3.6/site-packages/simtk/openmm/app/forcefield.py", line 1135, in createSystem 2020-02-11T21:51:20.0084804Z if generator(self, res): 2020-02-11T21:51:20.0085981Z File "/usr/share/miniconda/envs/test/lib/python3.6/site-packages/openmoltools/forcefield_generators.py", line 514, in gaffTemplateGenerator 2020-02-11T21:51:20.0087319Z molecule = generateOEMolFromTopologyResidue(residue) 2020-02-11T21:51:20.0088564Z File "/usr/share/miniconda/envs/test/lib/python3.6/site-packages/openmoltools/forcefield_generators.py", line 148, in generateOEMolFromTopologyResidue 2020-02-11T21:51:20.0089508Z infile = open(ac_output_filename) 2020-02-11T21:51:20.0090896Z FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmp85cyac34/molecule-after-bond-perception.ac'

In our pipeline. It seems that in generateOEMolFromTopologyResidue the .mol2 that is generated doesn't have bond orders in, which causes issues for antechamber.

Running:

from perses.utils.openeye import smiles_to_oemol from openeye import oechem mol = smiles_to_oemol('CCCC') mol2_input_filename = 'molecule-before-bond-perception.mol2' ofs = oechem.oemolostream(mol2_input_filename) oechem.OEWriteMol2File(ofs, mol)

Does work though, so not sure why the oemol in generateOEMolFromTopologyResidue doesn't...

hannahbrucemacdonald commented 4 years ago

calling molecule.GetDimension() in the function returns 0 which seems to mean that it doesn't have 3D-ness... not sure if this might change the way the mol2 is generated

hannahbrucemacdonald commented 4 years ago

^ SetDimension() doesn't seem to fix anything

hannahbrucemacdonald commented 4 years ago

Using bondtype, which is commented out here: https://github.com/choderalab/openmoltools/blob/1473c939e320732dcf4234d56cbbf0e465a30706/openmoltools/forcefield_generators.py#L141 seems to work. Not sure what the difference is between antechamber and bond order, but

-j 2 in antechamber looks like it should be analogous to -j full in bondtype. Antechamber complains about open valence (presumably because the C in the ring is sp2 rather than sp3). I've attached the molecule-before-bond-perception.mol2 that doesn't work with antechamber, and the molecule-after-bond-perception.ac that is generated by bondtype inputs.zip

hannahbrucemacdonald commented 4 years ago

It seems that @zhang-ivy spotted this in 2020, issue #279