Hi,

Don't worry, in my real cases I'm using [OH:1][C:2] (or similar depending
on the reaction in question). I guess I made my simplest possible example
too simple to be a useful communication. Adding the ;D1 will also protect
against molecules specified as [1H]OC but hopefully my third party input
data doesn't have anything so odd. My intuition was that [OH]C [H]OC and
[2H]OC were the same in terms of things like the degree of the oxygen but
playing around with daylight's tools tells me I was wrong.

I guess then the original question has been answered by the pragmatic
principle that states: "hydrogens are not atoms iff they are of unspecified
isotope". In the deuterium case we have a hydrogen atom attached to the
oxygen that is not mentioned in the reaction and so, like any atom, is
carried across with the mapped atoms. In the [OH] case we have an oxygen
with a property and that property need not be conserved by reaction
transforms, and so isn't. And in the [H]O case it is internally converted
to an [OH] before the reaction takes place.

Thanks once again for your time,

Toby Wright

--
InhibOx Ltd


On 8 April 2014 02:35, Greg Landrum <greg.land...@gmail.com> wrote:

> Hi Toby,
>
> On Mon, Apr 7, 2014 at 3:37 PM, Toby Wright <toby.wri...@inhibox.com>wrote:
>
>>
>> Noticed something odd but I'm not confident enough with reaction SMARTS
>> to say it's a bug. I'm reacting with an OH, leading to the oxygen losing
>> the hydrogen and gaining a second bond. For example:
>>
>> > rxn = AllChem.ReactionFromSmarts("[O:1]>>C[O:1]")
>> > mol = Chem.MolFromSmiles("OC")
>> > p = rxn.RunReactants((mol,))[0][0]
>> > Chem.SanitizeMol(p)
>> rdkit.Chem.rdmolops.SanitizeFlags.SANITIZE_NONE
>> > Chem.MolToSmiles(p)
>> 'COC'
>>
>> So far so good. Now to add explicit hydrogens to the oxygen. If mol is
>> "[OH]C" or "[H]OC" the same behaviour as above happens. However if it is
>> "[2H]OC" we run into:
>>
>> ValueError: Sanitization error: Explicit valence for atom # 1 O, 3, is
>> greater than permitted
>>
>>
> because the deuterium is being preserved whereas in the other cases the
>> hydrogen is discarded. I can't find anything in the SMARTS documentation to
>> suggest that this is the correct behaviour so I'm going to suggest that if
>> the [H] was being discarded by the reaction then so should the [2H].
>>
>
> You've diagnosed what is happening correctly: the RemoveHs() functionality
> does not remove the [2H] since that's not something that can be replaced by
> inspecting the valence of the O atom.
>
> That's not the real problem here though. The reaction above also won't
> work for ethers or anything with a double bond to an O. What you more
> likely want is something like:
> rxn = AllChem.ReactionFromSmarts("[OH;D1:1]>>C[O:1]")
> this will match CO, but not C=O, COC, or CO[2H].
> If you want the reaction to also apply to the deuterated species, which
> you say later in your email you don't, I think you're going to have to
> AddHs to the molecules before calling RunReactants() and explicitly include
> the H in the reaction query. Or, of course, you could add as second
> reaction to deal with Hs that are actually present.
>
> -greg
>
>
>
>> In either case it's not a problem for me as I have no particular interest
>> in Deuterium containing molecules so I don't need a workaround or quick
>> fix. I just happened across the behaviour and thought it worth reporting.
>>
>> Yours,
>>
>> Toby Wright
>>
>> --
>> InhibOx Ltd
>>
>>
>> ------------------------------------------------------------------------------
>> Put Bad Developers to Shame
>> Dominate Development with Jenkins Continuous Integration
>> Continuously Automate Build, Test & Deployment
>> Start a new project now. Try Jenkins in the cloud.
>> http://p.sf.net/sfu/13600_Cloudbees_APR
>> _______________________________________________
>> Rdkit-discuss mailing list
>> Rdkit-discuss@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>>
>>
>
------------------------------------------------------------------------------
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment 
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to