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
b535e651
Commit
b535e651
authored
Nov 05, 2014
by
peastman
Browse files
Cleanup to PDBx/mmCIF reader
parent
2504cf1a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
8 deletions
+5
-8
wrappers/python/simtk/openmm/app/pdbxfile.py
wrappers/python/simtk/openmm/app/pdbxfile.py
+5
-8
No files found.
wrappers/python/simtk/openmm/app/pdbxfile.py
View file @
b535e651
...
...
@@ -44,11 +44,7 @@ except:
pass
class
PDBxFile
(
object
):
"""PDBxFile parses a PDBx/mmCIF file and constructs a Topology and a set of atom positions from it.
This class also provides methods for creating PDBx/mmCIF files. To write a file containing a single model, call
writeFile(). You also can create files that contain multiple models. To do this, first call writeHeader(),
then writeModel() once for each model in the file, and finally writeFooter() to complete the file."""
"""PDBxFile parses a PDBx/mmCIF file and constructs a Topology and a set of atom positions from it."""
def
__init__
(
self
,
file
):
"""Load a PDBx/mmCIF file.
...
...
@@ -93,7 +89,8 @@ class PDBxFile(object):
atomTable
=
{}
models
=
[]
for
row
in
atomData
.
getRowList
():
atomKey
=
((
row
[
resIdCol
],
row
[
asymIdCol
],
row
[
atomNameCol
]))
asymId
=
(
'A'
if
asymIdCol
==
-
1
else
row
[
asymIdCol
])
atomKey
=
((
row
[
resIdCol
],
asymId
,
row
[
atomNameCol
]))
model
=
(
'1'
if
modelCol
==
-
1
else
row
[
modelCol
])
if
model
not
in
models
:
models
.
append
(
model
)
...
...
@@ -108,11 +105,11 @@ class PDBxFile(object):
lastChainId
=
row
[
chainIdCol
]
lastResId
=
None
lastAsymId
=
None
if
lastResId
!=
row
[
resIdCol
]
or
lastAsymId
!=
row
[
asymId
Col
]
:
if
lastResId
!=
row
[
resIdCol
]
or
lastAsymId
!=
asymId
:
# The start of a new residue.
res
=
top
.
addResidue
(
row
[
resNameCol
],
chain
)
lastResId
=
row
[
resIdCol
]
lastAsymId
=
row
[
asymId
Col
]
lastAsymId
=
asymId
element
=
None
try
:
element
=
elem
.
get_by_symbol
(
row
[
elementCol
])
...
...
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