Dear Hans, On Sun, Jul 31, 2011 at 1:28 PM, Hans De Winter <[email protected]> wrote: > Dear all, > > I browsed the rdkit-discuss mail archives but couldn't find anything helpful. > > I just wanted to have a couple of lines of example code (written in C++, not > python!) on how to transform a protonated -COOH group into a deprotonated one > -COO[-]. I experimented with the > RDKit::RxnSmartsToChemicalReaction("[C:1](=[O:2])[OH:3]>>[C:1](=[O:2])[OH0;-:3]") > function, but I get stuck on how to proceed further, e.g. defining the > reactants and processing the products. > > Any help?
There are a couple of ways to solve this particular problem, the most flexible of which is certainly using a reaction, as you suggest. About the only examples for how to use ChemicalReactions from C++ are in the testing code, but that's not really the best place to learn. I just added a simple example to the GettingStarted demo that should help: http://rdkit.svn.sourceforge.net/viewvc/rdkit/trunk/Code/Demos/RDKit/GettingStarted/sample.cpp?revision=1814&view=markup I would encode your reaction as: "[C:1](=[O:2])[OH:3]>>[C:1](=[O:2])[O-:3]" Note that each product of the reaction will only have a single carboxylic acid protonated. You can test if any additional acids are available by either checking how long the products vector is (the easy way) or by calling isMoleculeReactantOfReaction() on the product (the more general way). I hope this helps, -greg Note that using a reaction will only d ------------------------------------------------------------------------------ BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA The must-attend event for mobile developers. Connect with experts. Get tools for creating Super Apps. See the latest technologies. Sessions, hands-on labs, demos & much more. Register early & save! http://p.sf.net/sfu/rim-blackberry-1 _______________________________________________ Rdkit-discuss mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

