Skip to content

Commit

Permalink
Fixed bug on writing mmCIF files. Charge was empty string.
Browse files Browse the repository at this point in the history
  • Loading branch information
JoaoRodrigues committed Nov 28, 2018
1 parent 349bdef commit a9eced5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions bin/pdb_tocif.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,15 @@ def convert_to_mmcif(fhandle):
_a += '{:10.3f} {:10.3f} {:10.3f} {:10.3f} {:10.3f} {:1s} '
_a += '{:5s} {:3s} {:1s} {:4s} {:1d}\n'

yield '# Converted to mmCIF by pdb-tools\n'
yield '#\n'

# Headers
fname, _ = os.path.splitext(os.path.basename(fhandle.name))
if fname == '<stdin>':
fname = 'data_cell'
fname = 'cell'
yield 'data_{}\n'.format(fname)

yield '# Converted to mmCIF by pdb-tools\n'
yield '#\n'
yield 'loop_\n'
yield '_atom_site.group_PDB\n'
Expand Down Expand Up @@ -164,7 +166,7 @@ def convert_to_mmcif(fhandle):
bfac = float(line[60:66])

charge = line[78:80].strip()
if charge == ' ':
if charge == '':
charge = '?'

yield _a.format(record, serial, element, atname, altloc,
Expand Down

0 comments on commit a9eced5

Please sign in to comment.