Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
db637054
Commit
db637054
authored
Sep 25, 2017
by
João Rodrigues
Browse files
Changed all 'label_*' calls to 'auth_*' calls to match PDB format specifications.
parent
9a5004bf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
wrappers/python/simtk/openmm/app/pdbxfile.py
wrappers/python/simtk/openmm/app/pdbxfile.py
+6
-7
No files found.
wrappers/python/simtk/openmm/app/pdbxfile.py
View file @
db637054
...
...
@@ -80,10 +80,9 @@ class PDBxFile(object):
# Build the topology.
atomData
=
block
.
getObj
(
'atom_site'
)
atomNameCol
=
atomData
.
getAttributeIndex
(
'
label
_atom_id'
)
atomNameCol
=
atomData
.
getAttributeIndex
(
'
auth
_atom_id'
)
atomIdCol
=
atomData
.
getAttributeIndex
(
'id'
)
resNameCol
=
atomData
.
getAttributeIndex
(
'label_comp_id'
)
resIdCol
=
atomData
.
getAttributeIndex
(
'label_seq_id'
)
resNameCol
=
atomData
.
getAttributeIndex
(
'auth_comp_id'
)
resNumCol
=
atomData
.
getAttributeIndex
(
'auth_seq_id'
)
chainIdCol
=
atomData
.
getAttributeIndex
(
'auth_asym_id'
)
elementCol
=
atomData
.
getAttributeIndex
(
'type_symbol'
)
...
...
@@ -98,7 +97,7 @@ class PDBxFile(object):
atomsInResidue
=
set
()
models
=
[]
for
row
in
atomData
.
getRowList
():
atomKey
=
((
row
[
res
Id
Col
],
row
[
chainIdCol
],
row
[
atomNameCol
]))
atomKey
=
((
row
[
res
Num
Col
],
row
[
chainIdCol
],
row
[
atomNameCol
]))
model
=
(
'1'
if
modelCol
==
-
1
else
row
[
modelCol
])
if
model
not
in
models
:
models
.
append
(
model
)
...
...
@@ -116,10 +115,10 @@ class PDBxFile(object):
chain
=
top
.
addChain
(
row
[
chainIdCol
])
lastChainId
=
row
[
chainIdCol
]
lastResId
=
None
if
lastResId
!=
row
[
res
Id
Col
]
or
lastChainId
!=
row
[
chainIdCol
]
or
(
lastResId
==
'.'
and
row
[
atomNameCol
]
in
atomsInResidue
):
if
lastResId
!=
row
[
res
Num
Col
]
or
lastChainId
!=
row
[
chainIdCol
]
or
(
lastResId
==
'.'
and
row
[
atomNameCol
]
in
atomsInResidue
):
# The start of a new residue.
res
=
top
.
addResidue
(
row
[
resNameCol
],
chain
,
None
if
resNumCol
==
-
1
else
row
[
resNumCol
])
lastResId
=
row
[
res
Id
Col
]
lastResId
=
row
[
res
Num
Col
]
atomsInResidue
.
clear
()
element
=
None
try
:
...
...
@@ -135,7 +134,7 @@ class PDBxFile(object):
try
:
atom
=
atomTable
[
atomKey
]
except
KeyError
:
raise
ValueError
(
'Unknown atom %s in residue %s %s for model %s'
%
(
row
[
atomNameCol
],
row
[
resNameCol
],
row
[
res
Id
Col
],
model
))
raise
ValueError
(
'Unknown atom %s in residue %s %s for model %s'
%
(
row
[
atomNameCol
],
row
[
resNameCol
],
row
[
res
Num
Col
],
model
))
if
atom
.
index
!=
len
(
self
.
_positions
[
modelIndex
]):
raise
ValueError
(
'Atom %s for model %s does not match the order of atoms for model %s'
%
(
row
[
atomIdCol
],
model
,
models
[
0
]))
self
.
_positions
[
modelIndex
].
append
(
Vec3
(
float
(
row
[
xCol
]),
float
(
row
[
yCol
]),
float
(
row
[
zCol
]))
*
0.1
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment