Skip to content

Commit 65ba58f

Browse files
committed
Tell py2 to use uniocde for xyz files
1 parent b83faa3 commit 65ba58f

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

moldesign/fileio.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -259,15 +259,16 @@ def write_trajectory(traj, filename=None, format=None, overwrite=True):
259259
def read_pdb(f, assign_ccd_bonds=True):
260260
""" Read a PDB file and return a molecule.
261261
262-
This uses the biopython parser to get the molecular structure, but uses internal parsers
263-
to create bonds and biomolecular assembly data.
262+
This uses ParmEd's parser to get the molecular structure, with additional functionality
263+
to assign Chemical Component Dictionary bonds, detect missing residues, and find
264+
biomolecular assembly information.
264265
265266
Note:
266267
Users won't typically use this routine; instead, they'll use ``moldesign.read``, which will
267268
delegate to this routine when appropriate.
268269
269270
Args:
270-
f (filelike): filelike object giving access to the PDB file (must implement seek)
271+
f (filelike): filelike object giving access to the PDB file (must implement readline+seek)
271272
assign_ccd_bonds (bool): Use the PDB Chemical Component Dictionary (CCD) to create bond
272273
topology (note that bonds from CONECT records will always be created as well)
273274
@@ -325,10 +326,10 @@ def read_xyz(f):
325326

326327

327328
def write_xyz(mol, fileobj):
328-
fileobj.write(" %d\n%s\n" % (mol.num_atoms, mol.name))
329+
fileobj.write(u" %d\n%s\n" % (mol.num_atoms, mol.name))
329330
for atom in mol.atoms:
330331
x, y, z = atom.position.value_in(mdt.units.angstrom)
331-
fileobj.write("%s %24.14f %24.14f %24.14f\n" % (atom.element, x, y, z))
332+
fileobj.write(u"%s %24.14f %24.14f %24.14f\n" % (atom.element, x, y, z))
332333

333334

334335
@utils.exports

0 commit comments

Comments
 (0)