CalcNumAtomStereoCenters() changes after identity RenumberAtoms() on bicyclic amines
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 65/100
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
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
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de rdkit/rdkit
-
Clarify mol_from_smiles vs qmol_from_smarts for substruct_count queries in Postgresql cartridge Abiertoenhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 70/100
-
enhancement
Dificultad 4/5 3-5 días Aptitud para principiantes 50/100
-
Improve depiction of RNA Abiertoenhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
Todos los issues de rdkit/rdkit
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
microsoft/magentic-ui#588 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
alexgorbatchev/simple-ptt#3 · 1 comentario ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
CorrelAid/formtransform#44 ·