rdkit icon indicating copy to clipboard operation
rdkit copied to clipboard

Double bond stereo is retained in terminal olefin if a single explicit hydrogen is included

Open pechersky opened this issue 9 months ago • 1 comments

Describe the bug A clear and concise description of what the bug is.

To Reproduce

from rdkit import Chem

smis = [
    "C=CCC",
    "CCC=C",
    "CCC=C([H])",
    "CCC=C([H])[H]",
    "CCC=C[H]",
    "CC/C=C([H])/[H]",
    "CC/C=C/[H]",
    "CC/C=C([H])\[H]",
    "CC/C=C\[H]",
]

for smi in smis:
    mol = Chem.MolFromSmiles(smi)
    roundtrip_smi = Chem.MolToSmiles(mol)
    if roundtrip_smi != smis[0]:
        print(smi)
        print(roundtrip_smi)
        print()

# CC/C=C/[H]
# [H]/C=C/CC
# 
# CC/C=C\[H]
# [H]/C=C\CC
#

Expected behavior Expect all the SMILES to be C=CCC

Screenshots image

Configuration (please complete the following information):

  • RDKit version: 2023.9.1
  • OS: Ubuntu 20.04
  • Python version (if relevant): py3.11
  • Are you using conda? no
  • If you are using conda, which channel did you install the rdkit from? n/a
  • If you are not using conda: how did you install the RDKit? pip install rdkit

Additional context Likely related to https://github.com/rdkit/rdkit/issues/2807 https://github.com/rdkit/rdkit/issues/2798

pechersky avatar Nov 15 '23 21:11 pechersky

Putting an explicit H on the other C doesn't make a difference.

pechersky avatar Nov 15 '23 21:11 pechersky