Geoff, I'm interested in this topic myself, and I had a similar discussion with Noel [1]. There's an aspect I'm not sure I understand correctly.
My understanding of a simulated chemical reaction, being from a RXN scheme or directly from SMARTS, is that its definition is based on the graph structure of reagents and products, and not on lookup in a previously defined database. In fact, I know you can hack and use non-existent chemical reactions in Indigo like the following: R1-Cu + Fe-R2 -> R1-R2 and it works just fine. From what I can read online, RDKit works the same way [1] Again, unless I'm totally wrong, this seems to be achieved by defining a graph transformation which joins the two structures and relies on SMARTS regex substituion. When trying to use the OBChemTsfm, though (see the Python code in [1]), I was only able to change bond orders and valences, while I had no success with transformations implying a change in the number of atoms. I'm not extremely confident on the patterns I've used, but from your reply and Noel's it doesn't seem that the issue. Could you please clarify this? Thanks, S [1] http://forums.openbabel.org/Using-RXN-with-OBReaction-and-OBChemTsfm-Python-td4657628.html [2] http://www.rdkit.org/docs/GettingStartedInPython.html#chemical-reactions -- Stefano Forli, PhD Staff Scientist Molecular Graphics Laboratory Dept. of Integrative Structural and Computational Biology, MB-112F The Scripps Research Institute 10550 North Torrey Pines Road La Jolla, CA 92037-1000, USA. tel: (858) 784-2055 fax: (858) 784-2860 email: fo...@scripps.edu http://www.scripps.edu/~forli/ ________________________________________ From: Geoffrey Hutchison [geoff.hutchi...@gmail.com] Sent: Saturday, August 30, 2014 12:19 PM To: Jeff Janes Cc: openbabel-discuss@lists.sourceforge.net Subject: Re: [Open Babel] Applying reactions in obabel I can find documentation and examples on reading reactions in one format and saving them to a different one using obabel or language bindings, but I can't find anything for applying a reaction SMARTS to a molecule and obtaining the result. You want the OBChemTsfm class: http://openbabel.org/api/2.3/classOpenBabel_1_1OBChemTsfm.shtml For example, If I want to convert all carboxyl groups in an input file to chlorides (throwing away the COOH), is that easy to do in obabel or in python? Is there some examples or documentation on this that I am missing? I know that OBChemTsfm is available in the Python bindings. You'd take an expression like this: [nD2:1]1c[nH]cc1 >> [n+:1]1c[nH]cc1 I haven't tried this in Python, but you'd do something like this (written in C++) OBChemTsfm rxn; rxn.Init("[nD2:1]1c[nH]cc1", "[n+:1]1c[nH]cc1"); rxn.Apply(mol); The bigger problem is building up an open database, but if there are interested parties I think a pool of reactions would be very interesting for many uses. Hope that helps, -Geoff ------------------------------------------------------------------------------ Slashdot TV. Video for Nerds. Stuff that matters. http://tv.slashdot.org/ _______________________________________________ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss