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
Commit
c04e70d9
authored
Apr 11, 2017
by
peastman
Browse files
Improved logic for guessing elements from atom names
parent
111844a2
Changes
1
Hide 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):
# Try to guess the element.
upper
=
atomName
.
upper
()
while
len
(
upper
)
>
1
and
upper
[
0
].
isnumeric
():
upper
=
upper
[
1
:]
if
upper
.
startswith
(
'CL'
):
element
=
elem
.
chlorine
elif
upper
.
startswith
(
'NA'
):
...
...
@@ -141,7 +143,7 @@ class PDBFile(object):
element
=
elem
.
calcium
else
:
try
:
element
=
elem
.
get_by_symbol
(
atomName
[
0
])
element
=
elem
.
get_by_symbol
(
upper
[
0
])
except
KeyError
:
pass
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