On 2 Dec 2019, at 11:32, Greg Landrum <greg.land...@gmail.com<mailto:greg.land...@gmail.com>> wrote:
HI Peter, On Mon, Dec 2, 2019 at 10:11 AM Peter Schmidtke <peter.schmid...@discngine.com<mailto:peter.schmid...@discngine.com>> wrote: I wanted to know whether there was an easy way in rdkit to decompose a product to its reactants using an rdkit smarts-based reaction? Basically I’m looking for the runReactants function but the other way around. Is there any chance this would work with a reverted reaction or is this just wishful thinking? Nice question. And, as with any good question, the answer is: "It depends". It's pretty straightforward to reverse a reaction by creating a new one and copying the reactants/products from your example in as products/reactants in the new reaction. This will work as long as you don't use query features in the specification of the reaction. Yep I saw I could easily redefine a reversed reaction. What I couldn’t find was that this also sort of works for reaction smarts. Unfortunately it stops working sensibly pretty quickly once you introduce query features. Here's a gist showing some of this. https://gist.github.com/greglandrum/5ca4eebbe78f4d6d9b8cb03f401ad9cd I'm having a hard time coming up with even a hack solution that isn't a ton of work, but I'll think about it a bit more. There may be a way to make this work on the C++ side. To help with this, can you give a specific example of the kind of reaction you'd like to reverse? We’re currently working on an algorithm to make that work in a purely pythonic way (for now). Let’s see if we can come up with something sensible and good to have your simple example. It is exactly the type of use case we have in mind. For instance, take these reactions here (maybe they’d need a bit of adaptation & refinement for rdkit) : https://pubs.acs.org/doi/abs/10.1021/ci200379p (SI : https://pubs.acs.org/doi/suppl/10.1021/ci200379p/suppl_file/ci200379p_si_002.pdf) . thanks a lot for the gist, didn’t know it was possible this way already :) Peter
_______________________________________________ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss