Skip to content

Commit dbc8e61

Browse files
[PATCH] Fixes issue #168 - charge assignment logic (#182)
Co-authored-by: Rodrigo V. Honorato <rvhonorato@protonmail.com>
1 parent d2d0cf0 commit dbc8e61

3 files changed

Lines changed: 5647 additions & 20 deletions

File tree

pdbtools/pdb_fromcif.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,9 @@ def run(fhandle):
176176
occ = float(fields[labels.get('_atom_site.occupancy')])
177177
bfactor = float(fields[labels.get('_atom_site.B_iso_or_equiv')])
178178

179-
charge = fields[labels.get('_atom_site.pdbx_formal_charge')]
180179
try:
181-
charge = charge
182-
except ValueError:
180+
charge = fields[labels.get('_atom_site.pdbx_formal_charge')]
181+
except TypeError:
183182
charge = ' '
184183

185184
segid = chainid

0 commit comments

Comments
 (0)