Hi Jan,

Not at the moment. The reaction code brings across mapped atoms in the
reactants along with anything reachable from them via a bond.
It's probably not that hard to add an option to allow this to happen, but
it seems like something of an unusual use case.

If you want to require that there's an additional fragment in the
reactants, you could do the following:
In [17]: mol = Chem.MolFromSmiles('COC.C=C')
    ...:
    ...: rxn_smarts = '([*:3].[C:1]=[C:2])>>([*:3].[*:1][*:2])'
    ...:
    ...: rxn = AllChem.ReactionFromSmarts(rxn_smarts)
    ...: ps = rxn.RunReactants((mol,))
    ...: new_mol = ps[0][0]
    ...: print(Chem.MolToSmiles(new_mol))
    ...:
    ...:
CC.COC

But that won't work if you don't have a second fragment there

-greg



On Mon, Jun 25, 2018 at 5:10 AM Jan Halborg Jensen <jhjen...@chem.ku.dk>
wrote:

> The following code returns ‘CC’, i.e. the COC molecule is removed. I had a
> look at the documentation for RunReactants and do not see a way to change
> this.
>
> Is there any way to get the code to return ‘COC.CC’?
>
> Thanks, Jan
>
>
> mol = Chem.MolFromSmiles('COC.C=C')
>
> rxn_smarts = '[C:1]=[C:2]>>[*:1][*:2]'
>
> rxn = AllChem.ReactionFromSmarts(rxn_smarts)
> ps = rxn.RunReactants((mol,))
> new_mol = ps[0][0]
> print Chem.MolToSmiles(new_mol)
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to