rdkit
rdkit copied to clipboard
Double bond stereo is retained in terminal olefin if a single explicit hydrogen is included
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
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
Putting an explicit H on the other C doesn't make a difference.