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
8c43e37a
Unverified
Commit
8c43e37a
authored
Jun 04, 2020
by
peastman
Committed by
GitHub
Jun 04, 2020
Browse files
Merge pull request #2728 from peastman/drude
Don't mark Drude particles as deuterium
parents
12f17a6c
68eb50bd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
wrappers/python/simtk/openmm/app/pdbfile.py
wrappers/python/simtk/openmm/app/pdbfile.py
+8
-6
wrappers/python/tests/TestPdbFile.py
wrappers/python/tests/TestPdbFile.py
+1
-1
No files found.
wrappers/python/simtk/openmm/app/pdbfile.py
View file @
8c43e37a
...
@@ -6,7 +6,7 @@ Simbios, the NIH National Center for Physics-Based Simulation of
...
@@ -6,7 +6,7 @@ Simbios, the NIH National Center for Physics-Based Simulation of
Biological Structures at Stanford, funded under the NIH Roadmap for
Biological Structures at Stanford, funded under the NIH Roadmap for
Medical Research, grant U54 GM072970. See https://simtk.org.
Medical Research, grant U54 GM072970. See https://simtk.org.
Portions copyright (c) 2012-20
18
Stanford University and the Authors.
Portions copyright (c) 2012-20
20
Stanford University and the Authors.
Authors: Peter Eastman
Authors: Peter Eastman
Contributors:
Contributors:
...
@@ -139,8 +139,10 @@ class PDBFile(object):
...
@@ -139,8 +139,10 @@ class PDBFile(object):
element
=
elem
.
potassium
element
=
elem
.
potassium
elif
upper
.
startswith
(
'ZN'
):
elif
upper
.
startswith
(
'ZN'
):
element
=
elem
.
zinc
element
=
elem
.
zinc
elif
(
len
(
residue
)
==
1
and
upper
.
startswith
(
'CA'
)
)
:
elif
len
(
residue
)
==
1
and
upper
.
startswith
(
'CA'
):
element
=
elem
.
calcium
element
=
elem
.
calcium
elif
upper
.
startswith
(
'D'
)
and
any
(
a
.
name
==
atomName
[
1
:]
for
a
in
residue
.
iter_atoms
()):
pass
# A Drude particle
else
:
else
:
try
:
try
:
element
=
elem
.
get_by_symbol
(
upper
[
0
])
element
=
elem
.
get_by_symbol
(
upper
[
0
])
...
@@ -258,7 +260,7 @@ class PDBFile(object):
...
@@ -258,7 +260,7 @@ class PDBFile(object):
map
[
atom
.
attrib
[
id
]]
=
name
map
[
atom
.
attrib
[
id
]]
=
name
@
staticmethod
@
staticmethod
def
writeFile
(
topology
,
positions
,
file
=
sys
.
stdout
,
keepIds
=
False
,
extraParticleIdentifier
=
'
'
):
def
writeFile
(
topology
,
positions
,
file
=
sys
.
stdout
,
keepIds
=
False
,
extraParticleIdentifier
=
'
EP
'
):
"""Write a PDB file containing a single model.
"""Write a PDB file containing a single model.
Parameters
Parameters
...
@@ -274,7 +276,7 @@ class PDBFile(object):
...
@@ -274,7 +276,7 @@ class PDBFile(object):
rather than generating new ones. Warning: It is up to the caller to
rather than generating new ones. Warning: It is up to the caller to
make sure these are valid IDs that satisfy the requirements of the
make sure these are valid IDs that satisfy the requirements of the
PDB format. Otherwise, the output file will be invalid.
PDB format. Otherwise, the output file will be invalid.
extraParticleIdentifier : string='
'
extraParticleIdentifier : string='
EP
'
String to write in the element column of the ATOM records for atoms whose element is None (extra particles)
String to write in the element column of the ATOM records for atoms whose element is None (extra particles)
"""
"""
PDBFile
.
writeHeader
(
topology
,
file
)
PDBFile
.
writeHeader
(
topology
,
file
)
...
@@ -301,7 +303,7 @@ class PDBFile(object):
...
@@ -301,7 +303,7 @@ class PDBFile(object):
a
*
10
,
b
*
10
,
c
*
10
,
alpha
*
RAD_TO_DEG
,
beta
*
RAD_TO_DEG
,
gamma
*
RAD_TO_DEG
),
file
=
file
)
a
*
10
,
b
*
10
,
c
*
10
,
alpha
*
RAD_TO_DEG
,
beta
*
RAD_TO_DEG
,
gamma
*
RAD_TO_DEG
),
file
=
file
)
@
staticmethod
@
staticmethod
def
writeModel
(
topology
,
positions
,
file
=
sys
.
stdout
,
modelIndex
=
None
,
keepIds
=
False
,
extraParticleIdentifier
=
'
'
):
def
writeModel
(
topology
,
positions
,
file
=
sys
.
stdout
,
modelIndex
=
None
,
keepIds
=
False
,
extraParticleIdentifier
=
'
EP
'
):
"""Write out a model to a PDB file.
"""Write out a model to a PDB file.
Parameters
Parameters
...
@@ -321,7 +323,7 @@ class PDBFile(object):
...
@@ -321,7 +323,7 @@ class PDBFile(object):
make sure these are valid IDs that satisfy the requirements of the
make sure these are valid IDs that satisfy the requirements of the
PDB format. No guarantees are made about what will happen if they
PDB format. No guarantees are made about what will happen if they
are not, and the output file could be invalid.
are not, and the output file could be invalid.
extraParticleIdentifier : string='
'
extraParticleIdentifier : string='
EP
'
String to write in the element column of the ATOM records for atoms whose element is None (extra particles)
String to write in the element column of the ATOM records for atoms whose element is None (extra particles)
"""
"""
...
...
wrappers/python/tests/TestPdbFile.py
View file @
8c43e37a
...
@@ -80,7 +80,7 @@ class TestPdbFile(unittest.TestCase):
...
@@ -80,7 +80,7 @@ class TestPdbFile(unittest.TestCase):
output
=
StringIO
()
output
=
StringIO
()
PDBFile
.
writeFile
(
pdb
.
topology
,
pdb
.
positions
,
output
)
PDBFile
.
writeFile
(
pdb
.
topology
,
pdb
.
positions
,
output
)
input
=
StringIO
(
output
.
getvalue
())
input
=
StringIO
(
output
.
getvalue
())
pdb
=
PDBFile
(
input
,
extraParticleIdentifier
=
''
)
pdb
=
PDBFile
(
input
)
for
atom
in
pdb
.
topology
.
atoms
():
for
atom
in
pdb
.
topology
.
atoms
():
if
atom
.
index
>
2
:
if
atom
.
index
>
2
:
self
.
assertEqual
(
None
,
atom
.
element
)
self
.
assertEqual
(
None
,
atom
.
element
)
...
...
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