### Navigation

- index
- modules |
- next |
- previous |
- MDAnalysis 0.7.7 documentation »
- 5. Coordinates modules »

# 5.10. PQR file format — `MDAnalysis.coordinates.PQR`

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:

recordName
  A string which specifies the type of PQR entry and should either be ATOM or HETATM.
serial
  An integer which provides the atom index (but note that MDAnalysis renumbers atoms so one cannot rely on the serial)
atomName
  A string which provides the atom name.
residueName
  A string which provides the residue name.
chainID
  An optional string which provides the chain ID of the atom.
residueNumber
  An integer which provides the residue index.
X Y Z
  Three floats which provide the atomic coordiantes.
charge
  A float which provides the atomic charge (in electrons).
radius
  A float which provides the atomic radius (in Ã…).

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

class `MDAnalysis.coordinates.PQR.``PQRReader`(filename, convert_units=None, **kwargs)

  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.

  `get_charges`()

    Return an array of charges in atom order.

  `get_radii`()

    Return an array of atom radii in atom order.

### Navigation

- index
- modules |
- next |
- previous |
- MDAnalysis 0.7.7 documentation »
- 5. Coordinates modules »