Hi Ling,

By default hydrogens defining double bond stereochemistry are not removed.
You may remove that residual hydrogen by either

params = Chem.RemoveHsParameters()
params.removeDefiningBondStereo = True
Chem.RemoveHs(m6, params)

or simply

Chem.RemoveAllHs(m6)

I think you may obtain the same result by just

m6s = AllChem.DeleteSubstructs(m5, mf)

Cheers,
p.


On Wed, Nov 3, 2021 at 9:29 PM Ling Chan <lingtrek...@gmail.com> wrote:

> Hello colleagues,
>
> I tried to change all F's into H's. It worked. But when I converted the
> result into a smiles string, there is the occasional lingering explicit
> hydrogen. It is there even after I do a RemoveHs().
>
> Just wonder what is this explicit H about, since it may have implications
> on any further processing.
>
> Thank you!
>
> Ling
>
>
>
> mh = Chem.MolFromSmiles("[#1]")
> mf = Chem.MolFromSmarts('F')
> m5 = Chem.MolFromSmiles("F/C=C1/[C@H](F)[C@@H](F)O[C@@H]1F")
> m6s = AllChem.ReplaceSubstructs(m5,mf,mh,replaceAll=True)
> m6 = m6s[0]
> print(Chem.MolToSmiles(Chem.RemoveHs(m6)))
>
> [H]C=C1CCOC1
>
>
>
> _______________________________________________
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to