Re: PSF file format

From: Axel Kohlmeyer (akohlmey_at_gmail.com)
Date: Sat Jun 05 2021 - 08:57:07 CDT

The best way to have a native writer for the format (and a whole bunch of
additional file formats) would be to add an interface to using molfile
plugins in general and then load/use the plugin directly. Otherwise you can
also incorporate the source (molfile plugins are under a more liberal
license than VMD and NAMD). Most molfile plugins can be compiled as
standalone executables for testing and benchmarking, so that is a starting
point. https://www.ks.uiuc.edu/Research/vmd/plugins/doxygen/index.html

There are several software packages that have implemented molfile plugin
interfaces. There is the original in VMD, I wrote one for LAMMPS, I know
there is one in Plumed2.x and Pymol and there are likely more.

Axel.

On Sat, Jun 5, 2021 at 8:55 AM Maximilian Ebert <max.ebert_at_me.com> wrote:

> Thanks everyone. That is super helpful. We could implement JS writing for
> systems over 1mio atoms, which would also be helpful to write out fully
> compliant coordinate files I guess. Since we have a native writer i would
> like to implement this as well. Do i need to go through the C code or is
> there a full spec of the file format somewhere?
>
> Max
>
> On Jun 5, 2021, at 5:56 AM, Vermaas, Josh <vermaasj_at_msu.edu> wrote:
>
>  For the fortran style formatting, the VMD source code or the CHARMM
> source code. These are the lines from psfplugin.c:
>
> Normal: "%8d %-4s %-4d %-4s %-4s %-4s %14.6g %13.6g %7d\n"
> EXT: "%10d %-8s %-8d %-8s %-8s %-6s %14.6g %13.6g %7d\n"
>
> The NAMD format just overruns the specified field widths, which is
> perfectly allowable in C but not in fortran.
>
> In terms of using the js format, I think what you are seeing was more true
> when that warning was written (~2015, 2016), than it is now.
>
> -Josh
>
> On 6/4/21 5:38 PM, Maximilian Ebert wrote:
>
> Hi Giacomo,
>
> This is a bit concerning:
>
> Due to the lack of full structure data on every node, various features not
> normally needed for large simulations are non-functional or restricted.
> These limits, combined with the small number of projects using
> memory-optimized NAMD, cause us to caution users that this capability
> should be considered experimental.
>
> Also is there a full documentation of the JS and namdbin format? Where can
> I find the Fortran style formatting for PSFs? And how are they different
> when read into NAMD?
>
> Max
>
> On Jun 4, 2021, at 2:56 PM, Giacomo Fiorin <giacomo.fiorin_at_gmail.com>
> wrote:
>
> Hi Max, for large systems the recommended format in VMD/NAMD is "JS":
> https://www.ks.uiuc.edu/Research/namd/wiki/index.cgi?NamdMemoryReduction
> <https://urldefense.com/v3/__https://www.ks.uiuc.edu/Research/namd/wiki/index.cgi?NamdMemoryReduction__;!!HXCxUKc!nQCVOlkmh28IgtQ2MZlXQpzrQm3Xi_5rQ-SZ6oHVy_ACbP-pefAAEREBuxI8ShI$>
>
> On Fri, Jun 4, 2021 at 2:53 PM Maximilian Ebert <max.ebert_at_me.com> wrote:
>
>> Thanks for the answer. I am trying to write out a compliment PSF file for
>> system with over 1 million atoms. I want to be sure to not bust any field
>> width and get into trouble with the NAMD PSF parser. So I guess you can’t
>> be fully compliant for system which go over a certain number of atoms
>> correct? Is my assumption correct that NAMD uses the space as a separator
>> and that VMD for example has fixed field width?
>>
>> Max
>>
>>
>> On Jun 4, 2021, at 1:59 PM, Axel Kohlmeyer <akohlmey_at_gmail.com> wrote:
>>
>> 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.
>>
>> Axel.
>>
>> 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 <vermaasj_at_msu.edu> wrote:
>>
>>> The best documentation on the format is *probably* the CHARMM
>>> documentation, which is actually rather sparse.
>>>
>>> https://urldefense.com/v3/__https://academiccharmm.org/documentation/version/c45b2/io*IOFORM__;Iw!!DZ3fjg!uRPWqMKGW1780p7gOxom55ZPP9L4h9AHLa2pb7HsKx66nLOh7NH4vymgTxHM9_y3qw$
>>>
>>> Basically, the first line of the PSF file dictates the field width. For
>>> regular, non-extended PSFs, the header will look like:
>>>
>>> PSF
>>>
>>> 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:
>>>
>>> PSF EXT
>>>
>>> This buys you 8 characters for segnames and atomtypes. NAMD/VMD also can
>>> write space-delimited psf files, which are tagged as follows:
>>>
>>> PSF NAMD
>>>
>>> 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
>>>
>>> vermaasj_at_msu.edu
>>> Assistant Professor, Plant Research Laboratory and Biochemistry and
>>> Molecular Biology
>>> Michigan State University
>>>
>>> https://urldefense.com/v3/__https://prl.natsci.msu.edu/people/faculty/josh-vermaas/__;!!DZ3fjg!uRPWqMKGW1780p7gOxom55ZPP9L4h9AHLa2pb7HsKx66nLOh7NH4vymgTxF1980Jig$
>>>
>>>
>>>
>>
>> --
>> Dr. Axel Kohlmeyer akohlmey_at_gmail.com https://urldefense.com/v3/__http://goo.gl/1wk0__;!!DZ3fjg!qcEpve0sF0dqYedKaMDLsMdRfYakMguBBq4Vc5YFTb35B9bYeg_f_pAvwvdTbR1ttw$
>> <https://urldefense.com/v3/__http://goo.gl/1wk0__;!!DZ3fjg!tca8shL5MNjPvKe0WQ2CuKt_WzZHsbdeZOJRaXxyIaLAg4TDr1AklyLLa9o-tCCMkQ$>
>> College of Science & Technology, Temple University, Philadelphia PA, USA
>> International Centre for Theoretical Physics, Trieste. Italy.
>>
>>
>>
>
> --
> Josh Vermaas
> Assistant Professor, MSU-DOE Plant Research Lab and Department of Biochemisty and Molecular Biologyvermaasj_at_msu.eduhttps://prl.natsci.msu.edu/people/faculty/josh-vermaas/ <https://urldefense.com/v3/__https://prl.natsci.msu.edu/people/faculty/josh-vermaas/__;!!DZ3fjg!tca8shL5MNjPvKe0WQ2CuKt_WzZHsbdeZOJRaXxyIaLAg4TDr1AklyLLa9rskPyosA$>
>
>

-- 
Dr. Axel Kohlmeyer  akohlmey_at_gmail.com  https://urldefense.com/v3/__http://goo.gl/1wk0__;!!DZ3fjg!qcEpve0sF0dqYedKaMDLsMdRfYakMguBBq4Vc5YFTb35B9bYeg_f_pAvwvdTbR1ttw$ 
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