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
a83178d4
Unverified
Commit
a83178d4
authored
May 18, 2022
by
Peter Eastman
Committed by
GitHub
May 18, 2022
Browse files
ForceFields can store extra attributes for residues (#3604)
parent
109f6b25
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
wrappers/python/openmm/app/forcefield.py
wrappers/python/openmm/app/forcefield.py
+6
-0
No files found.
wrappers/python/openmm/app/forcefield.py
View file @
a83178d4
...
...
@@ -298,6 +298,8 @@ class ForceField(object):
template
.
overrideLevel
=
int
(
residue
.
attrib
[
'override'
])
if
'rigidWater'
in
residue
.
attrib
:
template
.
rigidWater
=
(
residue
.
attrib
[
'rigidWater'
].
lower
()
==
'true'
)
for
key
in
residue
.
attrib
:
template
.
attributes
[
key
]
=
residue
.
attrib
[
key
]
atomIndices
=
template
.
atomIndices
for
ia
,
atom
in
enumerate
(
residue
.
findall
(
'Atom'
)):
params
=
{}
...
...
@@ -342,6 +344,8 @@ class ForceField(object):
else
:
numResidues
=
1
patchData
=
ForceField
.
_PatchData
(
patchName
,
numResidues
)
for
key
in
patch
.
attrib
:
patchData
.
attributes
[
key
]
=
patch
.
attrib
[
key
]
for
atom
in
patch
.
findall
(
'AddAtom'
):
params
=
{}
for
key
in
atom
.
attrib
:
...
...
@@ -668,6 +672,7 @@ class ForceField(object):
self
.
externalBonds
=
[]
self
.
overrideLevel
=
0
self
.
rigidWater
=
True
self
.
attributes
=
{}
def
getAtomIndexByName
(
self
,
atom_name
):
"""Look up an atom index by atom name, providing a helpful error message if not found."""
...
...
@@ -799,6 +804,7 @@ class ForceField(object):
self
.
deletedExternalBonds
=
[]
self
.
allAtomNames
=
set
()
self
.
virtualSites
=
[[]
for
i
in
range
(
numResidues
)]
self
.
attributes
=
{}
def
createPatchedTemplates
(
self
,
templates
):
"""Apply this patch to a set of templates, creating new modified ones."""
...
...
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