-
Notifications
You must be signed in to change notification settings - Fork 69
Description
Hello,
im a physicist and i learned about molecules in terms of quantum mechanical many body systems rather than in the good old chemical fashion that speaks bond orders and stereochemistry, so please be easy on me, if i got something fundamentally wrong.
I have a dataset of xyz file from qm calculations and i need to make mol objects out of them for further processing. Im using this:
mol = Chem.MolFromXYZBlock(xyz_block)
rdDetermineBonds.DetermineBonds(mol, charge=0)
as im expecting the molecules just to be neutrally charged, i have no information sadly. Now this procedure fails for some of my conformers:
with
ValueError: Final molecular charge (-2) does not match input (0); could not find valid bond ordering
Strangely enough, it fails for a certain conformer of a molecule, while it is able to process the others before. These are the atomic coordinates, in case someone can see something from them:
My question is: Is there a physical reason, why this algorithm cant find the bonds if the charge is unknown? I suppose it tries to distribute the given charge over the atoms and is unhappy if it cant match the charge with some pairs of coordinates based on some rules. Then i wonder; why is there no option to infer the most likely charge and just use this?
If it helps anything: im using version '2024.03.5' of rdkit.
Hope to hear from you,
Thanks!
Edit: For my total of 59k, it fails only 184 times, however, as stated before, it randomly fails for different conformers for the same molecule...

