Commit 1e216f93 authored by Tom Ward's avatar Tom Ward Committed by Copybara-Service
Browse files

Fix import ordering.

PiperOrigin-RevId: 387085679
Change-Id: I73287fcd0a29e899543b64c596e306195a2f435e
parent c9e6fedb
...@@ -15,9 +15,8 @@ ...@@ -15,9 +15,8 @@
"""Tests for prng.""" """Tests for prng."""
from absl.testing import absltest from absl.testing import absltest
import jax
from alphafold.model import prng from alphafold.model import prng
import jax
class PrngTest(absltest.TestCase): class PrngTest(absltest.TestCase):
......
...@@ -16,10 +16,10 @@ ...@@ -16,10 +16,10 @@
from absl import logging from absl import logging
from absl.testing import absltest from absl.testing import absltest
from alphafold.model import quat_affine
import jax import jax
import jax.numpy as jnp import jax.numpy as jnp
import numpy as np import numpy as np
from alphafold.model import quat_affine
VERBOSE = False VERBOSE = False
np.set_printoptions(precision=3, suppress=True) np.set_printoptions(precision=3, suppress=True)
......
...@@ -33,12 +33,10 @@ unintended use of these cores on both GPUs and TPUs. ...@@ -33,12 +33,10 @@ unintended use of these cores on both GPUs and TPUs.
import collections import collections
from typing import List from typing import List
from alphafold.model import quat_affine
import jax.numpy as jnp import jax.numpy as jnp
import tree import tree
from alphafold.model import quat_affine
# Array of 3-component vectors, stored as individual array for # Array of 3-component vectors, stored as individual array for
# each component. # each component.
Vecs = collections.namedtuple('Vecs', ['x', 'y', 'z']) Vecs = collections.namedtuple('Vecs', ['x', 'y', 'z'])
......
...@@ -13,13 +13,13 @@ ...@@ -13,13 +13,13 @@
# limitations under the License. # limitations under the License.
"""Data for AlphaFold.""" """Data for AlphaFold."""
import numpy as np
import tensorflow.compat.v1 as tf
from alphafold.common import residue_constants from alphafold.common import residue_constants
from alphafold.model.tf import shape_helpers from alphafold.model.tf import shape_helpers
from alphafold.model.tf import shape_placeholders from alphafold.model.tf import shape_placeholders
from alphafold.model.tf import utils from alphafold.model.tf import utils
import numpy as np
import tensorflow.compat.v1 as tf
# Pylint gets confused by the curry1 decorator because it changes the number # Pylint gets confused by the curry1 decorator because it changes the number
# of arguments to the function. # of arguments to the function.
...@@ -623,4 +623,3 @@ def make_atom14_masks(protein): ...@@ -623,4 +623,3 @@ def make_atom14_masks(protein):
protein['atom37_atom_exists'] = residx_atom37_mask protein['atom37_atom_exists'] = residx_atom37_mask
return protein return protein
...@@ -13,11 +13,11 @@ ...@@ -13,11 +13,11 @@
# limitations under the License. # limitations under the License.
"""Feature pre-processing input pipeline for AlphaFold.""" """Feature pre-processing input pipeline for AlphaFold."""
import tensorflow.compat.v1 as tf
import tree
from alphafold.model.tf import data_transforms from alphafold.model.tf import data_transforms
from alphafold.model.tf import shape_placeholders from alphafold.model.tf import shape_placeholders
import tensorflow.compat.v1 as tf
import tree
# Pylint gets confused by the curry1 decorator because it changes the number # Pylint gets confused by the curry1 decorator because it changes the number
# of arguments to the function. # of arguments to the function.
......
...@@ -15,10 +15,8 @@ ...@@ -15,10 +15,8 @@
"""Contains descriptions of various protein features.""" """Contains descriptions of various protein features."""
import enum import enum
from typing import Dict, Optional, Sequence, Tuple, Union from typing import Dict, Optional, Sequence, Tuple, Union
import tensorflow.compat.v1 as tf
from alphafold.common import residue_constants from alphafold.common import residue_constants
import tensorflow.compat.v1 as tf
# Type aliases. # Type aliases.
FeaturesMetadata = Dict[str, Tuple[tf.dtypes.DType, Sequence[Union[str, int]]]] FeaturesMetadata = Dict[str, Tuple[tf.dtypes.DType, Sequence[Union[str, int]]]]
...@@ -129,4 +127,3 @@ def shape(feature_name: str, ...@@ -129,4 +127,3 @@ def shape(feature_name: str,
raise ValueError("Could not parse %s (shape: %s) with values: %s" % ( raise ValueError("Could not parse %s (shape: %s) with values: %s" % (
feature_name, raw_sizes, replacements)) feature_name, raw_sizes, replacements))
return sizes return sizes
...@@ -17,9 +17,8 @@ import uuid ...@@ -17,9 +17,8 @@ import uuid
from absl.testing import absltest from absl.testing import absltest
from absl.testing import parameterized from absl.testing import parameterized
import tensorflow.compat.v1 as tf
from alphafold.model.tf import protein_features from alphafold.model.tf import protein_features
import tensorflow.compat.v1 as tf
def _random_bytes(): def _random_bytes():
......
...@@ -14,12 +14,10 @@ ...@@ -14,12 +14,10 @@
"""Datasets consisting of proteins.""" """Datasets consisting of proteins."""
from typing import Dict, Mapping, Optional, Sequence from typing import Dict, Mapping, Optional, Sequence
from alphafold.model.tf import protein_features
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 protein_features
TensorDict = Dict[str, tf.Tensor] TensorDict = Dict[str, tf.Tensor]
......
...@@ -14,11 +14,10 @@ ...@@ -14,11 +14,10 @@
"""Tests for shape_helpers.""" """Tests for shape_helpers."""
from alphafold.model.tf import shape_helpers
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 shape_helpers
class ShapeTest(tf.test.TestCase): class ShapeTest(tf.test.TestCase):
......
...@@ -19,6 +19,11 @@ import time ...@@ -19,6 +19,11 @@ import time
from typing import Collection, Optional, Sequence from typing import Collection, Optional, Sequence
from absl import logging from absl import logging
from alphafold.common import protein
from alphafold.common import residue_constants
from alphafold.model import folding
from alphafold.relax import cleanup
from alphafold.relax import utils
import ml_collections import ml_collections
import numpy as np import numpy as np
from simtk import openmm from simtk import openmm
...@@ -26,12 +31,6 @@ from simtk import unit ...@@ -26,12 +31,6 @@ from simtk import unit
from simtk.openmm import app as openmm_app from simtk.openmm import app as openmm_app
from simtk.openmm.app.internal.pdbstructure import PdbStructure from simtk.openmm.app.internal.pdbstructure import PdbStructure
from alphafold.common import protein
from alphafold.common import residue_constants
from alphafold.model import folding
from alphafold.relax import cleanup
from alphafold.relax import utils
ENERGY = unit.kilocalories_per_mole ENERGY = unit.kilocalories_per_mole
LENGTH = unit.angstroms LENGTH = unit.angstroms
......
...@@ -16,10 +16,9 @@ ...@@ -16,10 +16,9 @@
import os import os
from absl.testing import absltest from absl.testing import absltest
import numpy as np
from alphafold.common import protein from alphafold.common import protein
from alphafold.relax import amber_minimize from alphafold.relax import amber_minimize
import numpy as np
# Internal import (7716). # Internal import (7716).
......
...@@ -16,9 +16,8 @@ ...@@ -16,9 +16,8 @@
import io import io
from absl.testing import absltest from absl.testing import absltest
from simtk.openmm.app.internal import pdbstructure
from alphafold.relax import cleanup from alphafold.relax import cleanup
from simtk.openmm.app.internal import pdbstructure
def _pdb_to_structure(pdb_str): def _pdb_to_structure(pdb_str):
......
...@@ -14,12 +14,10 @@ ...@@ -14,12 +14,10 @@
"""Amber relaxation.""" """Amber relaxation."""
from typing import Any, Dict, Sequence, Tuple from typing import Any, Dict, Sequence, Tuple
import numpy as np
from alphafold.common import protein from alphafold.common import protein
from alphafold.relax import amber_minimize from alphafold.relax import amber_minimize
from alphafold.relax import utils from alphafold.relax import utils
import numpy as np
class AmberRelaxation(object): class AmberRelaxation(object):
...@@ -80,4 +78,3 @@ class AmberRelaxation(object): ...@@ -80,4 +78,3 @@ class AmberRelaxation(object):
violations = out['structural_violations'][ violations = out['structural_violations'][
'total_per_residue_violations_mask'] 'total_per_residue_violations_mask']
return min_pdb, debug_data, violations return min_pdb, debug_data, violations
...@@ -16,9 +16,9 @@ ...@@ -16,9 +16,9 @@
import os import os
from absl.testing import absltest from absl.testing import absltest
import numpy as np
from alphafold.common import protein from alphafold.common import protein
from alphafold.relax import relax from alphafold.relax import relax
import numpy as np
# Internal import (7716). # Internal import (7716).
......
...@@ -14,14 +14,12 @@ ...@@ -14,14 +14,12 @@
"""Utils for minimization.""" """Utils for minimization."""
import io import io
from alphafold.common 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
from simtk.openmm.app.internal.pdbstructure import PdbStructure from simtk.openmm.app.internal.pdbstructure import PdbStructure
from alphafold.common import residue_constants
def overwrite_pdb_coordinates(pdb_str: str, pos) -> str: def overwrite_pdb_coordinates(pdb_str: str, pos) -> str:
pdb_file = io.StringIO(pdb_str) pdb_file = io.StringIO(pdb_str)
...@@ -80,4 +78,3 @@ def assert_equal_nonterminal_atom_types( ...@@ -80,4 +78,3 @@ def assert_equal_nonterminal_atom_types(
no_oxt_mask[..., oxt] = False no_oxt_mask[..., oxt] = False
np.testing.assert_almost_equal(ref_atom_mask[no_oxt_mask], np.testing.assert_almost_equal(ref_atom_mask[no_oxt_mask],
atom_mask[no_oxt_mask]) atom_mask[no_oxt_mask])
...@@ -17,10 +17,9 @@ ...@@ -17,10 +17,9 @@
import os import os
from absl.testing import absltest from absl.testing import absltest
import numpy as np
from alphafold.common import protein from alphafold.common import protein
from alphafold.relax import utils from alphafold.relax import utils
import numpy as np
# Internal import (7716). # Internal import (7716).
......
...@@ -25,8 +25,6 @@ from typing import Dict ...@@ -25,8 +25,6 @@ from typing import Dict
from absl import app from absl import app
from absl import flags from absl import flags
from absl import logging from absl import logging
import numpy as np
from alphafold.common import protein from alphafold.common import protein
from alphafold.data import pipeline from alphafold.data import pipeline
from alphafold.data import templates from alphafold.data import templates
...@@ -34,6 +32,7 @@ from alphafold.model import data ...@@ -34,6 +32,7 @@ from alphafold.model import data
from alphafold.model import config from alphafold.model import config
from alphafold.model import model from alphafold.model import model
from alphafold.relax import relax from alphafold.relax import relax
import numpy as np
# Internal import (7716). # Internal import (7716).
flags.DEFINE_list('fasta_paths', None, 'Paths to FASTA files, each containing ' flags.DEFINE_list('fasta_paths', None, 'Paths to FASTA files, each containing '
......
...@@ -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 run_alphafold
import mock import mock
import numpy as np import numpy as np
import run_alphafold
# Internal import (7716). # Internal import (7716).
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment