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
e4022a59
Commit
e4022a59
authored
Aug 06, 2015
by
peastman
Browse files
Minor improvements to loading PDBx files
parent
b32e5832
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
wrappers/python/simtk/openmm/app/pdbxfile.py
wrappers/python/simtk/openmm/app/pdbxfile.py
+5
-4
No files found.
wrappers/python/simtk/openmm/app/pdbxfile.py
View file @
e4022a59
...
...
@@ -91,6 +91,7 @@ class PDBxFile(object):
lastResId
=
None
lastAsymId
=
None
atomTable
=
{}
atomsInResidue
=
set
()
models
=
[]
for
row
in
atomData
.
getRowList
():
atomKey
=
((
row
[
resIdCol
],
row
[
asymIdCol
],
row
[
atomNameCol
]))
...
...
@@ -108,17 +109,16 @@ class PDBxFile(object):
if
lastChainId
!=
row
[
chainIdCol
]:
# The start of a new chain.
chain
=
top
.
addChain
(
row
[
chain
IdCol
])
chain
=
top
.
addChain
(
row
[
asym
IdCol
])
lastChainId
=
row
[
chainIdCol
]
lastResId
=
None
lastAsymId
=
None
if
lastResId
!=
row
[
resIdCol
]
or
lastAsymId
!=
row
[
asymIdCol
]:
if
lastResId
!=
row
[
resIdCol
]
or
lastAsymId
!=
row
[
asymIdCol
]
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
[
resIdCol
]
if
lastResId
==
'.'
:
lastResId
=
None
lastAsymId
=
row
[
asymIdCol
]
atomsInResidue
.
clear
()
element
=
None
try
:
element
=
elem
.
get_by_symbol
(
row
[
elementCol
])
...
...
@@ -126,6 +126,7 @@ class PDBxFile(object):
pass
atom
=
top
.
addAtom
(
row
[
atomNameCol
],
element
,
res
,
row
[
atomIdCol
])
atomTable
[
atomKey
]
=
atom
atomsInResidue
.
add
(
row
[
atomNameCol
])
else
:
# This row defines coordinates for an existing atom in one of the later models.
...
...
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