PSF File

This module defines a function for parsing protein structure files in PSF format.

prody.trajectory.psffile.parsePSF(filename, title=None, ag=None)[source]

Returns an AtomGroup instance storing data parsed from X-PLOR format PSF file filename. Atom and bond information is parsed from the file. If title is not given, filename will be set as the title of the AtomGroup instance. An AtomGroup instance may be provided as ag argument. When provided, ag must have the same number of atoms in the same order as the file. Data from PSF file will be added to the ag. This may overwrite present data if it overlaps with PSF file content.

This function now includes the angles, dihedrals, and impropers sections as well as donors, acceptors and crossterms!

prody.trajectory.psffile.writePSF(filename, atoms)[source]

Write atoms in X-PLOR format PSF file with name filename and return filename.

All topology sections that are set on atoms are written: !NATOM, !NBOND, !NTHETA (angles), !NPHI (dihedrals), !NIMPHI (impropers), !NDON (donors), !NACC (acceptors), !NNB (non-bonded exclusions) and !NCRTERM (cross-terms, i.e. CMAP). A section whose data is not set on atoms is written with a count of zero, so a file parsed with parsePSF() round-trips its topology.

Atom records carry segment name, residue number and name, atom name and type, charge and mass. The header is PSF NAMD when any atom type is longer than four characters, since the X-PLOR column layout cannot hold those; note that fields wider than their format specifier (long atom types, or residue numbers above 9999) widen the record rather than being truncated, which readers that split on whitespace tolerate but strictly column-oriented readers may not.