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
OpenFold
Commits
7d53297c
Commit
7d53297c
authored
Sep 27, 2021
by
Gustaf Ahdritz
Browse files
Update pretrained runner
parent
2065a6ca
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
run_pretrained_alphafold.py
run_pretrained_alphafold.py
+9
-9
No files found.
run_pretrained_alphafold.py
View file @
7d53297c
...
...
@@ -14,8 +14,9 @@
# limitations under the License.
import
os
#import sys
#sys.path.append("lib/conda/lib/python3.9/site-packages")
# A hack to get OpenMM and PyTorch to peacefully coexist
os
.
environ
[
"OPENMM_DEFAULT_PLATFORM"
]
=
"OpenCL"
import
math
import
pickle
...
...
@@ -28,10 +29,6 @@ from config import model_config
from
openfold.model.model
import
AlphaFold
from
openfold.np
import
residue_constants
,
protein
#os.environ["OPENMM_DEFAULT_PLATFORM"] = "CPU"
os
.
environ
[
"OPENMM_DEFAULT_PLATFORM"
]
=
"OpenCL"
#os.environ["OPENMM_CPU_THREADS"] = "16"
import
openfold.np.relax.relax
as
relax
from
openfold.utils.import_weights
import
(
import_jax_weights_
,
...
...
@@ -43,10 +40,9 @@ from openfold.utils.tensor_utils import (
MODEL_NAME
=
"model_1"
MODEL_DEVICE
=
"cuda:
1
"
MODEL_DEVICE
=
"cuda:
4
"
PARAM_PATH
=
"openfold/resources/params/params_model_1.npz"
#FEAT_PATH = "tests/test_data/sample_feats.pickle"
FEAT_PATH
=
"prediction/1OJN_feats.pickle"
FEAT_PATH
=
"tests/test_data/sample_feats.pickle"
config
=
model_config
(
MODEL_NAME
)
model
=
AlphaFold
(
config
.
model
)
...
...
@@ -66,6 +62,8 @@ with torch.no_grad():
"extra_msa"
,
"residx_atom37_to_atom14"
,
"residx_atom14_to_atom37"
,
"true_msa"
,
"residue_index"
,
]
for
l
in
longs
:
batch
[
l
]
=
batch
[
l
].
long
()
...
...
@@ -95,6 +93,8 @@ unrelaxed_protein = protein.from_prediction(
b_factors
=
plddt_b_factors
)
os
.
environ
[
"CUDA_VISIBLE_DEVICES"
]
=
"7"
amber_relaxer
=
relax
.
AmberRelaxation
(
**
config
.
relax
)
...
...
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