Re: PSF file format

From: Axel Kohlmeyer (
Date: Fri Jun 04 2021 - 12:59:48 CDT

lore has it that the *authoritative* documentation of the CHARMM file
formats is the CHARMM source code.

one important point to note is that PSF (and PDB) are file formats based on
Fortran style formatting, which has fixed widths and does not need spaces
as separators.
so it can be legal to have something like:

1001100210031004 (for a 4I4 format) being read as 1001, 1002, 1003, 1004
but if you would write out 1001 1002 1003 1004 in would be read as 1001,
100, 210, 31
that is different from how C/C++ and Python process input.

So what it now boils down to is what you are after: do you want to write
out or edit PSF files to be fully conforming, or do they just have to be
read by NAMD.


P.S.: there are some more possible flags to appear in the first line to
indicate the use of the PSF for specific purposes

On Fri, Jun 4, 2021 at 1:49 PM Josh Vermaas <> wrote:

> The best documentation on the format is *probably* the CHARMM
> documentation, which is actually rather sparse.
> Basically, the first line of the PSF file dictates the field width. For
> regular, non-extended PSFs, the header will look like:
> In these files, you are limited to 4 characters for segnames and
> atomtypes. CHARMM can also write (and VMD/NAMD can also read/write)
> "extended" PSF files. The headers for these will look like:
> This buys you 8 characters for segnames and atomtypes. NAMD/VMD also can
> write space-delimited psf files, which are tagged as follows:
> The NAMD/VMD version is the most flexible, since fields just need to be
> separated by spaces, and for the most part psfgen/VMD will select this
> option if the contents of the psf file demand it.
> -Josh
> On 6/4/21 1:10 PM, Maximilian Ebert wrote:
> > Dear list,
> >
> > Is there a resource which describes the PSF file format? I am many
> wondering about the max column width and if the width needs to be fixed or
> can changed when numbers get larger.
> >
> > Thanks
> >
> --
> Josh Vermaas
> Assistant Professor, Plant Research Laboratory and Biochemistry and
> Molecular Biology
> Michigan State University

Dr. Axel Kohlmeyer;!!DZ3fjg!p-wNAv3ovVg_nB2ZTNtCw1YI1YgEhtCqEwvmhNx5kIZ70jVHlH8zck9jETJ9ZMFntw$ 
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy.

This archive was generated by hypermail 2.1.6 : Fri Dec 31 2021 - 23:17:11 CST