reading in large water boxes (PDB format)?

From: David E. Konerding (
Date: Sun Dec 07 2003 - 12:26:32 CST

Hi folks,

I have been trying to convert a model system I built in AMBER to NAMD (I
am doing this because the ion-adding fetaures of NAMD/VMD
leave much to be desired, while they 'just work' in AMBER).

Anyway, one approach I tried was to add ions and solvent to my
protein/DNA model in AMBER, then load the resulting PDB
file into psfgen with the appropriate alias names. Everything works
fine except the solvent, there are so many (~30,000) waters that it
starts complaining:

Here's my psfgen:
topology top_all27_prot_na.inp

alias residue WAT TIP3
alias atom TIP3 O OH2

segment wat {
    auto none
    pdb wat.pdb
coordpdb wat.pdb wat

writepdb wat.psf.pdb
writepsf wat.psf

Here's the error message I see:
duplicate residue key 1000
ERROR: failed on residue WAT from pdb file

The behavior can be duplicated with the following entry:

REMARK =====================================
ATOM 10704 O WAT 1000 -51.057 188.666 276.577
ATOM 10705 H1 WAT 1000 -50.492 189.431 276.473
ATOM 10706 H2 WAT 1000 -51.946 189.014 276.504
ATOM 37701 O WAT 9999 -125.822 75.213 149.155
ATOM 37702 H1 WAT 9999 -125.478 74.420 148.743
ATOM 37703 H2 WAT 9999 -126.773 75.117 149.101
ATOM 37704 O WAT 10000 -230.613 129.982 188.755
ATOM 37705 H1 WAT 10000 -231.158 130.523 188.183
ATOM 37706 H2 WAT 10000 -229.800 130.479 188.850
REMARK ======================================

So, how do people deal with this? It seems if I create the solvent
using the 'solvate' package, it makes a PDB and PSF file, the PDB file
cannot be read back in by psfgen but it appears to work fine with NAMD
as input coordinates.

I guess the problem stems to the residue serial number width in the PDB
file format being only 4 characters wide.


This archive was generated by hypermail 2.1.6 : Wed Feb 29 2012 - 15:37:12 CST