Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mismatch in atom ordering if user overrides conformer generation method #264

Open
aleksy-k opened this issue Mar 17, 2023 · 1 comment
Open
Labels
bug Something isn't working enhancement New feature or request

Comments

@aleksy-k
Copy link
Member

aleksy-k commented Mar 17, 2023

Describe the bug

For some molecules with explict hydrogens in their SMILES (e.g. O=C1C2=C(OC)C=C(OC)C=C2CC3(SCCCS3)/C=C/C=C[C@]4([H])C@(O4)CC@@HO1 ) there is a mismatch in atom ordering if you try to force RDKit conformer generation.

Raises: ValueError(
"Cannot alter the atomic symbols of a "
"conformer. Parent molecule was different: "
f"{atom.label} != {parent_atom.label}"

Would be good if there is an argument for the user to override RDKit vs autodE automatic conformer generation method choice. Additionally not sure why rdkit_conf_gen_is_fine is not private.

To Reproduce

import autode as ade 
from rdkit.Chem import rdmolfiles
from rdkit.Chem import rdmolops

smiles = 'O=C1C2=C(OC)C=C(OC)C=C2CC3(SCCCS3)/C=C/C=C\[C@]4([H])[C@]([H])(O4)C[C@@H](C)O1'
molecule = ade.Molecule(smiles=smiles)
molecule.rdkit_conf_gen_is_fine = True
molecule.rdkit_mol_obj = rdmolops.AddHs(rdmolfiles.MolFromSmiles(smiles))

molecule.populate_conformers(n_confs=300)

Expected behavior

Environment

  • Operating System: Linux
  • Python version: 3.10.8
  • autodE version: 1.3.5
@t-young31
Copy link
Member

Thanks for raising this – certainly a bug. rdkit_conf_gen_is_fine is public so autodE conformer generation can be used when RDKit also works (docs) and there's no test that it works the other way round.

Would be a nice feature to be able to override the rather opinionated choices. I'd vote having Config.molecule_conformer_method as an enum of {Default, RDKit, autodE} – what do you think?

@t-young31 t-young31 added bug Something isn't working enhancement New feature or request labels Mar 18, 2023
@t-young31 t-young31 added this to the v1.4.0 milestone Mar 18, 2023
@t-young31 t-young31 removed this from the v1.4.0 milestone Jul 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants