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
47b2ac75
Commit
47b2ac75
authored
Apr 03, 2013
by
Peter Eastman
Browse files
Modeller.addHydrogens() returns a list of what variants were used
parent
293eccf9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
wrappers/python/simtk/openmm/app/modeller.py
wrappers/python/simtk/openmm/app/modeller.py
+5
-1
No files found.
wrappers/python/simtk/openmm/app/modeller.py
View file @
47b2ac75
...
...
@@ -6,7 +6,7 @@ Simbios, the NIH National Center for Physics-Based Simulation of
Biological Structures at Stanford, funded under the NIH Roadmap for
Medical Research, grant U54 GM072970. See https://simtk.org.
Portions copyright (c) 2012 Stanford University and the Authors.
Portions copyright (c) 2012
-2013
Stanford University and the Authors.
Authors: Peter Eastman
Contributors:
...
...
@@ -531,6 +531,7 @@ class Modeller(object):
- variants (list=None) an optional list of variants to use. If this is specified, its length must equal the number
of residues in the model. variants[i] is the name of the variant to use for residue i (indexed starting at 0).
If an element is None, the standard rules will be followed to select a variant for that residue.
Returns: a list of what variant was actually selected for each residue, in the same format as the variants parameter
"""
# Check the list of variants.
...
...
@@ -540,6 +541,7 @@ class Modeller(object):
raise
ValueError
(
"The length of the variants list must equal the number of residues"
)
else
:
variants
=
[
None
]
*
len
(
residues
)
actualVariants
=
[
None
]
*
len
(
residues
)
# Load the residue specifications.
...
...
@@ -664,6 +666,7 @@ class Modeller(object):
variant
=
'HIP'
if
variant
is
not
None
and
variant
not
in
spec
.
variants
:
raise
ValueError
(
'Illegal variant for %s residue: %s'
%
(
residue
.
name
,
variant
))
actualVariants
[
residue
.
index
]
=
variant
# Make a list of hydrogens that should be present in the residue.
...
...
@@ -746,3 +749,4 @@ class Modeller(object):
LocalEnergyMinimizer
.
minimize
(
context
)
self
.
topology
=
newTopology
self
.
positions
=
context
.
getState
(
getPositions
=
True
).
getPositions
()
return
actualVariants
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