Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions package/MDAnalysis/coordinates/PQR.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@

pdb2pqr --ff=charmm --whitespace 4ake.pdb 4ake.pqr


Notes
-----
The PQR format does not provide a means by which to provide box information.
In all cases the `dimensions` attribute will be set to `None`.


.. _PQR: https://apbs-pdb2pqr.readthedocs.io/en/latest/formats/pqr.html
.. _APBS: https://apbs-pdb2pqr.readthedocs.io/en/latest/apbs/index.html
.. _PDB2PQR: https://apbs-pdb2pqr.readthedocs.io/en/latest/pdb2pqr/index.html
Expand Down Expand Up @@ -130,7 +137,6 @@ def _read_first_frame(self):
flavour = None

coords = []
unitcell = None
with util.openany(self.filename) as pqrfile:
for line in pqrfile:
if line.startswith(('ATOM', 'HETATM')):
Expand All @@ -145,13 +151,10 @@ def _read_first_frame(self):
self.n_atoms = len(coords)
self.ts = self._Timestep.from_coordinates(
coords, **self._ts_kwargs)
self.ts.dimensions = unitcell
self.ts.frame = 0 # 0-based frame number
if self.convert_units:
# in-place !
self.convert_pos_from_native(self.ts._pos)
if not self.ts.dimensions is None:
self.convert_pos_from_native(self.ts.dimensions[:3])

def Writer(self, filename, **kwargs):
"""Returns a PQRWriter for *filename*.
Expand Down
4 changes: 4 additions & 0 deletions testsuite/MDAnalysisTests/coordinates/test_pqr.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ def test_ProNCharges(self):
ag.charges, self.ref_charmm_ProNcharges, 3,
"Charges for N atoms in Pro residues do not match.")

def test_dimensions(self):
# Issue #3327 - dimensions should always be set to None
assert self.universe.dimensions is None


class TestPQRWriter(RefAdKSmall):
@staticmethod
Expand Down