Skip to content

So what if i dont know the charges #43

@Ltwicke

Description

@Ltwicke

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:

image

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:

image

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...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions