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
0f611850
Commit
0f611850
authored
Aug 06, 2015
by
peastman
Browse files
Merge pull request #1077 from peastman/pdbx
Minor improvements to loading PDBx files
parents
a1a61127
e4022a59
Changes
1
Show 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 @
0f611850
...
@@ -91,6 +91,7 @@ class PDBxFile(object):
...
@@ -91,6 +91,7 @@ class PDBxFile(object):
lastResId
=
None
lastResId
=
None
lastAsymId
=
None
lastAsymId
=
None
atomTable
=
{}
atomTable
=
{}
atomsInResidue
=
set
()
models
=
[]
models
=
[]
for
row
in
atomData
.
getRowList
():
for
row
in
atomData
.
getRowList
():
atomKey
=
((
row
[
resIdCol
],
row
[
asymIdCol
],
row
[
atomNameCol
]))
atomKey
=
((
row
[
resIdCol
],
row
[
asymIdCol
],
row
[
atomNameCol
]))
...
@@ -108,17 +109,16 @@ class PDBxFile(object):
...
@@ -108,17 +109,16 @@ class PDBxFile(object):
if
lastChainId
!=
row
[
chainIdCol
]:
if
lastChainId
!=
row
[
chainIdCol
]:
# The start of a new chain.
# The start of a new chain.
chain
=
top
.
addChain
(
row
[
chain
IdCol
])
chain
=
top
.
addChain
(
row
[
asym
IdCol
])
lastChainId
=
row
[
chainIdCol
]
lastChainId
=
row
[
chainIdCol
]
lastResId
=
None
lastResId
=
None
lastAsymId
=
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.
# The start of a new residue.
res
=
top
.
addResidue
(
row
[
resNameCol
],
chain
,
None
if
resNumCol
==
-
1
else
row
[
resNumCol
])
res
=
top
.
addResidue
(
row
[
resNameCol
],
chain
,
None
if
resNumCol
==
-
1
else
row
[
resNumCol
])
lastResId
=
row
[
resIdCol
]
lastResId
=
row
[
resIdCol
]
if
lastResId
==
'.'
:
lastResId
=
None
lastAsymId
=
row
[
asymIdCol
]
lastAsymId
=
row
[
asymIdCol
]
atomsInResidue
.
clear
()
element
=
None
element
=
None
try
:
try
:
element
=
elem
.
get_by_symbol
(
row
[
elementCol
])
element
=
elem
.
get_by_symbol
(
row
[
elementCol
])
...
@@ -126,6 +126,7 @@ class PDBxFile(object):
...
@@ -126,6 +126,7 @@ class PDBxFile(object):
pass
pass
atom
=
top
.
addAtom
(
row
[
atomNameCol
],
element
,
res
,
row
[
atomIdCol
])
atom
=
top
.
addAtom
(
row
[
atomNameCol
],
element
,
res
,
row
[
atomIdCol
])
atomTable
[
atomKey
]
=
atom
atomTable
[
atomKey
]
=
atom
atomsInResidue
.
add
(
row
[
atomNameCol
])
else
:
else
:
# This row defines coordinates for an existing atom in one of the later models.
# 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