Hi Bob,
On Thu, Sep 11, 2014 at 8:03 AM, Bob Funchess <[email protected]> wrote:
>
> Hi all,
>
> We have been writing an enumeration engine in C# using the wrappers to
call RDKit routines, and have run into an issue that keeps recurring.
>
> Essentially, the problem is that if a user defines a transform in which
the explicit bond order of an atom increases, then we get a
SanitizeMolException when calling runReactants, along the lines of
>
> “Explicit valence for atom # 1 C, 5, is greater than permitted.”
>
> Is there some easy way around this issue? It would be ideal if one of the
hydrogens were removed to make room for the new bond, but even simply
returning the unsanitized product would be okay, since we could then
attempt to deal with it in some other way.
ChemicalReaction.runReactants() should not be sanitizing the products of
the reaction, so this error shouldn't be coming from that code. Could it be
that you are calling sanitizeMol() somewhere in your own code?
A general question: there shouldn't normally be problems in sanitization
unless there are hydrogens in your molecular graph, has had "explicit" Hs
added to it (by, for example, constructing molecules from SMILES like
"[CH3]O"), or if the C really does end up with too many bonds.
If you want to work with non-hydrogen suppressed graphs, I'd suggest
including the Hs directly in your reaction... something like this:
In [21]: rxn = AllChem.ReactionFromSmarts('[H][C:1]-[O:2][H]>>[C:1]=[O:2]')
In [22]: ps = rxn.RunReactants((Chem.AddHs(Chem.MolFromSmiles('CO')),))
In [23]: Chem.SanitizeMol(ps[0][0])
Out[23]: rdkit.Chem.rdmolops.SanitizeFlags.SANITIZE_NONE
In [24]: Chem.MolToSmiles(ps[0][0])
Out[24]: '[H]C([H])=O'
Best,
-greg
------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss