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
dd80fb3f
"platforms/reference/include/ReferenceKernels.h" did not exist on "dfba24ea66d4f8ee7e5abac7baca62c9acc031dc"
Unverified
Commit
dd80fb3f
authored
Jun 24, 2022
by
Peter Eastman
Committed by
GitHub
Jun 24, 2022
Browse files
PDBxFile replaces nonstandard names with standard ones (#3659)
parent
e9534c15
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
5 deletions
+16
-5
wrappers/python/openmm/app/data/pdbNames.xml
wrappers/python/openmm/app/data/pdbNames.xml
+2
-2
wrappers/python/openmm/app/pdbxfile.py
wrappers/python/openmm/app/pdbxfile.py
+14
-3
No files found.
wrappers/python/openmm/app/data/pdbNames.xml
View file @
dd80fb3f
...
@@ -129,7 +129,7 @@
...
@@ -129,7 +129,7 @@
<Atom
name=
"HE1"
alt1=
"HE"
/>
<Atom
name=
"HE1"
alt1=
"HE"
/>
<Atom
name=
"HE2"
alt1=
"HNE"
alt2=
"HNE2"
/>
<Atom
name=
"HE2"
alt1=
"HNE"
alt2=
"HNE2"
/>
</Residue>
</Residue>
<Residue
name=
"ASP"
type=
"Protein"
>
<Residue
name=
"ASP"
type=
"Protein"
alt1=
"ASH"
>
<Atom
name=
"HB2"
alt1=
"2HB"
/>
<Atom
name=
"HB2"
alt1=
"2HB"
/>
<Atom
name=
"HB3"
alt1=
"HB1"
alt2=
"1HB"
alt3=
"3HB"
/>
<Atom
name=
"HB3"
alt1=
"HB1"
alt2=
"1HB"
alt3=
"3HB"
/>
</Residue>
</Residue>
...
@@ -141,7 +141,7 @@
...
@@ -141,7 +141,7 @@
<Atom
name=
"HD21"
alt1=
"1HD2"
alt2=
"HND1"
/>
<Atom
name=
"HD21"
alt1=
"1HD2"
alt2=
"HND1"
/>
<Atom
name=
"HD22"
alt1=
"2HD2"
alt2=
"HND2"
/>
<Atom
name=
"HD22"
alt1=
"2HD2"
alt2=
"HND2"
/>
</Residue>
</Residue>
<Residue
name=
"GLU"
type=
"Protein"
>
<Residue
name=
"GLU"
type=
"Protein"
alt1=
"GLH"
>
<Atom
name=
"HB2"
alt1=
"2HB"
/>
<Atom
name=
"HB2"
alt1=
"2HB"
/>
<Atom
name=
"HB3"
alt1=
"HB1"
alt2=
"1HB"
alt3=
"3HB"
/>
<Atom
name=
"HB3"
alt1=
"HB1"
alt2=
"1HB"
alt3=
"3HB"
/>
<Atom
name=
"HG2"
alt1=
"2HG"
/>
<Atom
name=
"HG2"
alt1=
"2HG"
/>
...
...
wrappers/python/openmm/app/pdbxfile.py
View file @
dd80fb3f
...
@@ -66,6 +66,7 @@ class PDBxFile(object):
...
@@ -66,6 +66,7 @@ class PDBxFile(object):
## The Topology read from the PDBx/mmCIF file
## The Topology read from the PDBx/mmCIF file
self
.
topology
=
top
self
.
topology
=
top
self
.
_positions
=
[]
self
.
_positions
=
[]
PDBFile
.
_loadNameReplacementTables
()
# Load the file.
# Load the file.
...
@@ -152,7 +153,14 @@ class PDBxFile(object):
...
@@ -152,7 +153,14 @@ class PDBxFile(object):
# The start of a new residue.
# The start of a new residue.
resId
=
(
None
if
resNumCol
==
-
1
else
row
[
resNumCol
])
resId
=
(
None
if
resNumCol
==
-
1
else
row
[
resNumCol
])
resIC
=
insertionCode
resIC
=
insertionCode
res
=
top
.
addResidue
(
row
[
resNameCol
],
chain
,
resId
,
resIC
)
resName
=
row
[
resNameCol
]
if
resName
in
PDBFile
.
_residueNameReplacements
:
resName
=
PDBFile
.
_residueNameReplacements
[
resName
]
res
=
top
.
addResidue
(
resName
,
chain
,
resId
,
resIC
)
if
resName
in
PDBFile
.
_atomNameReplacements
:
atomReplacements
=
PDBFile
.
_atomNameReplacements
[
resName
]
else
:
atomReplacements
=
{}
lastResId
=
row
[
resNumCol
]
lastResId
=
row
[
resNumCol
]
lastInsertionCode
=
insertionCode
lastInsertionCode
=
insertionCode
atomsInResidue
.
clear
()
atomsInResidue
.
clear
()
...
@@ -161,9 +169,12 @@ class PDBxFile(object):
...
@@ -161,9 +169,12 @@ class PDBxFile(object):
element
=
elem
.
get_by_symbol
(
row
[
elementCol
])
element
=
elem
.
get_by_symbol
(
row
[
elementCol
])
except
KeyError
:
except
KeyError
:
pass
pass
atom
=
top
.
addAtom
(
row
[
atomNameCol
],
element
,
res
,
row
[
atomIdCol
])
atomName
=
row
[
atomNameCol
]
if
atomName
in
atomReplacements
:
atomName
=
atomReplacements
[
atomName
]
atom
=
top
.
addAtom
(
atomName
,
element
,
res
,
row
[
atomIdCol
])
atomTable
[
atomKey
]
=
atom
atomTable
[
atomKey
]
=
atom
atomsInResidue
.
add
(
row
[
atomName
Col
]
)
atomsInResidue
.
add
(
atomName
)
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