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

CalcNumAtomStereoCenters() changes after identity RenumberAtoms() on bicyclic amines

Abierto
#9,629 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
65/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
cpp, python
Área
backend, testing

Línea de trabajo

Start with the identity-permutation reproducer in the issue and inspect Renumber.cpp, especially destination RingInfo initialization and the stereochemistry state after renumbering. Add a regression test covering C1CCN2CCCC2C1 and verify that CalcNumAtomStereoCenters() remains 1 before and after RenumberAtoms(), without requiring SSSR recomputation.

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

Descripción

bug

Describe the bug

"rdMolDescriptors.CalcNumAtomStereoCenters()" can return a different result after "Chem.RenumberAtoms()", even when the identity permutation is used and the molecule is otherwise unchanged.

For the molecule:

C1CCN2CCCC2C1

the stereocenter count is 1 before renumbering and 2 afterwards.

The extra stereocenter appears to be assigned to the tertiary bicyclic nitrogen.

To reproduce

from rdkit import Chem
from rdkit.Chem import rdMolDescriptors

smi = "C1CCN2CCCC2C1"

mol = Chem.MolFromSmiles(smi)

before = rdMolDescriptors.CalcNumAtomStereoCenters(mol)

Identity permutation: atom order is unchanged

mol2 = Chem.RenumberAtoms(
mol,
list(range(mol.GetNumAtoms()))
)

after = rdMolDescriptors.CalcNumAtomStereoCenters(mol2)

print("before:", before)
print("after: ", after)

assert before == after

Observed with RDKit 2025.09.4:

before: 1
after: 2

The assertion fails.

The canonical SMILES remains the same before and after renumbering.

Additional observations

"Chem.FindPotentialStereo()" reports one potential stereocenter for both the original and renumbered molecules.

Recomputing SSSR on the renumbered molecule restores the original descriptor result:

Chem.GetSSSR(mol2)
print(rdMolDescriptors.CalcNumAtomStereoCenters(mol2))

1

"Chem.FastFindRings()" does not restore the result.

The problem also disappears when legacy stereochemistry perception is disabled.

I also found the same behavior in several related polycyclic amines and in 6 of 4,991 valid molecules from RDKit's bundled NCI sample.

Expected behavior

An identity call to "RenumberAtoms()" should not change a chemistry-derived descriptor.

Expected:

before: 1
after: 1

Possible cause

This may involve an interaction between ring-state metadata and legacy stereochemistry recomputation.

In "Renumber.cpp", the destination "RingInfo" is initialized using:

nRings->initialize();

rather than preserving the original ring type. This appears to leave the copied ring information with "FIND_RING_TYPE_OTHER_OR_UNKNOWN".

At the same time, the renumbered molecule no longer has the "_StereochemDone" state, so "CalcNumAtomStereoCenters()" recomputes stereochemistry.

Recomputing SSSR before the descriptor is calculated prevents the extra nitrogen center from appearing.

I have not confirmed that preserving the original ring type is by itself the correct fix, but this seems to localize the issue.

Configuration

  • RDKit version: 2025.09.4
  • Python: 3.13.5
  • OS: Linux x86_64
  • Installation: pip
  • Conda: No

Related notes

I found existing reports involving stereochemistry state, SSSR requirements, and atom renumbering, but I did not find an existing report of this specific "CalcNumAtomStereoCenters()" change after an identity "RenumberAtoms()" call.

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 Backend & API Design

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.