There isn't currently any easy way to do this. One workaround that could
make the manual stuff a bit less painful would be find those Hs, convert
them into Ds, call RemoveHs(), and then convert the Ds back into Hs.
It seems like it does make sense to modify the RemoveHs() function:
https://github.com/rdkit/rdkit/issues/1419
As mentioned in the issue report, this will lead to this oddity:
>>> Chem.CanonSmiles('C/C(F)=N/[H]')
'[H]/N=C(/C)F'
>>> Chem.CanonSmiles('C/C(F)=N[H]')
'CC(=N)F'
I can't think of a precedent for that in the RDKit, but I think it's better
to add that oddity than to modify all of the code managing cis/trans double
bonds to be able to handle using the implicit H.
Does anyone have objections to this approach to fixing the problem?
As an aside, while looking into this I noticed that removeHs() also removes
H atoms that have atom map information. This probably also shouldn't
happen. That's now here: https://github.com/rdkit/rdkit/issues/1420
-greg
On Thu, May 18, 2017 at 2:54 AM, Brian Cole <[email protected]> wrote:
> Is there a recommended way in RDKit to preserve hydrogens necessary for
> representing cis/trans stereochemistry of imines?
>
> For example, given the attached SDF I need to maintain explicit hydrogens
> in the output SMILES string to maintain the imine cis/trans
> stereo-chemistry.
>
> mol = Chem.ForwardSDMolSupplier(open('ZINC23714507.sdf'),
> removeHs=False).next()
> print(Chem.MolToSmiles(mol, True))
>
> Yields the correct but ugly smiles:
> [H]/N=C(/[H])C([H])([H])N(C([H])([H])/C([H])=N\[H])S(=O)(=
> O)c1c([H])c([H])c(C(=O)N([H])c2sc3c(c2C(=O)N([H])C([H])([H]
> )[H])C([H])([H])C([H])([H])[N+]([H])(C([H])([H])C([H])([H])
> C([H])([H])[H])C3([H])[H])c([H])c1[H]
>
> RemoveHs is too heavy a hammer as it removes my cis/trans stereo:
>
> print(Chem.MolToSmiles(Chem.RemoveHs(mol), True))
>
> CCC[NH+]1CCc2c(sc(NC(=O)c3ccc(S(=O)(=O)N(CC=N)CC=N)cc3)c2C(=O)NC)C1
>
>
> I can write the explicit loop myself to only remove hydrogens not part of
> stereo chemistry, but seems like this might be functionality buried
> somewhere in the RDKit.
>
> Thanks,
> Brian
>
>
> ------------------------------------------------------------
> ------------------
> 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
> [email protected]
> 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
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss