Read atoms with charges from a PQR file (as written by PDB2PQR). The following is adopted from the description of the PQR format as used by APBS:
MDAnalysis reads very loosely-formatted PQR files: all fields are whitespace-delimited rather than the strict column formatting mandated by the PDB format. This more liberal formatting allows coordinates which are larger/smaller than ±999 Å.
MDAnalysis reads data on a per-line basis from PQR files using the following format:
recordName serial atomName residueName chainID residueNumber X Y Z charge radius
If this fails it is assumed that the chainID was omitted and the shorter format is read:
recordName serial atomName residueName residueNumber X Y Z charge radius
Anything else will raise a ValueError.
The whitespace is the most important feature of this format: fields must be separated by at least one space or tab character. The fields are:
Clearly, this format can deviate wildly from PDB due to the use of whitespaces rather than specific column widths and alignments. This deviation can be particularly significant when large coordinate values are used.
Warning
Fields must be white-space separated or data are read incorrectly. PDB formatted files are not guaranteed to be white-space separated so extra care should be taken when quickly converting PDB files into PQR files using simple scripts.
For example, PQR files created with PDB2PQR and the –whitespace option are guaranteed to conform to the above format:
pdb2pqr --ff=charmm --whitespace 4ake.pdb 4ake.pqr
Read a PQR file into MDAnalysis.
The PQRParser takes charges from the PQR file in order to populate the MDAnalysis.core.AtomGroup.Atom.charge attribute. Radii are accessible through the get_radii() method of the reader, the MDAnalysis.core.AtomGroup.AtomGroup.radii() method and the MDAnalysis.core.AtomGroup.Atom.radius attribute.
Read coordinates from filename.
filename can be a gzipped or bzip2ed compressed PQR file.