Unverified Commit 30d72a5c authored by peastman's avatar peastman Committed by GitHub
Browse files

Merge pull request #2355 from peastman/insertion

Fixed errors with residue insertion codes
parents a93a74de 5c8644d8
......@@ -710,7 +710,7 @@ class CharmmPsfFile(object):
last_residue = None
if resid != last_residue:
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:
# This is the most reliable way of determining the element
atomic_num = atom.type.atomic_number
......
......@@ -352,9 +352,11 @@ class PDBFile(object):
resName = res.name
if keepIds and len(res.id) < 5:
resId = res.id
resIC = res.insertionCode
else:
resId = "%4d" % ((resIndex+1)%10000)
if len(res.insertionCode) == 1:
resIC = res.insertionCode
else:
resIC = " "
if res.name in nonHeterogens:
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