From: Josh Vermaas (
Date: Thu Jun 13 2013 - 14:16:46 CDT

Hi Alexandre,

I've had to deal with this quite a bit, and it is a reasonably simple
thing to fix. Add the NAMD flag to the top line of the originally built
PSF (if it isn't there already, I forget about that detail), and VMD
will correctly internally read in the long atomtypes, since it will
assume all the fields are separated by spaces instead of assuming a
fixed field width. Now writing a psf from a selection is still
problematic, as writepsf assumes the fixed width format (you may have
noticed totally wrong charges in the broken psf as a result).

To get a psf containing only a subset of all atoms, instead of using
something like:
$sel writepsf filename

animate write psf filename sel $sel moleculeid

The second one works (preserves long names), but the first does not
recognize the long names and truncates them. VMD is sometimes weird like
-Josh Vermaas

On 06/13/2013 12:57 PM, Alexandre Suman de Araujo wrote:
> Hi all
> I have a .psf file generated with CGenFF topology file and "Automatic
> PSF Builder" plugin from VMD. The obtained .psf file has atoms with
> atomtype field with different sizes, ranging from 4 to 6 characters,
> as expected. I use this .psf and the obtained .pdb in NAMD simulations
> with CGenFF force field parameter files without problems.
> If I load this .psf and .pdb in VMD, open tkconsole, build a selection
> with all atoms and use the writepsf command I obtain a new .psf
> where all atomtype fields has the same size: 4 characters. The last
> characters are lost and this .psf is broken, since the atomtypes of
> this .psf do not match anymore with the ones in the CGenFF parameters
> file.
> Is this a known limitation in writepsf routine or there is some way I
> can use it (with some option) where it writes the atomtypes correctly?
> Best regards
> Alexandre Suman de Araujo