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
75c79b79
Commit
75c79b79
authored
Sep 20, 2021
by
Gustaf Ahdritz
Browse files
Rename main directory
parent
bf382368
Changes
34
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
35 additions
and
35 deletions
+35
-35
openfold/np/relax/amber_minimize.py
openfold/np/relax/amber_minimize.py
+3
-3
openfold/np/relax/cleanup.py
openfold/np/relax/cleanup.py
+0
-0
openfold/np/relax/relax.py
openfold/np/relax/relax.py
+2
-2
openfold/np/relax/utils.py
openfold/np/relax/utils.py
+1
-1
openfold/np/residue_constants.py
openfold/np/residue_constants.py
+1
-1
openfold/utils/__init__.py
openfold/utils/__init__.py
+0
-0
openfold/utils/affine_utils.py
openfold/utils/affine_utils.py
+0
-0
openfold/utils/deepspeed.py
openfold/utils/deepspeed.py
+0
-0
openfold/utils/feats.py
openfold/utils/feats.py
+3
-3
openfold/utils/import_weights.py
openfold/utils/import_weights.py
+0
-0
openfold/utils/loss.py
openfold/utils/loss.py
+15
-15
openfold/utils/tensor_utils.py
openfold/utils/tensor_utils.py
+0
-0
run_pretrained_alphafold.py
run_pretrained_alphafold.py
+7
-7
scripts/install_third_party_dependencies.sh
scripts/install_third_party_dependencies.sh
+3
-3
No files found.
alpha
fold/np/relax/amber_minimize.py
→
open
fold/np/relax/amber_minimize.py
View file @
75c79b79
...
@@ -20,11 +20,11 @@ import time
...
@@ -20,11 +20,11 @@ import time
from
typing
import
Collection
,
Optional
,
Sequence
from
typing
import
Collection
,
Optional
,
Sequence
from
absl
import
logging
from
absl
import
logging
from
alpha
fold.np
import
(
from
open
fold.np
import
(
protein
,
protein
,
residue_constants
,
residue_constants
,
)
)
from
alpha
fold.utils.loss
import
(
from
open
fold.utils.loss
import
(
find_structural_violations_np
,
find_structural_violations_np
,
compute_violation_metrics_np
,
compute_violation_metrics_np
,
)
)
...
@@ -32,7 +32,7 @@ from alphafold.utils.loss import (
...
@@ -32,7 +32,7 @@ from alphafold.utils.loss import (
find_structural_violations
=
find_structural_violations_np
find_structural_violations
=
find_structural_violations_np
compute_violation_metrics
=
compute_violation_metrics_np
compute_violation_metrics
=
compute_violation_metrics_np
from
alpha
fold.np.relax
import
cleanup
,
utils
from
open
fold.np.relax
import
cleanup
,
utils
import
ml_collections
import
ml_collections
import
numpy
as
np
import
numpy
as
np
from
simtk
import
openmm
from
simtk
import
openmm
...
...
alpha
fold/np/relax/cleanup.py
→
open
fold/np/relax/cleanup.py
View file @
75c79b79
File moved
alpha
fold/np/relax/relax.py
→
open
fold/np/relax/relax.py
View file @
75c79b79
...
@@ -15,8 +15,8 @@
...
@@ -15,8 +15,8 @@
"""Amber relaxation."""
"""Amber relaxation."""
from
typing
import
Any
,
Dict
,
Sequence
,
Tuple
from
typing
import
Any
,
Dict
,
Sequence
,
Tuple
from
alpha
fold.np
import
protein
from
open
fold.np
import
protein
from
alpha
fold.np.relax
import
amber_minimize
,
utils
from
open
fold.np.relax
import
amber_minimize
,
utils
import
numpy
as
np
import
numpy
as
np
...
...
alpha
fold/np/relax/utils.py
→
open
fold/np/relax/utils.py
View file @
75c79b79
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
"""Utils for minimization."""
"""Utils for minimization."""
import
io
import
io
from
alpha
fold.np
import
residue_constants
from
open
fold.np
import
residue_constants
from
Bio
import
PDB
from
Bio
import
PDB
import
numpy
as
np
import
numpy
as
np
from
simtk.openmm
import
app
as
openmm_app
from
simtk.openmm
import
app
as
openmm_app
...
...
alpha
fold/np/residue_constants.py
→
open
fold/np/residue_constants.py
View file @
75c79b79
...
@@ -405,7 +405,7 @@ def load_stereo_chemical_props() -> Tuple[Mapping[str, List[Bond]],
...
@@ -405,7 +405,7 @@ def load_stereo_chemical_props() -> Tuple[Mapping[str, List[Bond]],
"""
"""
# TODO: this file should be downloaded in a setup script
# TODO: this file should be downloaded in a setup script
stereo_chemical_props_path
=
(
stereo_chemical_props_path
=
(
'
alpha
fold/resources/stereo_chemical_props.txt'
)
'
open
fold/resources/stereo_chemical_props.txt'
)
with
open
(
stereo_chemical_props_path
,
'rt'
)
as
f
:
with
open
(
stereo_chemical_props_path
,
'rt'
)
as
f
:
stereo_chemical_props
=
f
.
read
()
stereo_chemical_props
=
f
.
read
()
lines_iter
=
iter
(
stereo_chemical_props
.
splitlines
())
lines_iter
=
iter
(
stereo_chemical_props
.
splitlines
())
...
...
alpha
fold/utils/__init__.py
→
open
fold/utils/__init__.py
View file @
75c79b79
File moved
alpha
fold/utils/affine_utils.py
→
open
fold/utils/affine_utils.py
View file @
75c79b79
File moved
alpha
fold/utils/deepspeed.py
→
open
fold/utils/deepspeed.py
View file @
75c79b79
File moved
alpha
fold/utils/feats.py
→
open
fold/utils/feats.py
View file @
75c79b79
...
@@ -18,9 +18,9 @@ import torch
...
@@ -18,9 +18,9 @@ import torch
import
torch.nn
as
nn
import
torch.nn
as
nn
from
typing
import
Dict
from
typing
import
Dict
import
alpha
fold.np.residue_constants
as
residue_constants
import
open
fold.np.residue_constants
as
residue_constants
from
alpha
fold.utils.affine_utils
import
T
from
open
fold.utils.affine_utils
import
T
from
alpha
fold.utils.tensor_utils
import
(
from
open
fold.utils.tensor_utils
import
(
batched_gather
,
batched_gather
,
one_hot
,
one_hot
,
)
)
...
...
alpha
fold/utils/import_weights.py
→
open
fold/utils/import_weights.py
View file @
75c79b79
File moved
alpha
fold/utils/loss.py
→
open
fold/utils/loss.py
View file @
75c79b79
...
@@ -20,10 +20,10 @@ import torch
...
@@ -20,10 +20,10 @@ import torch
import
torch.nn
as
nn
import
torch.nn
as
nn
from
typing
import
Dict
,
Optional
from
typing
import
Dict
,
Optional
from
alpha
fold.np
import
residue_constants
from
open
fold.np
import
residue_constants
from
alpha
fold.model.primitives
import
Linear
from
open
fold.model.primitives
import
Linear
from
alpha
fold.utils.affine_utils
import
T
from
open
fold.utils.affine_utils
import
T
from
alpha
fold.utils.tensor_utils
import
(
from
open
fold.utils.tensor_utils
import
(
tree_map
,
tree_map
,
tensor_tree_map
,
tensor_tree_map
,
masked_mean
,
masked_mean
,
...
@@ -992,7 +992,7 @@ def find_structural_violations_np(
...
@@ -992,7 +992,7 @@ def find_structural_violations_np(
batch
=
tree_map
(
to_tensor
,
batch
,
np
.
ndarray
)
batch
=
tree_map
(
to_tensor
,
batch
,
np
.
ndarray
)
atom14_pred_positions
=
to_tensor
(
atom14_pred_positions
)
atom14_pred_positions
=
to_tensor
(
atom14_pred_positions
)
out
=
find_structural_violations
(
batch
,
atom14_pred_positions
,
config
)
out
=
find_structural_violations
(
batch
,
atom14_pred_positions
,
**
config
)
to_np
=
lambda
x
:
np
.
array
(
x
)
to_np
=
lambda
x
:
np
.
array
(
x
)
np_out
=
tensor_tree_map
(
to_np
,
out
)
np_out
=
tensor_tree_map
(
to_np
,
out
)
...
@@ -1246,7 +1246,7 @@ def experimentally_resolved_loss(
...
@@ -1246,7 +1246,7 @@ def experimentally_resolved_loss(
def
masked_msa_loss
(
logits
,
true_msa
,
bert_mask
,
eps
=
1e-8
):
def
masked_msa_loss
(
logits
,
true_msa
,
bert_mask
,
eps
=
1e-8
):
errors
=
softmax_cross_entropy
(
errors
=
softmax_cross_entropy
(
logits
,
logits
,
torch
.
nn
.
functional
.
one_hot
(
true_msa
,
num_classes
=
23
,
torch
.
nn
.
functional
.
one_hot
(
true_msa
,
num_classes
=
23
)
)
)
loss
=
(
loss
=
(
torch
.
sum
(
errors
*
bert_mask
,
dim
=
(
-
1
,
-
2
))
/
torch
.
sum
(
errors
*
bert_mask
,
dim
=
(
-
1
,
-
2
))
/
...
@@ -1280,14 +1280,14 @@ class AlphaFoldLoss(nn.Module):
...
@@ -1280,14 +1280,14 @@ class AlphaFoldLoss(nn.Module):
loss_fns
=
{
loss_fns
=
{
"distogram"
:
"distogram"
:
lambda
:
distogram_loss
(
lambda
:
distogram_loss
(
logits
=
out
[
"distogram_logits"
],
out
[
"distogram_logits"
],
{
**
batch
,
**
{
**
batch
,
**
self
.
config
.
distogram
},
**
self
.
config
.
distogram
},
),
),
"experimentally_resolved"
:
"experimentally_resolved"
:
lambda
:
experimentally_resolved_loss
(
lambda
:
experimentally_resolved_loss
(
logits
=
out
[
"experimentally_resolved"
],
out
[
"experimentally_resolved"
],
{
**
batch
,
**
{
**
batch
,
**
self
.
config
.
experimentally_resolved
},
**
self
.
config
.
experimentally_resolved
},
),
),
"fape"
:
"fape"
:
...
@@ -1298,22 +1298,22 @@ class AlphaFoldLoss(nn.Module):
...
@@ -1298,22 +1298,22 @@ class AlphaFoldLoss(nn.Module):
),
),
"lddt"
:
"lddt"
:
lambda
:
lddt_loss
(
lambda
:
lddt_loss
(
logits
=
out
[
"lddt_logits"
],
out
[
"lddt_logits"
],
all_atom_pred_pos
=
out
[
"final_atom_positions"
]
all_atom_pred_pos
=
out
[
"final_atom_positions"
]
{
**
batch
,
**
{
**
batch
,
**
self
.
config
.
lddt
},
**
self
.
config
.
lddt
},
),
),
"masked_msa"
:
"masked_msa"
:
lambda
:
masked_msa_loss
(
lambda
:
masked_msa_loss
(
logits
=
out
[
"masked_msa_logits"
],
out
[
"masked_msa_logits"
],
{
**
batch
,
**
{
**
batch
,
**
self
.
config
.
masked_msa
},
**
self
.
config
.
masked_msa
},
),
),
"supervised_chi"
:
"supervised_chi"
:
lambda
:
supervised_chi_loss
(
lambda
:
supervised_chi_loss
(
out
[
"sm"
][
"angles"
],
out
[
"sm"
][
"angles"
],
out
[
"sm"
][
"unnormalized_angles"
],
out
[
"sm"
][
"unnormalized_angles"
],
{
**
batch
,
**
{
**
batch
,
**
self
.
config
.
supervised_chi
},
**
self
.
config
.
supervised_chi
},
),
),
"violation"
:
"violation"
:
...
...
alpha
fold/utils/tensor_utils.py
→
open
fold/utils/tensor_utils.py
View file @
75c79b79
File moved
run_pretrained_alphafold.py
View file @
75c79b79
...
@@ -25,14 +25,14 @@ import torch.nn as nn
...
@@ -25,14 +25,14 @@ import torch.nn as nn
import
numpy
as
np
import
numpy
as
np
from
config
import
model_config
from
config
import
model_config
from
alpha
fold.model.model
import
AlphaFold
from
open
fold.model.model
import
AlphaFold
import
alpha
fold.np.protein
as
protein
import
open
fold.np.protein
as
protein
import
alpha
fold.np.relax.relax
as
relax
import
open
fold.np.relax.relax
as
relax
from
alpha
fold.np
import
residue_constants
from
open
fold.np
import
residue_constants
from
alpha
fold.utils.import_weights
import
(
from
open
fold.utils.import_weights
import
(
import_jax_weights_
,
import_jax_weights_
,
)
)
from
alpha
fold.utils.tensor_utils
import
(
from
open
fold.utils.tensor_utils
import
(
tree_map
,
tree_map
,
tensor_tree_map
,
tensor_tree_map
,
)
)
...
@@ -40,7 +40,7 @@ from alphafold.utils.tensor_utils import (
...
@@ -40,7 +40,7 @@ from alphafold.utils.tensor_utils import (
MODEL_NAME
=
"model_1"
MODEL_NAME
=
"model_1"
MODEL_DEVICE
=
"cuda:1"
MODEL_DEVICE
=
"cuda:1"
PARAM_PATH
=
"
alpha
fold/resources/params/params_model_1.npz"
PARAM_PATH
=
"
open
fold/resources/params/params_model_1.npz"
FEAT_PATH
=
"tests/test_data/sample_feats.pickle"
FEAT_PATH
=
"tests/test_data/sample_feats.pickle"
...
...
scripts/install_third_party_dependencies.sh
View file @
75c79b79
...
@@ -23,11 +23,11 @@ pushd lib/conda/lib/python3.9/site-packages/ \
...
@@ -23,11 +23,11 @@ pushd lib/conda/lib/python3.9/site-packages/ \
&&
popd
&&
popd
# Download folding resources
# Download folding resources
wget
-q
-P
alpha
fold/resources
\
wget
-q
-P
open
fold/resources
\
https://git.scicore.unibas.ch/schwede/openstructure/-/raw/7102c63615b64735c4941278d92b554ec94415f8/modules/mol/alg/src/stereo_chemical_props.txt
https://git.scicore.unibas.ch/schwede/openstructure/-/raw/7102c63615b64735c4941278d92b554ec94415f8/modules/mol/alg/src/stereo_chemical_props.txt
# Download pretrained
Alpha
fold weights
# Download pretrained
open
fold weights
scripts/download_alphafold_params.sh
alpha
fold/resources
scripts/download_alphafold_params.sh
open
fold/resources
# Decompress test data
# Decompress test data
gunzip
tests/test_data/sample_feats.pickle.gz
gunzip
tests/test_data/sample_feats.pickle.gz
Prev
1
2
Next
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