Commit 774638c3 authored by João Rodrigues's avatar João Rodrigues
Browse files

Removed references to 'label_asym_id' and corrected atomKey to use proper chainIdCol values.

parent 2842dd7c
...@@ -85,7 +85,6 @@ class PDBxFile(object): ...@@ -85,7 +85,6 @@ class PDBxFile(object):
resNameCol = atomData.getAttributeIndex('label_comp_id') resNameCol = atomData.getAttributeIndex('label_comp_id')
resIdCol = atomData.getAttributeIndex('label_seq_id') resIdCol = atomData.getAttributeIndex('label_seq_id')
resNumCol = atomData.getAttributeIndex('auth_seq_id') resNumCol = atomData.getAttributeIndex('auth_seq_id')
asymIdCol = atomData.getAttributeIndex('label_asym_id')
chainIdCol = atomData.getAttributeIndex('auth_asym_id') chainIdCol = atomData.getAttributeIndex('auth_asym_id')
elementCol = atomData.getAttributeIndex('type_symbol') elementCol = atomData.getAttributeIndex('type_symbol')
altIdCol = atomData.getAttributeIndex('label_alt_id') altIdCol = atomData.getAttributeIndex('label_alt_id')
...@@ -95,12 +94,11 @@ class PDBxFile(object): ...@@ -95,12 +94,11 @@ class PDBxFile(object):
zCol = atomData.getAttributeIndex('Cartn_z') zCol = atomData.getAttributeIndex('Cartn_z')
lastChainId = None lastChainId = None
lastResId = None lastResId = None
lastAsymId = None
atomTable = {} atomTable = {}
atomsInResidue = set() atomsInResidue = set()
models = [] models = []
for row in atomData.getRowList(): for row in atomData.getRowList():
atomKey = ((row[resIdCol], row[asymIdCol], row[atomNameCol])) atomKey = ((row[resIdCol], row[chainIdCol], row[atomNameCol]))
model = ('1' if modelCol == -1 else row[modelCol]) model = ('1' if modelCol == -1 else row[modelCol])
if model not in models: if model not in models:
models.append(model) models.append(model)
...@@ -118,12 +116,10 @@ class PDBxFile(object): ...@@ -118,12 +116,10 @@ class PDBxFile(object):
chain = top.addChain(row[chainIdCol]) chain = top.addChain(row[chainIdCol])
lastChainId = row[chainIdCol] lastChainId = row[chainIdCol]
lastResId = None lastResId = None
lastAsymId = None if lastResId != row[resIdCol] or lastChainId != row[chainIdCol] or (lastResId == '.' and row[atomNameCol] in atomsInResidue):
if lastResId != row[resIdCol] or lastAsymId != row[asymIdCol] or (lastResId == '.' and row[atomNameCol] in atomsInResidue):
# The start of a new residue. # The start of a new residue.
res = top.addResidue(row[resNameCol], chain, None if resNumCol == -1 else row[resNumCol]) res = top.addResidue(row[resNameCol], chain, None if resNumCol == -1 else row[resNumCol])
lastResId = row[resIdCol] lastResId = row[resIdCol]
lastAsymId = row[asymIdCol]
atomsInResidue.clear() atomsInResidue.clear()
element = None element = None
try: try:
......
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