hdb file can't handle empty lines - Redmine #2028
Archive from user: Chris Neale
When the .hdb file has empty lines, it does not seem to be read in properly by pdb2gmx.
test:
A. Use oplsaa.ff
B. modify aminoacids.hdb by adding an empty line as the very first line
(other places with empty lines in this file also cause things not to be
read below the empty line, but I do not show that here).
RESULT of pdb2gmx -ter -ignh:
Checking for duplicate atoms….
Generating any missing hydrogen atoms and/or adding termini.
Now there are 3 residues with 28 atoms
Making bonds…
WARNING: atom HA is missing in residue MET 1 in the pdb file
You might need to add atom HA to the hydrogen database of building block
MET
in the file aminoacids.hdb (see the manual)
WARNING: atom HB1 is missing in residue MET 1 in the pdb file
You might need to add atom HB1 to the hydrogen database of building
block MET
in the file aminoacids.hdb (see the manual)
WARNING: atom HB2 is missing in residue MET 1 in the pdb file
You might need to add atom HB2 to the hydrogen database of building
block MET
in the file aminoacids.hdb (see the manual)
… (there are many more like this)
But it works just fine with the standard .hdb file.
There is an obvious workaround for this. I ran into it when adding a blank line before a comment (after having been scared away from even trying to create multiple .hdb files based on issues 2026 and 2027 but still wanting to note my modification in the .hdb file). Note that comments beginning with semicolons do seem to be handled correctly in the .hdb file and even a line with a space and then the semi-colon does not break .hdb parsing.
There is no good reason to desire blank lines in the .hdb file, just that a user might add one thinking it was OK, since many other force field file types can handle it. If there is a desire not to allow blank lines in the .hdb file, then perhaps throwing an error is better than simply not finding the hydrogens.
(from redmine: issue id 2028, created on 2016-08-09 by gmxdefault, closed on 2018-01-02)
- Changesets:
- Revision 3993194e by Erik Lindahl on 2018-01-02T20:10:46Z:
Allow empty lines in hdb files
Skip lines that consist only of whitespace. Not a universal
solution for fixing hdb files, but better than the user
getting very strange error messages that don't say anything
about whitespace.
Fixes #2028.
Change-Id: I0962c89d0251f83da7fe0440efd31fb7ca468690