Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
alphafold2_jax
Commits
b5ed6b76
Commit
b5ed6b76
authored
Feb 08, 2022
by
Augustin Zidek
Committed by
Copybara-Service
Feb 08, 2022
Browse files
Remove unused code.
PiperOrigin-RevId: 427128482 Change-Id: I31134f7b0675260c79c799f14626140d74d745d4
parent
9c4ac8a9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
48 deletions
+0
-48
alphafold/relax/amber_minimize.py
alphafold/relax/amber_minimize.py
+0
-48
No files found.
alphafold/relax/amber_minimize.py
View file @
b5ed6b76
...
@@ -500,51 +500,3 @@ def run_pipeline(
...
@@ -500,51 +500,3 @@ def run_pipeline(
ret
[
"num_residue_violations"
],
ret
[
"num_exclusions"
])
ret
[
"num_residue_violations"
],
ret
[
"num_exclusions"
])
iteration
+=
1
iteration
+=
1
return
ret
return
ret
def
get_initial_energies
(
pdb_strs
:
Sequence
[
str
],
stiffness
:
float
=
0.0
,
restraint_set
:
str
=
"non_hydrogen"
,
exclude_residues
:
Optional
[
Sequence
[
int
]]
=
None
):
"""Returns initial potential energies for a sequence of PDBs.
Assumes the input PDBs are ready for minimization, and all have the same
topology.
Allows time to be saved by not pdbfixing / rebuilding the system.
Args:
pdb_strs: List of PDB strings.
stiffness: kcal/mol A**2, spring constant of heavy atom restraining
potential.
restraint_set: Which atom types to restrain.
exclude_residues: An optional list of zero-indexed residues to exclude from
restraints.
Returns:
A list of initial energies in the same order as pdb_strs.
"""
exclude_residues
=
exclude_residues
or
[]
openmm_pdbs
=
[
openmm_app
.
PDBFile
(
PdbStructure
(
io
.
StringIO
(
p
)))
for
p
in
pdb_strs
]
force_field
=
openmm_app
.
ForceField
(
"amber99sb.xml"
)
system
=
force_field
.
createSystem
(
openmm_pdbs
[
0
].
topology
,
constraints
=
openmm_app
.
HBonds
)
stiffness
=
stiffness
*
ENERGY
/
(
LENGTH
**
2
)
if
stiffness
>
0
*
ENERGY
/
(
LENGTH
**
2
):
_add_restraints
(
system
,
openmm_pdbs
[
0
],
stiffness
,
restraint_set
,
exclude_residues
)
simulation
=
openmm_app
.
Simulation
(
openmm_pdbs
[
0
].
topology
,
system
,
openmm
.
LangevinIntegrator
(
0
,
0.01
,
0.0
),
openmm
.
Platform
.
getPlatformByName
(
"CPU"
))
energies
=
[]
for
pdb
in
openmm_pdbs
:
try
:
simulation
.
context
.
setPositions
(
pdb
.
positions
)
state
=
simulation
.
context
.
getState
(
getEnergy
=
True
)
energies
.
append
(
state
.
getPotentialEnergy
().
value_in_unit
(
ENERGY
))
except
Exception
as
e
:
# pylint: disable=broad-except
logging
.
error
(
"Error getting initial energy, returning large value %s"
,
e
)
energies
.
append
(
unit
.
Quantity
(
1e20
,
ENERGY
))
return
energies
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