From: Vermaas, Joshua (Joshua.Vermaas_at_nrel.gov)
Date: Thu Dec 20 2018 - 08:42:52 CST

Hi JC,

VMD has done this for years, and often catches new students by surprise (I remember running into this my first year). The issue isn't in the psfplugin, since it always reads the type field. Instead, it comes down to the behavior in MolFilePlugin.C, since read_structure is where atoms are added. If the atoms are already initialized (as they would be with a previous pdb load), the atomtypes are never read in from the new file, since the plugin's read_structure isn't called. Now if you reversed the order, then the usual psf-then-pdb loading breaks, since pdb loads would then wipe out the atomtypes read in via the psf. That is the problem, and I'm not sure what the "correct" solution is, other than to just always load the psf first.

-Josh

On 2018-12-19 18:59:39-07:00 owner-vmd-l_at_ks.uiuc.edu wrote:

Hi all,

A new student caused an issue that I hadn’t seen before. She loaded a PDB and then a PSF and then wrote a PSF. However, the atom types were all initialized to the atom names (by the PDB reader) and then weren’t overwritten by the PSF reader. It seems to me like you would always want to take the atom types from a PSF if you read it in, no matter what was loaded before?

It seems to come down to the optflags in the molfile plugins. However, there isn’t a MOLFILE_TYPE or MOLFILE_ATOMTYPE flag, so maybe it would be more complicated than a one line fix in psfplugin.c? It’s not a big deal, so I only bring it up if others agree it’s not currently the expected behavior and it’s easy to fix.

Thanks!
JC