Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

MolToInchi adds spurious /b stereo for symmetric ylidene with 2D coordinates

Abierto
#9,586 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
cpp, python
Área
tooling

Línea de trabajo

Start by reproducing the supplied MolBlock and SMILES cases through the Chem.MolToInchi entry point, then trace the RDKit/InChI integration to determine where symmetry-equivalent paths gain the /b layer. The work is done when both representations produce equivalent stereochemistry-free InChI output and a regression check covers the example.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug

Describe the bug
Chem.MolToInchi() incorrectly infers double-bond stereochemistry for a symmetric ylidene molecule from its 2D coordinates, adding a  /b  layer even though the two substituent paths are symmetry-equivalent and E/Z stereochemistry is undefined. Doesn't happen when the molecule is provided as a SMILES.

To Reproduce

from rdkit import Chem, rdBase
from rdkit.Chem import CanonicalRankAtoms

molblock = """
     RDKit          2D

 12 12  0  0  0  0  0  0  0  0999 V2000
   -4.8794    0.4883    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -3.7700   -0.5213    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
   -2.3410   -0.0652    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -2.0214    1.4003    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
   -1.2315   -1.0748    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0  0
    0.1975   -0.6188    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    1.3069   -1.6283    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    2.7359   -1.1723    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    3.0555    0.2932    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    4.4845    0.7493    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    1.9460    1.3028    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.5170    0.8468    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
  1  2  1  0
  2  3  1  0
  3  4  2  0
  3  5  1  0
  5  6  2  0
  6  7  1  0
  7  8  1  0
  8  9  1  0
  9 10  1  0
  9 11  1  0
 11 12  1  0
 12  6  1  0
M  END
"""

mol = Chem.MolFromMolBlock(molblock)
assert mol is not None

ranks = CanonicalRankAtoms(mol, breakTies=False)
assert ranks[6] == ranks[11]

molblock_inchi = Chem.MolToInchi(mol)
print(f"MolBlock InChI: {molblock_inchi}")
assert "/b" in molblock_inchi

smiles = Chem.MolToSmiles(mol)
smiles_mol = Chem.MolFromSmiles(smiles)
assert smiles_mol is not None

smiles_inchi = Chem.MolToInchi(smiles_mol)
print(f"SMILES: {smiles}")
print(f"SMILES InChI: {smiles_inchi}")
assert "/b" not in smiles_inchi
MolBlock InChI: InChI=1S/C10H16O2/c1-8-3-5-9(6-4-8)7-10(11)12-2/h7-8H,3-6H2,1-2H3/b9-7-
SMILES: COC(=O)C=C1CCC(C)CC1
SMILES InChI: InChI=1S/C10H16O2/c1-8-3-5-9(6-4-8)7-10(11)12-2/h7-8H,3-6H2,1-2H3

Expected behavior
The MolBlock- and SMILES-based representations should produce equivalent stereochemistry-free InChI output without a  /b  double-bond stereochemistry layer.

Screenshots

Image

Configuration (please complete the following information):
• RDKit version: 2026.09.1pre (source commit  1df4988c99737db4e8ca722a5471526dd0271fbd ) -- but the issue is on all commits that have inchi support, InChI upstream misinterpretation
• OS: Amazon Linux 2023.10.20260302, aarch64
• Python version (if relevant): 3.11.14
• Are you using conda? No.
• If you are using conda, which channel did you install the rdkit from? Not applicable.
• If you are not using conda: how did you install the RDKit? Manual build from source.

Lenguaje dominante
HTML
Estrellas
3.6k
Forks
1.1k
Merge medio
3 d 8 h
PR fusionados (30 d)
44

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de rdkit/rdkit

Todos los issues de rdkit/rdkit

Issues similares

Más issues de DevTools

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.