rdkit / rdkit

The official sources for the RDKit library
BSD 3-Clause "New" or "Revised" License
2.69k stars 880 forks source link

`AssignBondOrdersFromTemplate` does not copy bond stereochemistry information of terminal imine #6873

Open nielskm opened 1 year ago

nielskm commented 1 year ago

terminal-imine.pdb.txt

Assigning bond orders to the attached PDB with SMILES:[H]/N=C\CC(=O)N1CC[C@@H](C)[C@@H](N(C)c2ncnc3[nH]ccc23)C1 removes the stereochemistry of the C=N bond in the terminal imine group.

To Reproduce

from rdkit.Chem import AddHs, MolFromPDBFile, MolFromSmiles
from rdkit.Chem.rdmolfiles import MolToSmiles

smiles = "[H]/N=C\CC(=O)N1CC[C@@H](C)[C@@H](N(C)c2ncnc3[nH]ccc23)C1"
mol = MolFromPDBFile("terminal-imine.pdb", removeHs=False)
refmol = AddHs(MolFromSmiles(smiles))

result_mol = AssignBondOrdersFromTemplate(refmol, mol)

result_smiles = MolToSmiles(result_mol)

Expected behavior The result_smiles from the code above should have the stereochemistry information from the original SMILES.

Configuration (please complete the following information):

Additional context I need the stereochemistry information to be assigned in order to use the OpenFF Toolkit Molecule class (constructed with Molecule.from_rdkit). If I add b2.SetStereo(b.GetStereo()) to the AssignBondOrdersFromStereo function, this problem dissapears. But the SMILES produced by RDKit still lack the isomer information.

mattwthompson commented 5 months ago

Are you sure that SMILES fully defines the stereochemistry? OEChem thinks the nitrogen in the non-aromatic ring is a stereocenter

image


# problematic atom is ..................... *
smiles = "[H]/N=C\CC(=O)N1CC[C@@H](C)[C@@H](N(C)c2ncnc3[nH]ccc23)C1"
Lzh-Function commented 2 months ago

I have the same issue. It seems that only E/Z isomerism cannot be assigned.

My Configuration :

radifar commented 3 weeks ago

ui3.pdb.txt

I got the same issue with ligand UI3 from PDB file 1QST. I have already extracted the ligand UI3 and the file is attached.

Using the command

smiles_ui3 = r'[H]/N=C(/c1ccc2ccc(c(c2c1)c3cnn(c3)S(=O)(=O)C)OC)\N'
ui3 = Chem.MolFromSmiles(smiles_ui3)
ui3_manual = Chem.MolFromPDBFile("ui3.pdb")

corrected_ui3 = Chem.AssignBondOrdersFromTemplate(ui3, ui3_manual)

gave me the error message ValueError: No matching found