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
1e216f93
Commit
1e216f93
authored
Jul 27, 2021
by
Tom Ward
Committed by
Copybara-Service
Jul 27, 2021
Browse files
Fix import ordering.
PiperOrigin-RevId: 387085679 Change-Id: I73287fcd0a29e899543b64c596e306195a2f435e
parent
c9e6fedb
Changes
38
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
38 additions
and
64 deletions
+38
-64
alphafold/common/protein.py
alphafold/common/protein.py
+2
-4
alphafold/common/protein_test.py
alphafold/common/protein_test.py
+1
-2
alphafold/common/residue_constants.py
alphafold/common/residue_constants.py
+1
-1
alphafold/common/residue_constants_test.py
alphafold/common/residue_constants_test.py
+1
-2
alphafold/data/mmcif_parsing.py
alphafold/data/mmcif_parsing.py
+1
-1
alphafold/data/parsers.py
alphafold/data/parsers.py
+2
-3
alphafold/data/pipeline.py
alphafold/data/pipeline.py
+3
-5
alphafold/data/templates.py
alphafold/data/templates.py
+4
-5
alphafold/data/tools/hmmbuild.py
alphafold/data/tools/hmmbuild.py
+1
-3
alphafold/data/tools/hmmsearch.py
alphafold/data/tools/hmmsearch.py
+1
-3
alphafold/model/all_atom.py
alphafold/model/all_atom.py
+3
-5
alphafold/model/all_atom_test.py
alphafold/model/all_atom_test.py
+1
-1
alphafold/model/config.py
alphafold/model/config.py
+1
-2
alphafold/model/data.py
alphafold/model/data.py
+1
-3
alphafold/model/features.py
alphafold/model/features.py
+2
-4
alphafold/model/folding.py
alphafold/model/folding.py
+5
-7
alphafold/model/layer_stack_test.py
alphafold/model/layer_stack_test.py
+1
-2
alphafold/model/lddt_test.py
alphafold/model/lddt_test.py
+1
-1
alphafold/model/model.py
alphafold/model/model.py
+3
-5
alphafold/model/modules.py
alphafold/model/modules.py
+3
-5
No files found.
alphafold/common/protein.py
View file @
1e216f93
...
@@ -13,15 +13,13 @@
...
@@ -13,15 +13,13 @@
# limitations under the License.
# limitations under the License.
"""Protein data type."""
"""Protein data type."""
import
dataclasses
import
io
import
io
from
typing
import
Any
,
Mapping
,
Optional
from
typing
import
Any
,
Mapping
,
Optional
from
alphafold.common
import
residue_constants
from
Bio.PDB
import
PDBParser
from
Bio.PDB
import
PDBParser
import
dataclasses
import
numpy
as
np
import
numpy
as
np
from
alphafold.common
import
residue_constants
FeatureDict
=
Mapping
[
str
,
np
.
ndarray
]
FeatureDict
=
Mapping
[
str
,
np
.
ndarray
]
ModelOutput
=
Mapping
[
str
,
Any
]
# Is a nested dict.
ModelOutput
=
Mapping
[
str
,
Any
]
# Is a nested dict.
...
...
alphafold/common/protein_test.py
View file @
1e216f93
...
@@ -18,10 +18,9 @@ import os
...
@@ -18,10 +18,9 @@ import os
from
absl.testing
import
absltest
from
absl.testing
import
absltest
from
absl.testing
import
parameterized
from
absl.testing
import
parameterized
import
numpy
as
np
from
alphafold.common
import
protein
from
alphafold.common
import
protein
from
alphafold.common
import
residue_constants
from
alphafold.common
import
residue_constants
import
numpy
as
np
# Internal import (7716).
# Internal import (7716).
TEST_DATA_DIR
=
'alphafold/common/testdata/'
TEST_DATA_DIR
=
'alphafold/common/testdata/'
...
...
alphafold/common/residue_constants.py
View file @
1e216f93
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
import
collections
import
collections
import
functools
import
functools
from
typing
import
Mapping
,
List
,
Tuple
from
typing
import
List
,
Mapping
,
Tuple
import
numpy
as
np
import
numpy
as
np
import
tree
import
tree
...
...
alphafold/common/residue_constants_test.py
View file @
1e216f93
...
@@ -16,9 +16,8 @@
...
@@ -16,9 +16,8 @@
from
absl.testing
import
absltest
from
absl.testing
import
absltest
from
absl.testing
import
parameterized
from
absl.testing
import
parameterized
import
numpy
as
np
from
alphafold.common
import
residue_constants
from
alphafold.common
import
residue_constants
import
numpy
as
np
class
ResidueConstantsTest
(
parameterized
.
TestCase
):
class
ResidueConstantsTest
(
parameterized
.
TestCase
):
...
...
alphafold/data/mmcif_parsing.py
View file @
1e216f93
...
@@ -14,13 +14,13 @@
...
@@ -14,13 +14,13 @@
"""Parses the mmCIF file format."""
"""Parses the mmCIF file format."""
import
collections
import
collections
import
dataclasses
import
io
import
io
from
typing
import
Any
,
Mapping
,
Optional
,
Sequence
,
Tuple
from
typing
import
Any
,
Mapping
,
Optional
,
Sequence
,
Tuple
from
absl
import
logging
from
absl
import
logging
from
Bio
import
PDB
from
Bio
import
PDB
from
Bio.Data
import
SCOPData
from
Bio.Data
import
SCOPData
import
dataclasses
# Type aliases:
# Type aliases:
ChainId
=
str
ChainId
=
str
...
...
alphafold/data/parsers.py
View file @
1e216f93
...
@@ -14,11 +14,10 @@
...
@@ -14,11 +14,10 @@
"""Functions for parsing various file formats."""
"""Functions for parsing various file formats."""
import
collections
import
collections
import
dataclasses
import
re
import
re
import
string
import
string
from
typing
import
Iterable
,
List
,
Optional
,
Sequence
,
Tuple
,
Dict
from
typing
import
Dict
,
Iterable
,
List
,
Optional
,
Sequence
,
Tuple
import
dataclasses
DeletionMatrix
=
Sequence
[
Sequence
[
int
]]
DeletionMatrix
=
Sequence
[
Sequence
[
int
]]
...
...
alphafold/data/pipeline.py
View file @
1e216f93
...
@@ -16,17 +16,15 @@
...
@@ -16,17 +16,15 @@
import
os
import
os
from
typing
import
Mapping
,
Optional
,
Sequence
from
typing
import
Mapping
,
Optional
,
Sequence
import
numpy
as
np
# Internal import (7716).
from
alphafold.common
import
residue_constants
from
alphafold.common
import
residue_constants
from
alphafold.data
import
parsers
from
alphafold.data
import
parsers
from
alphafold.data
import
templates
from
alphafold.data
import
templates
from
alphafold.data.tools
import
hhblits
from
alphafold.data.tools
import
hhblits
from
alphafold.data.tools
import
hhsearch
from
alphafold.data.tools
import
hhsearch
from
alphafold.data.tools
import
jackhmmer
from
alphafold.data.tools
import
jackhmmer
import
numpy
as
np
# Internal import (7716).
FeatureDict
=
Mapping
[
str
,
np
.
ndarray
]
FeatureDict
=
Mapping
[
str
,
np
.
ndarray
]
...
...
alphafold/data/templates.py
View file @
1e216f93
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
# limitations under the License.
# limitations under the License.
"""Functions for getting templates and calculating template features."""
"""Functions for getting templates and calculating template features."""
import
dataclasses
import
datetime
import
datetime
import
glob
import
glob
import
os
import
os
...
@@ -20,15 +21,13 @@ import re
...
@@ -20,15 +21,13 @@ import re
from
typing
import
Any
,
Dict
,
Mapping
,
Optional
,
Sequence
,
Tuple
from
typing
import
Any
,
Dict
,
Mapping
,
Optional
,
Sequence
,
Tuple
from
absl
import
logging
from
absl
import
logging
import
dataclasses
import
numpy
as
np
# Internal import (7716).
from
alphafold.common
import
residue_constants
from
alphafold.common
import
residue_constants
from
alphafold.data
import
mmcif_parsing
from
alphafold.data
import
mmcif_parsing
from
alphafold.data
import
parsers
from
alphafold.data
import
parsers
from
alphafold.data.tools
import
kalign
from
alphafold.data.tools
import
kalign
import
numpy
as
np
# Internal import (7716).
class
Error
(
Exception
):
class
Error
(
Exception
):
...
...
alphafold/data/tools/hmmbuild.py
View file @
1e216f93
...
@@ -19,10 +19,8 @@ import re
...
@@ -19,10 +19,8 @@ import re
import
subprocess
import
subprocess
from
absl
import
logging
from
absl
import
logging
# Internal import (7716).
from
alphafold.data.tools
import
utils
from
alphafold.data.tools
import
utils
# Internal import (7716).
class
Hmmbuild
(
object
):
class
Hmmbuild
(
object
):
...
...
alphafold/data/tools/hmmsearch.py
View file @
1e216f93
...
@@ -19,10 +19,8 @@ import subprocess
...
@@ -19,10 +19,8 @@ import subprocess
from
typing
import
Optional
,
Sequence
from
typing
import
Optional
,
Sequence
from
absl
import
logging
from
absl
import
logging
# Internal import (7716).
from
alphafold.data.tools
import
utils
from
alphafold.data.tools
import
utils
# Internal import (7716).
class
Hmmsearch
(
object
):
class
Hmmsearch
(
object
):
...
...
alphafold/model/all_atom.py
View file @
1e216f93
...
@@ -34,15 +34,13 @@ the network to facilitate easier conversion to existing protein datastructures.
...
@@ -34,15 +34,13 @@ the network to facilitate easier conversion to existing protein datastructures.
"""
"""
from
typing
import
Dict
,
Optional
from
typing
import
Dict
,
Optional
import
jax
import
jax.numpy
as
jnp
import
numpy
as
np
from
alphafold.common
import
residue_constants
from
alphafold.common
import
residue_constants
from
alphafold.model
import
r3
from
alphafold.model
import
r3
from
alphafold.model
import
utils
from
alphafold.model
import
utils
import
jax
import
jax.numpy
as
jnp
import
numpy
as
np
def
squared_difference
(
x
,
y
):
def
squared_difference
(
x
,
y
):
...
...
alphafold/model/all_atom_test.py
View file @
1e216f93
...
@@ -16,9 +16,9 @@
...
@@ -16,9 +16,9 @@
from
absl.testing
import
absltest
from
absl.testing
import
absltest
from
absl.testing
import
parameterized
from
absl.testing
import
parameterized
import
numpy
as
np
from
alphafold.model
import
all_atom
from
alphafold.model
import
all_atom
from
alphafold.model
import
r3
from
alphafold.model
import
r3
import
numpy
as
np
L1_CLAMP_DISTANCE
=
10
L1_CLAMP_DISTANCE
=
10
...
...
alphafold/model/config.py
View file @
1e216f93
...
@@ -14,9 +14,8 @@
...
@@ -14,9 +14,8 @@
"""Model config."""
"""Model config."""
import
copy
import
copy
import
ml_collections
from
alphafold.model.tf
import
shape_placeholders
from
alphafold.model.tf
import
shape_placeholders
import
ml_collections
NUM_RES
=
shape_placeholders
.
NUM_RES
NUM_RES
=
shape_placeholders
.
NUM_RES
...
...
alphafold/model/data.py
View file @
1e216f93
...
@@ -17,11 +17,9 @@
...
@@ -17,11 +17,9 @@
import
io
import
io
import
os
import
os
from
typing
import
List
from
typing
import
List
from
alphafold.model
import
utils
import
haiku
as
hk
import
haiku
as
hk
import
numpy
as
np
import
numpy
as
np
from
alphafold.model
import
utils
# Internal import (7716).
# Internal import (7716).
...
...
alphafold/model/features.py
View file @
1e216f93
...
@@ -15,14 +15,12 @@
...
@@ -15,14 +15,12 @@
"""Code to generate processed features."""
"""Code to generate processed features."""
import
copy
import
copy
from
typing
import
List
,
Mapping
,
Tuple
from
typing
import
List
,
Mapping
,
Tuple
from
alphafold.model.tf
import
input_pipeline
from
alphafold.model.tf
import
proteins_dataset
import
ml_collections
import
ml_collections
import
numpy
as
np
import
numpy
as
np
import
tensorflow.compat.v1
as
tf
import
tensorflow.compat.v1
as
tf
from
alphafold.model.tf
import
input_pipeline
from
alphafold.model.tf
import
proteins_dataset
FeatureDict
=
Mapping
[
str
,
np
.
ndarray
]
FeatureDict
=
Mapping
[
str
,
np
.
ndarray
]
...
...
alphafold/model/folding.py
View file @
1e216f93
...
@@ -16,13 +16,6 @@
...
@@ -16,13 +16,6 @@
import
functools
import
functools
from
typing
import
Dict
from
typing
import
Dict
import
haiku
as
hk
import
jax
import
jax.numpy
as
jnp
import
ml_collections
import
numpy
as
np
from
alphafold.common
import
residue_constants
from
alphafold.common
import
residue_constants
from
alphafold.model
import
all_atom
from
alphafold.model
import
all_atom
from
alphafold.model
import
common_modules
from
alphafold.model
import
common_modules
...
@@ -30,6 +23,11 @@ from alphafold.model import prng
...
@@ -30,6 +23,11 @@ from alphafold.model import prng
from
alphafold.model
import
quat_affine
from
alphafold.model
import
quat_affine
from
alphafold.model
import
r3
from
alphafold.model
import
r3
from
alphafold.model
import
utils
from
alphafold.model
import
utils
import
haiku
as
hk
import
jax
import
jax.numpy
as
jnp
import
ml_collections
import
numpy
as
np
def
squared_difference
(
x
,
y
):
def
squared_difference
(
x
,
y
):
...
...
alphafold/model/layer_stack_test.py
View file @
1e216f93
...
@@ -17,14 +17,13 @@
...
@@ -17,14 +17,13 @@
import
functools
import
functools
from
absl.testing
import
absltest
from
absl.testing
import
absltest
from
absl.testing
import
parameterized
from
absl.testing
import
parameterized
from
alphafold.model
import
layer_stack
import
haiku
as
hk
import
haiku
as
hk
import
jax
import
jax
import
jax.numpy
as
jnp
import
jax.numpy
as
jnp
import
numpy
as
np
import
numpy
as
np
import
scipy
import
scipy
from
alphafold.model
import
layer_stack
# Suffixes applied by Haiku for repeated module names.
# Suffixes applied by Haiku for repeated module names.
suffixes
=
[
''
]
+
[
f
'_
{
i
}
'
for
i
in
range
(
1
,
100
)]
suffixes
=
[
''
]
+
[
f
'_
{
i
}
'
for
i
in
range
(
1
,
100
)]
...
...
alphafold/model/lddt_test.py
View file @
1e216f93
...
@@ -16,8 +16,8 @@
...
@@ -16,8 +16,8 @@
from
absl.testing
import
absltest
from
absl.testing
import
absltest
from
absl.testing
import
parameterized
from
absl.testing
import
parameterized
import
numpy
as
np
from
alphafold.model
import
lddt
from
alphafold.model
import
lddt
import
numpy
as
np
class
LddtTest
(
parameterized
.
TestCase
,
absltest
.
TestCase
):
class
LddtTest
(
parameterized
.
TestCase
,
absltest
.
TestCase
):
...
...
alphafold/model/model.py
View file @
1e216f93
...
@@ -16,6 +16,9 @@
...
@@ -16,6 +16,9 @@
from
typing
import
Any
,
Mapping
,
Optional
,
Union
from
typing
import
Any
,
Mapping
,
Optional
,
Union
from
absl
import
logging
from
absl
import
logging
from
alphafold.common
import
confidence
from
alphafold.model
import
features
from
alphafold.model
import
modules
import
haiku
as
hk
import
haiku
as
hk
import
jax
import
jax
import
ml_collections
import
ml_collections
...
@@ -23,10 +26,6 @@ import numpy as np
...
@@ -23,10 +26,6 @@ import numpy as np
import
tensorflow.compat.v1
as
tf
import
tensorflow.compat.v1
as
tf
import
tree
import
tree
from
alphafold.common
import
confidence
from
alphafold.model
import
features
from
alphafold.model
import
modules
def
get_confidence_metrics
(
def
get_confidence_metrics
(
prediction_result
:
Mapping
[
str
,
Any
])
->
Mapping
[
str
,
Any
]:
prediction_result
:
Mapping
[
str
,
Any
])
->
Mapping
[
str
,
Any
]:
...
@@ -140,4 +139,3 @@ class RunModel:
...
@@ -140,4 +139,3 @@ class RunModel:
logging
.
info
(
'Output shape was %s'
,
logging
.
info
(
'Output shape was %s'
,
tree
.
map_structure
(
lambda
x
:
x
.
shape
,
result
))
tree
.
map_structure
(
lambda
x
:
x
.
shape
,
result
))
return
result
return
result
alphafold/model/modules.py
View file @
1e216f93
...
@@ -17,11 +17,6 @@
...
@@ -17,11 +17,6 @@
The structure generation code is in 'folding.py'.
The structure generation code is in 'folding.py'.
"""
"""
import
functools
import
functools
import
haiku
as
hk
import
jax
import
jax.numpy
as
jnp
from
alphafold.common
import
residue_constants
from
alphafold.common
import
residue_constants
from
alphafold.model
import
all_atom
from
alphafold.model
import
all_atom
from
alphafold.model
import
common_modules
from
alphafold.model
import
common_modules
...
@@ -32,6 +27,9 @@ from alphafold.model import mapping
...
@@ -32,6 +27,9 @@ from alphafold.model import mapping
from
alphafold.model
import
prng
from
alphafold.model
import
prng
from
alphafold.model
import
quat_affine
from
alphafold.model
import
quat_affine
from
alphafold.model
import
utils
from
alphafold.model
import
utils
import
haiku
as
hk
import
jax
import
jax.numpy
as
jnp
def
softmax_cross_entropy
(
logits
,
labels
):
def
softmax_cross_entropy
(
logits
,
labels
):
...
...
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