Thanks Hongbin, The problem is that there are two cases aliphatic and aromatic. If I add the explicit hydrogen like you suggest then the aliphatic case has the incorrect number of hydrogens. My question is how to contain the generality of the chemistry in the reaction smarts. Is that possible with the reaction smarts syntax, or should I just define two reactions, do a substructure search and apply the appropriate reaction for every building block I want to deprotect? Thanks again, Sean
From: Hongbin Yang Sent: Wednesday, October 2, 2019 10:09 PM To: Sean Stromberg Cc: rdkit-discuss@lists.sourceforge.net Subject: Re:[Rdkit-discuss] Boc Deprotection Hi Sean, The problem in this case is that in a non-kekulized SMILES, an aromatic nitrogen atom binding with a hydrogen should be symbolised as “[nH]”. The “H” is compulsory. So you can change your reaction into "[#7:1]C(=O)OC(C)(C)C>>[#7H:1]" Best, Hongbin Yang 杨弘宾, Ph.D. Research: Toxicophore and Chemoinformatics On 10/3/2019 04:53,Sean Stromberg<sean.stromb...@eighteenfiftynine.com> wrote: Dear Rdkit Community, I’m trying to learn reaction smarts with rdkit and would appreciate some clarification. I’m doing Boc deprotection on a large set of building blocks and the way I’ve defined my reaction, the number of hydrogens added after the deprotection is always wrong. I normally can call UpdatePropertyCache() to fix this, but when it’s an indole that is being deprotected when I call UpdatePropertyCache() it raises: ValueError: Sanitization error: Can't kekulize mol. Unkekulized atoms: 0 1 2 3 4 5 7 8 10 I know how to add hydrogens explicitly in the reaction smarts but not with reference to the nitrogen’s original bonds. Can I add explicit hydrogens conditionally? What is the best way to obtain results from the two reactant cases in my example code? from rdkit import Chem from rdkit.Chem import AllChem reaction = AllChem.ReactionFromSmarts('[#7:1]C(=O)OC(C)(C)C>>[#7:1]') reactants_1 = [Chem.MolFromSmiles('CC(C)(C)OC(=O)NC1(C(=O)O)CCN(C(=O)OCC2c3ccccc3-c3ccccc32)CC1')] display(Draw.MolToImage(reactants_1[0], legend='mol_1')) products = reaction.RunReactants(reactants_1) product = products[0][0] display(Draw.MolToImage(product, legend='mol_1 deprotected')) product.UpdatePropertyCache() display(Draw.MolToImage(product, legend='mol_1 deprotected and updated')) reactants_2 = [Chem.MolFromSmiles('CC(C)(C)OC(=O)n1cc(C[C@@H](NC(=O)OCC2c3ccccc3-c3ccccc32)C(=O)O)c2ccccc21')] display(Draw.MolToImage(reactants_2[0], legend='mol_2')) products = reaction.RunReactants(reactants_2) product = products[0][0] display(Draw.MolToImage(product, legend='mol_2 deprotected')) product.UpdatePropertyCache() display(Draw.MolToImage(product, legend='mol_2 deprotected and updated')) Thanks for any clarification you can provide! Sincerely, Sean Stromberg P.S. Does anyone know why I get so many products when I run these reactions?
_______________________________________________ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss