Project

General

Profile

Bug #1887

gmx insert-molecules cannot write PDB files with PDB input for -f

Added by Justin Lemkul almost 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
preprocessing (pdb2gmx,grompp)
Target version:
Affected version - extra info:
2016-dev-20160112-e6bc2ea
Affected version:
Difficulty:
uncategorized
Close

Description

I am preparing mixed solvent boxes. When attempting to write a PDB file as output from gmx insert-molecules, a fatal error is triggered:

-------------------------------------------------------
Program:     gmx insert-molecules, version 2016-dev-20160112-e6bc2ea
Source file: src/gromacs/fileio/pdbio.cpp (line 1075)

Fatal error:
Can only print PDB atom lines as ATOM or HETATM records

For more information and tips for troubleshooting, please check the GROMACS
website at http://www.gromacs.org/Documentation/Errors
-------------------------------------------------------

I reduced the problem down to a very simple case: inserting one water into a box containing another water. Interestingly, inserting one water into an empty box works and the PDB file is written:

gmx insert-molecules -f empty.pdb -ci spc1.pdb -nmol 1 -o spc2.pdb

but if there are other coordinates already present, the command fails.

Doing this:

gmx insert-molecules -f spc1.pdb -ci spc1.pdb -nmol 1 -o spc2.pdb

triggers the fatal error, but writing, e.g. GRO format works fine:

gmx insert-molecules -f spc1.pdb -ci spc1.pdb -nmol 1 -o spc2.gro
spc1.pdb (448 Bytes) spc1.pdb Justin Lemkul, 01/14/2016 08:26 PM

Associated revisions

Revision 0f34db65 (diff)
Added by Teemu Murtola almost 4 years ago

Handle pdbinfo in AtomsBuilder

This makes gmx solvate and gmx insert-molecules work when both -f and -o
are .pdb files (previously, the pdbinfo got out-of-sync when the atoms
were added/removed).

Centralize the defaults for pdbinfo to atoms.cpp.

Fixes #1887.

Change-Id: Ia7e7d991cc35e701729904b8319c53283479d0b1

History

#1 Updated by Teemu Murtola almost 4 years ago

  • Target version deleted (5.1.2)

This looks like it has never worked if the initial structure is a non-empty pdb file. This is because the tool never operates on the pdbinfo array when it adds atoms to the initial structure. So unless the array is initially null, it will be too short in the and out-of-bounds access probably generates the error you see.

Shouldn't be too hard to fix, though.

#2 Updated by Gerrit Code Review Bot almost 4 years ago

Gerrit received a related patchset '1' for Issue #1887.
Uploader: Teemu Murtola ()
Change-Id: Ia7e7d991cc35e701729904b8319c53283479d0b1
Gerrit URL: https://gerrit.gromacs.org/5570

#3 Updated by Teemu Murtola almost 4 years ago

  • Subject changed from gmx insert-molecules cannot write PDB files to gmx insert-molecules cannot write PDB files with PDB input for -f
  • Status changed from New to Fix uploaded
  • Assignee set to Teemu Murtola
  • Target version set to 2016
  • Affected version changed from git master to 5.1.1

Now fixed with some additional refactoring for the 2016 release (since this has been broken for a very long time, and it requires some changes to the installed headers, it's probably cleaner to leave this out from earlier patch releases).

Updated the Subject to describe the actual conditions that led to this: this only occurs if a PDB file is provided for -f.

#4 Updated by Justin Lemkul almost 4 years ago

The patch works for me. Thanks, Teemu!

#5 Updated by Teemu Murtola almost 4 years ago

  • Status changed from Fix uploaded to Resolved

#6 Updated by Mark Abraham almost 4 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF