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
OpenDAS
FastFold
Commits
274f8ffe
Commit
274f8ffe
authored
Dec 14, 2022
by
zhuww
Browse files
add amber minimize
parent
b6f5ac33
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
18 deletions
+17
-18
fastfold/relax/amber_minimize.py
fastfold/relax/amber_minimize.py
+2
-3
inference.py
inference.py
+15
-15
No files found.
fastfold/relax/amber_minimize.py
View file @
274f8ffe
...
...
@@ -94,8 +94,8 @@ def _openmm_minimize(
_add_restraints
(
system
,
pdb
,
stiffness
,
restraint_set
,
exclude_residues
)
integrator
=
openmm
.
LangevinIntegrator
(
0
,
0.01
,
0.0
)
platform
=
openmm
.
Platform
.
getPlatformByName
(
"CUDA"
if
use_gpu
else
"CPU"
)
simulation
=
openmm_app
.
Simulation
(
pdb
.
topology
,
system
,
integrator
,
platform
)
#
platform = openmm.Platform.getPlatformByName("CUDA" if use_gpu else "CPU")
simulation
=
openmm_app
.
Simulation
(
pdb
.
topology
,
system
,
integrator
)
simulation
.
context
.
setPositions
(
pdb
.
positions
)
ret
=
{}
...
...
@@ -536,7 +536,6 @@ def get_initial_energies(
openmm_pdbs
[
0
].
topology
,
system
,
openmm
.
LangevinIntegrator
(
0
,
0.01
,
0.0
),
openmm
.
Platform
.
getPlatformByName
(
"CPU"
),
)
energies
=
[]
for
pdb
in
openmm_pdbs
:
...
...
inference.py
View file @
274f8ffe
...
...
@@ -454,21 +454,21 @@ def inference_monomer_model(args):
with
open
(
unrelaxed_output_path
,
'w'
)
as
f
:
f
.
write
(
protein
.
to_pdb
(
unrelaxed_protein
))
#
amber_relaxer = relax.AmberRelaxation(
#
use_gpu=True,
#
**config.relax,
#
)
#
#
Relax the prediction.
#
t = time.perf_counter()
#
relaxed_pdb_str, _, _ = amber_relaxer.process(prot=unrelaxed_protein)
#
print(f"Relaxation time: {time.perf_counter() - t}")
#
#
Save the relaxed PDB.
#
relaxed_output_path = os.path.join(args.output_dir,
#
f'{tag}_{args.model_name}_relaxed.pdb')
#
with open(relaxed_output_path, 'w') as f:
#
f.write(relaxed_pdb_str)
amber_relaxer
=
relax
.
AmberRelaxation
(
use_gpu
=
True
,
**
config
.
relax
,
)
# Relax the prediction.
t
=
time
.
perf_counter
()
relaxed_pdb_str
,
_
,
_
=
amber_relaxer
.
process
(
prot
=
unrelaxed_protein
)
print
(
f
"Relaxation time:
{
time
.
perf_counter
()
-
t
}
"
)
# Save the relaxed PDB.
relaxed_output_path
=
os
.
path
.
join
(
args
.
output_dir
,
f
'
{
tag
}
_
{
args
.
model_name
}
_relaxed.pdb'
)
with
open
(
relaxed_output_path
,
'w'
)
as
f
:
f
.
write
(
relaxed_pdb_str
)
if
(
args
.
save_outputs
):
output_dict_path
=
os
.
path
.
join
(
...
...
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