Dear Abhinav,
On Mon, Jun 8, 2009 at 9:53 PM, Abhinav Chawade<[email protected]> wrote:
> Hello Greg
>
> The thing is, generic reaction transform using SMIRKS takes only 2
> arguments. The reaction itself and chemical which it has to process. I am
> not sure how I can pass a SMIRKS string and process chemicals with it. Say
> this SMIRKS
> [*:1]-[O]-[*:2] >> [*:1]-[N]-[*:2]. This simply maps Oxygen to Nitrogen.
> SMARTS don't have numeric capability I suppose. Take a look at this.
> http://cdb.ics.uci.edu/cgibin/reaction/ReactionProcessorWeb.psp
> Is it possible to create a SMIRKS engine on a SMARTS engine?
I think you misunderstood my answer. The RDKit can handle chemical
reactions, it just doesn't encode them with SMARTS, but instead a
variant of SMARTS that I've called Reaction SMARTS. Here's a
demonstration with your reaction:
>>> from rdkit.Chem import AllChem
>>> rxn = AllChem.ReactionFromSmarts('[*:1]-[O]-[*:2]>>[*:1]-[N]-[*:2]')
>>> r1 = AllChem.MolFromSmiles('c1cccn1OC')
>>> ps = rxn.RunReactants((r1,))
>>> AllChem.MolToSmiles(ps[0][0])
'CNn1cccc1'
-greg