[Rdkit-discuss] A couple of questions regarding ReactionFromSmarts
Open-Source Cheminformatics and Machine Learning
Brought to you by:
glandrum
From: James D. <J.D...@ve...> - 2010-06-03 18:18:45
|
Hi, First of all, I'd like to start by saying how much I've been enjoying exploring the functionality of RDKit - great job, Greg! I have a couple of questions regarding 'rdkit.Chem.AllChem.ReactionFromSmarts': (1) I see that the reaction objects can be created from MDL Reaction Files/Blocks - is there a way to do the reverse, and save a reaction object in MDL .rxn format? I tried using investigating the rxn.ToBinary() attribute, but didn't get very far... The reason I wanted to do this, is that I was trying to figure-out how to generate a form of the reaction object (generated from reaction SMARTS) that was suitable for converting into a 2D depiction of the transformation. (2) I know that reaction SMARTS isn't SMIRKS, but I have noticed some behaviour that I would not expect - however, this could be down to my SMARTS-naivety; my SMIRKS-naivety; or both! I initially tried the following: from rdkit import Chem from rdkit.Chem import AllChem rxn_smarts = '[!#1:1]-[NH:2]-[C:3](=[O:4])-[C,c:5]>>[!#1:1]-[C:3](=[O:4])-[NH:2]-[C,c :5]' sm = Chem.MolFromSmiles('CC(=O)NC') rxn = AllChem.ReactionFromSmarts(rxn_smarts) prods = rxn.RunReactants((sm,)) prod = Chem.MolToSmiles(prod[0][0]) This gives me prod = '[H]C(=O)NC' If I replace with <<rxn_smarts = '[!H:1]-[NH:2]-[C:3](=[O:4])-[C,c:5]>>[!H:1]-[C:3](=[O:4])-[NH:2]-[C,c:5 ]'>>, I get the behaviour I want - with prod = 'CNC(=O)C'. So I think I can get the behaviour I want, but was curious if I am using the SMARTS ! operator incorrectly in conjunction with atomic numbers, or whether this may be a bug? Kind regards James ______________________________________________________________________ PLEASE READ: This email is confidential and may be privileged. It is intended for the named addressee(s) only and access to it by anyone else is unauthorised. If you are not an addressee, any disclosure or copying of the contents of this email or any action taken (or not taken) in reliance on it is unauthorised and may be unlawful. If you have received this email in error, please notify the sender or pos...@ve.... Email is not a secure method of communication and the Company cannot accept responsibility for the accuracy or completeness of this message or any attachment(s). Please check this email for virus infection for which the Company accepts no responsibility. If verification of this email is sought then please request a hard copy. Unless otherwise stated, any views or opinions presented are solely those of the author and do not represent those of the Company. The Vernalis Group of Companies Oakdene Court 613 Reading Road Winnersh, Berkshire RG41 5UA. Tel: +44 118 977 3133 To access trading company registration and address details, please go to the Vernalis website at www.vernalis.com and click on the "Company address and registration details" link at the bottom of the page.. ______________________________________________________________________ |