"csrc/vscode:/vscode.git/clone" did not exist on "24324cc5408aa7f70dbc28880ec4b68690cb18e7"
Unverified Commit e0b3c2bd authored by peastman's avatar peastman Committed by GitHub
Browse files

Merge pull request #2307 from peastman/pdbxlabel

PDBxFile is more robust
parents 25e12f36 21cb4f94
...@@ -6,7 +6,7 @@ Simbios, the NIH National Center for Physics-Based Simulation of ...@@ -6,7 +6,7 @@ Simbios, the NIH National Center for Physics-Based Simulation of
Biological Structures at Stanford, funded under the NIH Roadmap for Biological Structures at Stanford, funded under the NIH Roadmap for
Medical Research, grant U54 GM072970. See https://simtk.org. Medical Research, grant U54 GM072970. See https://simtk.org.
Portions copyright (c) 2015-2018 Stanford University and the Authors. Portions copyright (c) 2015-2019 Stanford University and the Authors.
Authors: Peter Eastman Authors: Peter Eastman
Contributors: Jason Swails Contributors: Jason Swails
...@@ -85,11 +85,19 @@ class PDBxFile(object): ...@@ -85,11 +85,19 @@ class PDBxFile(object):
atomData = block.getObj('atom_site') atomData = block.getObj('atom_site')
atomNameCol = atomData.getAttributeIndex('auth_atom_id') atomNameCol = atomData.getAttributeIndex('auth_atom_id')
if atomNameCol == -1:
atomNameCol = atomData.getAttributeIndex('label_atom_id')
atomIdCol = atomData.getAttributeIndex('id') atomIdCol = atomData.getAttributeIndex('id')
resNameCol = atomData.getAttributeIndex('auth_comp_id') resNameCol = atomData.getAttributeIndex('auth_comp_id')
if resNameCol == -1:
resNameCol = atomData.getAttributeIndex('label_comp_id')
resNumCol = atomData.getAttributeIndex('auth_seq_id') resNumCol = atomData.getAttributeIndex('auth_seq_id')
if resNumCol == -1:
resNumCol = atomData.getAttributeIndex('label_seq_id')
resInsertionCol = atomData.getAttributeIndex('pdbx_PDB_ins_code') resInsertionCol = atomData.getAttributeIndex('pdbx_PDB_ins_code')
chainIdCol = atomData.getAttributeIndex('auth_asym_id') chainIdCol = atomData.getAttributeIndex('auth_asym_id')
if chainIdCol == -1:
chainIdCol = atomData.getAttributeIndex('label_asym_id')
elementCol = atomData.getAttributeIndex('type_symbol') elementCol = atomData.getAttributeIndex('type_symbol')
altIdCol = atomData.getAttributeIndex('label_alt_id') altIdCol = atomData.getAttributeIndex('label_alt_id')
modelCol = atomData.getAttributeIndex('pdbx_PDB_model_num') 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