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
f4e4c4b1
Commit
f4e4c4b1
authored
Apr 16, 2014
by
Jason Swails
Browse files
Get rid of extra point element -- use "None" as no element
parent
834f488b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
8 deletions
+17
-8
wrappers/python/simtk/openmm/app/charmmparameterset.py
wrappers/python/simtk/openmm/app/charmmparameterset.py
+10
-2
wrappers/python/simtk/openmm/app/charmmpsffile.py
wrappers/python/simtk/openmm/app/charmmpsffile.py
+6
-2
wrappers/python/simtk/openmm/app/element.py
wrappers/python/simtk/openmm/app/element.py
+1
-4
No files found.
wrappers/python/simtk/openmm/app/charmmparameterset.py
View file @
f4e4c4b1
...
@@ -231,7 +231,11 @@ class CharmmParameterSet(object):
...
@@ -231,7 +231,11 @@ class CharmmParameterSet(object):
atomic_number
=
get_by_symbol
(
elem
).
atomic_number
atomic_number
=
get_by_symbol
(
elem
).
atomic_number
except
(
IndexError
,
KeyError
):
except
(
IndexError
,
KeyError
):
# Figure it out from the mass
# Figure it out from the mass
atomic_number
=
Element
.
getByMass
(
mass
).
atomic_number
masselem
=
Element
.
getByMass
(
mass
)
if
masselem
is
None
:
atomic_number
=
0
# Extra point or something
else
:
atomic_number
=
masselem
.
atomic_number
atype
=
AtomType
(
name
=
name
,
number
=
idx
,
mass
=
mass
,
atype
=
AtomType
(
name
=
name
,
number
=
idx
,
mass
=
mass
,
atomic_number
=
atomic_number
)
atomic_number
=
atomic_number
)
self
.
atom_types_str
[
atype
.
name
]
=
atype
self
.
atom_types_str
[
atype
.
name
]
=
atype
...
@@ -452,7 +456,11 @@ class CharmmParameterSet(object):
...
@@ -452,7 +456,11 @@ class CharmmParameterSet(object):
atomic_number
=
get_by_symbol
(
elem
).
atomic_number
atomic_number
=
get_by_symbol
(
elem
).
atomic_number
except
(
IndexError
,
KeyError
):
except
(
IndexError
,
KeyError
):
# Figure it out from the mass
# Figure it out from the mass
atomic_number
=
Element
.
getByMass
(
mass
).
atomic_number
masselem
=
Element
.
getByMass
(
mass
)
if
masselem
is
None
:
atomic_number
=
0
# Extra point or something
else
:
atomic_number
=
masselem
.
atomic_number
atype
=
AtomType
(
name
=
name
,
number
=
idx
,
mass
=
mass
,
atype
=
AtomType
(
name
=
name
,
number
=
idx
,
mass
=
mass
,
atomic_number
=
atomic_number
)
atomic_number
=
atomic_number
)
self
.
atom_types_str
[
atype
.
name
]
=
atype
self
.
atom_types_str
[
atype
.
name
]
=
atype
...
...
wrappers/python/simtk/openmm/app/charmmpsffile.py
View file @
f4e4c4b1
...
@@ -773,8 +773,12 @@ class CharmmPsfFile(object):
...
@@ -773,8 +773,12 @@ class CharmmPsfFile(object):
atomic_num
=
atom
.
type
.
atomic_number
atomic_num
=
atom
.
type
.
atomic_number
elem
=
element
.
Element
.
getByAtomicNumber
(
atomic_num
)
elem
=
element
.
Element
.
getByAtomicNumber
(
atomic_num
)
else
:
else
:
# If we didn't load a parameter set yet, try based on mass
# Figure it out from the mass
elem
=
element
.
Element
.
getByMass
(
atom
.
mass
)
masselem
=
Element
.
getByMass
(
mass
)
if
masselem
is
None
:
atomic_number
=
0
# Extra point or something
else
:
atomic_number
=
masselem
.
atomic_number
topology
.
addAtom
(
atom
.
name
,
elem
,
residue
)
topology
.
addAtom
(
atom
.
name
,
elem
,
residue
)
# Add all of the bonds
# Add all of the bonds
...
...
wrappers/python/simtk/openmm/app/element.py
View file @
f4e4c4b1
...
@@ -103,7 +103,7 @@ class Element(object):
...
@@ -103,7 +103,7 @@ class Element(object):
if
not
is_quantity
(
mass
):
if
not
is_quantity
(
mass
):
mass
=
mass
*
daltons
mass
=
mass
*
daltons
diff
=
mass
diff
=
mass
best_guess
=
Element
.
_elements_by_atomic_number
[
0
]
best_guess
=
None
for
key
in
Element
.
_elements_by_atomic_number
:
for
key
in
Element
.
_elements_by_atomic_number
:
element
=
Element
.
_elements_by_atomic_number
[
key
]
element
=
Element
.
_elements_by_atomic_number
[
key
]
...
@@ -147,7 +147,6 @@ def _pickle_element(element):
...
@@ -147,7 +147,6 @@ def _pickle_element(element):
copy_reg
.
pickle
(
Element
,
_pickle_element
)
copy_reg
.
pickle
(
Element
,
_pickle_element
)
virtualsite
=
Element
(
0
,
"virtual site"
,
"EP"
,
0.0
*
daltons
)
hydrogen
=
Element
(
1
,
"hydrogen"
,
"H"
,
1.007947
*
daltons
)
hydrogen
=
Element
(
1
,
"hydrogen"
,
"H"
,
1.007947
*
daltons
)
deuterium
=
Element
(
1
,
"deuterium"
,
"D"
,
2.01355321270
*
daltons
)
deuterium
=
Element
(
1
,
"deuterium"
,
"D"
,
2.01355321270
*
daltons
)
helium
=
Element
(
2
,
"helium"
,
"He"
,
4.003
*
daltons
)
helium
=
Element
(
2
,
"helium"
,
"He"
,
4.003
*
daltons
)
...
@@ -270,5 +269,3 @@ ununhexium = Element(116, "ununhexium", "Uuh", 292*daltons)
...
@@ -270,5 +269,3 @@ ununhexium = Element(116, "ununhexium", "Uuh", 292*daltons)
# relational operators will work with any chosen name
# relational operators will work with any chosen name
sulphur
=
sulfur
sulphur
=
sulfur
aluminium
=
aluminum
aluminium
=
aluminum
extrapoint
=
virtualsite
lonepair
=
virtualsite
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