"vscode:/vscode.git/clone" did not exist on "ab60c418eb00c0059bc6240dd1ceef9e6d623ca4"
Unverified Commit f9b6cd5a authored by peastman's avatar peastman Committed by GitHub
Browse files

Merge pull request #2575 from peastman/chain

Improved identification of chain IDs in PDBx/mmCIF files
parents 6786cc75 7db5140a
......@@ -101,6 +101,13 @@ class PDBxFile(object):
altChainIdCol = -1
else:
altChainIdCol = atomData.getAttributeIndex('label_asym_id')
if altChainIdCol != -1:
# Figure out which column is best to use for chain IDs.
idSet = set(row[chainIdCol] for row in atomData.getRowList())
altIdSet = set(row[altChainIdCol] for row in atomData.getRowList())
if len(altIdSet) > len(idSet):
chainIdCol, altChainIdCol = (altChainIdCol, chainIdCol)
elementCol = atomData.getAttributeIndex('type_symbol')
altIdCol = atomData.getAttributeIndex('label_alt_id')
modelCol = atomData.getAttributeIndex('pdbx_PDB_model_num')
......
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