Describe the bug
Converting some molecules from Sire to RDKit results in some strange formal charges and bonded structure. For example, the following molecule:
becomes (formal charges labelled):
This only happens if loading from a format which lacks bond-order information (eg. prmtop). Loading from an sdf, for example, works fine.
To Reproduce
Steps to reproduce the behavior:
mol1 = sr.load('input.inpcrd','input.prmtop')[0]
rdmol1 = sr.convert.to_rdkit(mol1)
for atom in rdmol1.GetAtoms():
print(atom.GetFormalCharge())
mol2 = sr.load('input.sdf')
rdmol1 = sr.convert.to_rdkit(mol2)
for atom in rdmol2.GetAtoms():
print(atom.GetFormalCharge())
I'm not sure what the ideal solution would be, as the information about the correct structure isn't available. Possibly there could be some way to flag unlikely groups like carbanions?
inputs.zip