diff --git a/Dockerfile b/Dockerfile index fd842c7a..e45ce70e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ FROM nvidia/cuda:11.3.1-cudnn8-runtime-ubuntu18.04 +# ADDED THIS LINE TO PROVOKE A NEW DOCKER BUILD TO TEST THAT IS STILL WORKS # metainformation LABEL org.opencontainers.image.version = "1.0.0" LABEL org.opencontainers.image.authors = "Gustaf Ahdritz" @@ -31,6 +32,6 @@ COPY setup.py /opt/openfold/setup.py COPY lib/openmm.patch /opt/openfold/lib/openmm.patch RUN wget -q -P /opt/openfold/openfold/resources \ https://git.scicore.unibas.ch/schwede/openstructure/-/raw/7102c63615b64735c4941278d92b554ec94415f8/modules/mol/alg/src/stereo_chemical_props.txt -RUN patch -p0 -d /opt/conda/lib/python3.7/site-packages/ < /opt/openfold/lib/openmm.patch +RUN patch -p0 -d /opt/conda/lib/python3.9/site-packages/ < /opt/openfold/lib/openmm.patch WORKDIR /opt/openfold RUN python3 setup.py install diff --git a/environment.yml b/environment.yml index b8a20825..8f926555 100644 --- a/environment.yml +++ b/environment.yml @@ -4,7 +4,7 @@ channels: - bioconda - pytorch dependencies: - - conda-forge::python=3.7 + - conda-forge::python=3.9 - conda-forge::setuptools=59.5.0 - conda-forge::pip - conda-forge::openmm=7.5.1 diff --git a/notebooks/OpenFold.ipynb b/notebooks/OpenFold.ipynb index 8f00178a..beec7568 100755 --- a/notebooks/OpenFold.ipynb +++ b/notebooks/OpenFold.ipynb @@ -97,6 +97,7 @@ "#@markdown **Note**: This installs the software on the Colab \n", "#@markdown notebook in the cloud and not on your computer.\n", "\n", + "import sys\n", "from IPython.utils import io\n", "import os\n", "import subprocess\n", @@ -104,6 +105,8 @@ "\n", "TQDM_BAR_FORMAT = '{l_bar}{bar}| {n_fmt}/{total_fmt} [elapsed: {elapsed} remaining: {remaining}]'\n", "\n", + "python_version = '.'.join(sys.version.split('.')[:2]) # get string like \"3.9\"\n", + "\n", "try:\n", " with io.capture_output() as captured:\n", " %shell sudo apt install --quiet --yes hmmer\n", @@ -125,12 +128,13 @@ " %shell conda install -y -q -c conda-forge -c bioconda \\\n", " kalign2=2.04 \\\n", " hhsuite=3.3.0 \\\n", - " python=3.8 \\\n", + " python={python_version} \\\n", " 2>&1 1>/dev/null\n", " %shell pip install -q \\\n", " ml-collections==0.1.0 \\\n", " PyYAML==5.4.1 \\\n", - " biopython==1.79\n", + " biopython==1.79 \\\n", + " modelcif==0.7\n", "\n", " # Create a ramdisk to store a database chunk to make Jackhmmer run fast.\n", " %shell sudo mkdir -m 777 --parents /tmp/ramdisk\n", @@ -183,7 +187,7 @@ "\n", " %shell conda install -y -q -c conda-forge openmm=7.5.1\n", " # Apply OpenMM patch.\n", - " %shell pushd /opt/conda/lib/python3.8/site-packages/ && \\\n", + " %shell pushd /opt/conda/lib/python{python_version}/site-packages/ && \\\n", " patch -p0 < /content/openfold/lib/openmm.patch && \\\n", " popd\n", " %shell conda install -y -q -c conda-forge pdbfixer=1.7\n", @@ -220,8 +224,8 @@ "import unittest.mock\n", "import sys\n", "\n", - "sys.path.insert(0, '/usr/local/lib/python3.8/site-packages/')\n", - "sys.path.append('/opt/conda/lib/python3.8/site-packages')\n", + "sys.path.insert(0, f'/usr/local/lib/python{python_version}/site-packages/')\n", + "sys.path.append(f'/opt/conda/lib/python{python_version}/site-packages')\n", "\n", "# Allows us to skip installing these packages\n", "unnecessary_modules = [\n", diff --git a/openfold/np/relax/relax.py b/openfold/np/relax/relax.py index 2711c760..65516ffd 100644 --- a/openfold/np/relax/relax.py +++ b/openfold/np/relax/relax.py @@ -57,7 +57,7 @@ def __init__( self._use_gpu = use_gpu def process( - self, *, prot: protein.Protein, cif_output: bool + self, *, prot: protein.Protein, cif_output: bool = False ) -> Tuple[str, Dict[str, Any], np.ndarray]: """Runs Amber relax on a prediction, adds hydrogens, returns PDB string.""" out = amber_minimize.run_pipeline( diff --git a/openfold/utils/script_utils.py b/openfold/utils/script_utils.py index eaa054e7..ea459803 100644 --- a/openfold/utils/script_utils.py +++ b/openfold/utils/script_utils.py @@ -228,7 +228,7 @@ def prep_output(out, batch, feature_dict, feature_processor, config_preset, mult return unrelaxed_protein -def relax_protein(config, model_device, unrelaxed_protein, output_directory, output_name, cif_output): +def relax_protein(config, model_device, unrelaxed_protein, output_directory, output_name, cif_output=False): amber_relaxer = relax.AmberRelaxation( use_gpu=(model_device != "cpu"), **config.relax, @@ -257,4 +257,4 @@ def relax_protein(config, model_device, unrelaxed_protein, output_directory, out with open(relaxed_output_path, 'w') as fp: fp.write(struct_str) - logger.info(f"Relaxed output written to {relaxed_output_path}...") \ No newline at end of file + logger.info(f"Relaxed output written to {relaxed_output_path}...") diff --git a/scripts/install_third_party_dependencies.sh b/scripts/install_third_party_dependencies.sh index 2e3deb05..9535ce0b 100755 --- a/scripts/install_third_party_dependencies.sh +++ b/scripts/install_third_party_dependencies.sh @@ -27,7 +27,7 @@ cd $CUR_DIR # Install DeepMind's OpenMM patch OPENFOLD_DIR=$PWD -pushd lib/conda/envs/$ENV_NAME/lib/python3.7/site-packages/ \ +pushd lib/conda/envs/$ENV_NAME/lib/python3.9/site-packages/ \ && patch -p0 < $OPENFOLD_DIR/lib/openmm.patch \ && popd diff --git a/setup.py b/setup.py index 57e6f265..0ef74ef4 100644 --- a/setup.py +++ b/setup.py @@ -128,7 +128,7 @@ def get_cuda_bare_metal_version(cuda_dir): classifiers=[ 'License :: OSI Approved :: Apache Software License', 'Operating System :: POSIX :: Linux', - 'Programming Language :: Python :: 3.7,' + 'Programming Language :: Python :: 3.9,' 'Topic :: Scientific/Engineering :: Artificial Intelligence', ], )