On 6 October 2012 16:13, Reinis Danne <[email protected]> wrote: > On Sat, Oct 06, 2012 at 01:06:51PM +0200, David van der Spoel wrote: >> Hi, >> >> I'm trying to implement an algorithm to determine bond orders into the >> GROMACS MD package, and looked at the open babel version. There seems to >> be a problem in the implementation however. If I convert the structure >> (from pdb or gaussian log file) of dimethyl-sulfoixde to sdf the bond >> order for the S=O bond is 1, whereas it should be 2. >> >> % babel -ipdb dmso.pdb -osdf dmso.sdf >> >> If I instead convert the structure to an InChi code, open babel print a >> warning message about the bond, and adds a Hydrogen instead and does not >> produce the correct InChi. There is apparently a mechanism that verifies >> that the sum of bond orders is even, but it is resolved in the wrong >> way, by adding a H instead of realizing there is a double bond. >> >> The sdf output is therefore inconsistent from the inchi output. >> >> Is there any way I can prevent H being added? > > After a quick look at the sources I see that the central > function in assigning bond orders is OBMol::PerceiveBondOrders() > which does multiple passes but the interesting one in this case > might be pass 4 which calls > OBBondTyper::AssignFunctionalGroupBonds(OBMol &mol) which relies > on data/bondtyp.txt for assigning bond orders to common > functional groups using SMARTS patterns. > > OB wiki SMARTS page [1] mentions that OB SMARTS implementation > "is known to not currently support Tetrahedral stereochemistry > involving a lone pair (e.g. at a sulfoxide)", but I'm not sure > if that is still the case. Anyhow that is an issue which can be > fixed.
This is still the case. Probably best to fix the SMARTS going forward if that indeed fixes the problem. Support for 'regular' tet stereo in SMARTS was only added in Nov of last year as far as I remember... > Adding this at the end of bondtyp.txt (where it says that it > might be useful to add sulfoxides) seems to fix the DMSO example > you have: > [#16D3]([*])([*])([#8D1]) 0 1 1 0 2 1 0 3 2 > > If this is not good enough to work in all cases and we are > restricted by SMARTS implementation then there is an option to > add more elaborate check in > OBBondTyper::AssignFunctionalGroupBonds() as is done now for > some other functional groups or just improve the SMARTS > implementation. Also there is an option to improve bond order > perception for bonds with 3rd period elements. > > I would like to know what more experienced people think about > this. > > > Reinis > > [1] http://openbabel.org/wiki/SMARTS > > ------------------------------------------------------------------------------ > Don't let slow site performance ruin your business. Deploy New Relic APM > Deploy New Relic app performance management and know exactly > what is happening inside your Ruby, Python, PHP, Java, and .NET app > Try New Relic at no cost today and get our sweet Data Nerd shirt too! > http://p.sf.net/sfu/newrelic-dev2dev > _______________________________________________ > OpenBabel-discuss mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/openbabel-discuss ------------------------------------------------------------------------------ Don't let slow site performance ruin your business. Deploy New Relic APM Deploy New Relic app performance management and know exactly what is happening inside your Ruby, Python, PHP, Java, and .NET app Try New Relic at no cost today and get our sweet Data Nerd shirt too! http://p.sf.net/sfu/newrelic-dev2dev _______________________________________________ OpenBabel-discuss mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
