Commit 5c8644d8 authored by peastman's avatar peastman
Browse files

Fixed errors with residue insertion codes

parent 2e86184b
...@@ -710,7 +710,7 @@ class CharmmPsfFile(object): ...@@ -710,7 +710,7 @@ class CharmmPsfFile(object):
last_residue = None last_residue = None
if resid != last_residue: if resid != last_residue:
last_residue = resid last_residue = resid
residue = topology.addResidue(atom.residue.resname, chain, resid) residue = topology.addResidue(atom.residue.resname, chain, str(atom.residue.idx), atom.residue.inscode)
if atom.type is not None: if atom.type is not None:
# This is the most reliable way of determining the element # This is the most reliable way of determining the element
atomic_num = atom.type.atomic_number atomic_num = atom.type.atomic_number
......
...@@ -352,9 +352,11 @@ class PDBFile(object): ...@@ -352,9 +352,11 @@ class PDBFile(object):
resName = res.name resName = res.name
if keepIds and len(res.id) < 5: if keepIds and len(res.id) < 5:
resId = res.id resId = res.id
resIC = res.insertionCode
else: else:
resId = "%4d" % ((resIndex+1)%10000) resId = "%4d" % ((resIndex+1)%10000)
if len(res.insertionCode) == 1:
resIC = res.insertionCode
else:
resIC = " " resIC = " "
if res.name in nonHeterogens: if res.name in nonHeterogens:
recordName = "ATOM " recordName = "ATOM "
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment