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
c04e70d9
"vscode:/vscode.git/clone" did not exist on "bd3088748eeb6723b8fdcb26b51ab4b09bf851e7"
Commit
c04e70d9
authored
Apr 11, 2017
by
peastman
Browse files
Improved logic for guessing elements from atom names
parent
111844a2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
wrappers/python/simtk/openmm/app/pdbfile.py
wrappers/python/simtk/openmm/app/pdbfile.py
+3
-1
No files found.
wrappers/python/simtk/openmm/app/pdbfile.py
View file @
c04e70d9
...
@@ -123,6 +123,8 @@ class PDBFile(object):
...
@@ -123,6 +123,8 @@ class PDBFile(object):
# Try to guess the element.
# Try to guess the element.
upper
=
atomName
.
upper
()
upper
=
atomName
.
upper
()
while
len
(
upper
)
>
1
and
upper
[
0
].
isnumeric
():
upper
=
upper
[
1
:]
if
upper
.
startswith
(
'CL'
):
if
upper
.
startswith
(
'CL'
):
element
=
elem
.
chlorine
element
=
elem
.
chlorine
elif
upper
.
startswith
(
'NA'
):
elif
upper
.
startswith
(
'NA'
):
...
@@ -141,7 +143,7 @@ class PDBFile(object):
...
@@ -141,7 +143,7 @@ class PDBFile(object):
element
=
elem
.
calcium
element
=
elem
.
calcium
else
:
else
:
try
:
try
:
element
=
elem
.
get_by_symbol
(
atomName
[
0
])
element
=
elem
.
get_by_symbol
(
upper
[
0
])
except
KeyError
:
except
KeyError
:
pass
pass
newAtom
=
top
.
addAtom
(
atomName
,
element
,
r
,
str
(
atom
.
serial_number
))
newAtom
=
top
.
addAtom
(
atomName
,
element
,
r
,
str
(
atom
.
serial_number
))
...
...
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