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

Open Babel Optimize Geometry arbitrarily adds H atoms #442

Closed
drew-parsons opened this issue Feb 13, 2020 · 1 comment · Fixed by #471
Closed

Open Babel Optimize Geometry arbitrarily adds H atoms #442

drew-parsons opened this issue Feb 13, 2020 · 1 comment · Fixed by #471

Comments

@drew-parsons
Copy link
Contributor

Avogadro version: 1.93.0:

  • Avogadrolibs: 1.93.0
  • Qt: 5.12.5

Desktop version: :

  • OS: Linux (Debian unstable)
  • Version linux 5.4.13-1
  • Compiler g++ 9.2.1 20200203

Describe the bug
The Optimize Geometry function sometimes fails, with the optimizing routine apparently arbitrarily adding its own H atoms contradicting the given structure. Optimize Geometry appears to run for a reasonable number of iterations, but then gives the error message:
"Number of atoms in obabel output (22) does not match the number of atoms in the original molecule (19)."
(This example of 19 atoms refers to histidine with the carboxylate group protonated and prime amine group unprotonated i.e. ...NH with 1 H atom, no charge. That is, neutral histidine)

The problem seems to happen for pH-dependent molecules such as amino acids, where carboxylate and amine groups may or may not be protonated.

If I manually click on "Adjust Hydrogens", then avogadro2 adds 3 protons, 1 to the amine group and 1 each to the C and double-bonded O of the carboxylate. So it's converting the carboxylic acid group to a methandiol group. By the count of atoms in the error message, it looks like this is what Optimize Geometry is doing to the structure before running optimization.

So it looks as though Optimize Geometry is interfering with the given structure and not working with the structure as presented.

To Reproduce
Steps to reproduce the behavior:

  1. Create an amino acid. Glycine will do. If "Adjust Hydrogens" is set. then avogadro2 will create the amine group as ...NH2 (glycine cation).
  2. Delete one of the amine hydrogens to get neutral glycine H2CNHCOOH
  3. Click Extensions->Open Babel->Optimize Geometry.
  4. Iterations will proceed, then give the error message
    "Number of atoms in obabel output (10) does not match the number of atoms in the original molecule (9)."

Expected behavior

Optimize Geometry should work strictly with the given structure, and not add (or remove) hydrogen atoms.

@ghutchis
Copy link
Member

ghutchis commented Mar 5, 2020

I'm going to figure out the specific issue - but #448 will soon add an integrated optimizer.

ghutchis added a commit to ghutchis/avogadrolibs that referenced this issue May 2, 2020
Ensures hydrogens are not added automatically.
Fixes OpenChemistry#442 (and probably other issues)

Signed-off-by: Geoff Hutchison <geoff.hutchison@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants