|
46 | 46 | "source": [ |
47 | 47 | "<img src=\"https://raw.githubusercontent.com/sokrypton/ColabFold/main/.github/ColabFold_Marv_Logo_Small.png\" height=\"200\" align=\"right\" style=\"height:240px\">\n", |
48 | 48 | "\n", |
49 | | - "# ColabFold - v1.6.0-beta\n", |
50 | | - "**<font color=\"red\">WARNING</font> this \"beta\" notebook is in active development and may be break without warning.** Use the [\"main\"](https://colab.research.google.com/github/sokrypton/ColabFold/blob/main/AlphaFold2.ipynb) notebook for most stable version.\n", |
| 49 | + "# ColabFold - v1.6.0 - beta\n", |
| 50 | + "**<font color=\"red\">WARNING</font> this \"beta\" notebook is in active development and may be break without warning.** \n", |
| 51 | + "Use the [\"main\"](https://colab.research.google.com/github/sokrypton/ColabFold/blob/main/AlphaFold2.ipynb) notebook for most stable version.\n", |
51 | 52 | "\n", |
52 | 53 | "---\n", |
53 | 54 | "\n", |
54 | 55 | "Easy to use protein structure and complex prediction using [AlphaFold2](https://www.nature.com/articles/s41586-021-03819-2) and [Alphafold2-multimer](https://www.biorxiv.org/content/10.1101/2021.10.04.463034v1). Sequence alignments/templates are generated through [MMseqs2](mmseqs.com) and [HHsearch](https://github.com/soedinglab/hh-suite). For more details, see <a href=\"#Instructions\">bottom</a> of the notebook, checkout the [ColabFold GitHub](https://github.com/sokrypton/ColabFold) and read our manuscript. \n", |
55 | | - "Old version: [v1.4](https://colab.research.google.com/github/sokrypton/ColabFold/blob/v1.4.0/AlphaFold2.ipynb)\n", |
| 56 | + "Old versions: [v1.4](https://colab.research.google.com/github/sokrypton/ColabFold/blob/v1.4.0/AlphaFold2.ipynb), [v1.5](https://colab.research.google.com/github/sokrypton/ColabFold/blob/main/AlphaFold2.ipynb)\n", |
56 | 57 | "\n", |
57 | 58 | "[Mirdita M, Schütze K, Moriwaki Y, Heo L, Ovchinnikov S, Steinegger M. ColabFold: Making protein folding accessible to all.\n", |
58 | 59 | "*Nature Methods*, 2022](https://www.nature.com/articles/s41592-022-01488-1) \n", |
|
226 | 227 | " # install dependencies\n", |
227 | 228 | " # We have to use \"--no-warn-conflicts\" because colab already has a lot preinstalled with requirements different to ours\n", |
228 | 229 | " pip install -q --no-warn-conflicts \"colabfold[alphafold-minus-jax] @ git+https://github.com/sokrypton/ColabFold@beta\"\n", |
229 | | - " # high risk high gain\n", |
230 | | - " pip install -q \"jax[cuda11_cudnn805]>=0.3.8,<0.4\" -f https://storage.googleapis.com/jax-releases/jax_releases.html\n", |
231 | 230 | "\n", |
232 | 231 | " # for debugging\n", |
233 | 232 | " ln -s /usr/local/lib/python3.*/dist-packages/colabfold colabfold\n", |
|
266 | 265 | "source": [ |
267 | 266 | "#@title Run Prediction\n", |
268 | 267 | "#@markdown ### Advanced settings\n", |
269 | | - "model_type = \"auto\" #@param [\"auto\", \"alphafold2_ptm\", \"alphafold2_multimer_v1\", \"alphafold2_multimer_v2\", \"alphafold2_multimer_v3\"]\n", |
| 268 | + "model_type = \"auto\" #@param [\"auto\", \"alphafold2\", \"alphafold2_ptm\", \"alphafold2_multimer_v1\", \"alphafold2_multimer_v2\", \"alphafold2_multimer_v3\"]\n", |
270 | 269 | "#@markdown - if `auto` will use `alphafold2_ptm` for monomer inputs and `alphafold2_multimer_v3` for multimer inputs.\n", |
271 | 270 | "num_recycles = \"auto\" #@param [\"auto\", \"0\", \"1\", \"3\", \"6\", \"12\", \"24\", \"48\"]\n", |
272 | 271 | "recycle_early_stop_tolerance = \"auto\" #@param [\"auto\", \"0.0\", \"0.5\", \"1.0\"]\n", |
|
296 | 295 | "from pathlib import Path\n", |
297 | 296 | "from colabfold.download import download_alphafold_params, default_data_dir\n", |
298 | 297 | "from colabfold.utils import setup_logging\n", |
299 | | - "from colabfold.run_alphafold import get_queries, run, set_model_type\n", |
| 298 | + "from colabfold.run_alphafold import run, set_model_type\n", |
300 | 299 | "from colabfold.inputs import get_queries\n", |
301 | 300 | "from colabfold.plot import plot_msa\n", |
302 | 301 | "\n", |
|
307 | 306 | "except:\n", |
308 | 307 | " K80_chk = \"0\"\n", |
309 | 308 | " pass\n", |
| 309 | + "\n", |
310 | 310 | "if \"1\" in K80_chk:\n", |
311 | 311 | " print(\"WARNING: found GPU Tesla K80: limited to total length < 1000\")\n", |
312 | | - " if \"TF_FORCE_UNIFIED_MEMORY\" in os.environ:\n", |
313 | | - " del os.environ[\"TF_FORCE_UNIFIED_MEMORY\"]\n", |
314 | | - " if \"XLA_PYTHON_CLIENT_MEM_FRACTION\" in os.environ:\n", |
315 | | - " del os.environ[\"XLA_PYTHON_CLIENT_MEM_FRACTION\"]\n", |
| 312 | + "else:\n", |
| 313 | + " os.environ[\"TF_FORCE_UNIFIED_MEMORY\"] = \"1\"\n", |
| 314 | + " os.environ[\"XLA_PYTHON_CLIENT_MEM_FRACTION\"] = \"4.0\"\n", |
316 | 315 | "\n", |
317 | 316 | "from colabfold.plot import plot_protein\n", |
318 | 317 | "from pathlib import Path\n", |
|
480 | 479 | " img = f.read()\n", |
481 | 480 | " return prefix + base64.b64encode(img).decode('utf-8')\n", |
482 | 481 | "\n", |
483 | | - "pae = image_to_data_url(os.path.join(jobname,f\"{jobname}{jobname_prefix}_pae.png\"))\n", |
| 482 | + "pae_png_path = os.path.join(jobname,f\"{jobname}{jobname_prefix}_pae.png\")\n", |
| 483 | + "pae = image_to_data_url(pae_png_path) if os.path.exists(pae_png_path) else None\n", |
484 | 484 | "cov = image_to_data_url(os.path.join(jobname,f\"{jobname}{jobname_prefix}_coverage.png\"))\n", |
485 | 485 | "plddt = image_to_data_url(os.path.join(jobname,f\"{jobname}{jobname_prefix}_plddt.png\"))\n", |
486 | | - "display(HTML(f\"\"\"\n", |
487 | | - "<style>\n", |
488 | | - " img {{\n", |
489 | | - " float:left;\n", |
490 | | - " }}\n", |
491 | | - " .full {{\n", |
492 | | - " max-width:100%;\n", |
493 | | - " }}\n", |
494 | | - " .half {{\n", |
495 | | - " max-width:50%;\n", |
496 | | - " }}\n", |
497 | | - " @media (max-width:640px) {{\n", |
498 | | - " .half {{\n", |
499 | | - " max-width:100%;\n", |
500 | | - " }}\n", |
501 | | - " }}\n", |
502 | | - "</style>\n", |
503 | | - "<div style=\"max-width:90%; padding:2em;\">\n", |
504 | | - " <h1>Plots for {escape(jobname)}</h1>\n", |
505 | | - " <img src=\"{pae}\" class=\"full\" />\n", |
506 | | - " <img src=\"{cov}\" class=\"half\" />\n", |
507 | | - " <img src=\"{plddt}\" class=\"half\" />\n", |
508 | | - "</div>\n", |
509 | | - "\"\"\"))\n" |
| 486 | + "\n", |
| 487 | + "if pae is None:\n", |
| 488 | + " display(HTML(f\"\"\"\n", |
| 489 | + " <style>\n", |
| 490 | + " img {{float:left;}}\n", |
| 491 | + " .full {{max-width:100%;}}\n", |
| 492 | + " .half {{max-width:50%;}}\n", |
| 493 | + " @media (max-width:640px) {{.half {{max-width:100%;}}}}\n", |
| 494 | + " </style>\n", |
| 495 | + " <div style=\"max-width:90%; padding:2em;\">\n", |
| 496 | + " <h1>Plots for {escape(jobname)}</h1>\n", |
| 497 | + " <img src=\"{cov}\" class=\"half\" />\n", |
| 498 | + " <img src=\"{plddt}\" class=\"half\" />\n", |
| 499 | + " </div>\n", |
| 500 | + " \"\"\"))\n", |
| 501 | + "else:\n", |
| 502 | + " display(HTML(f\"\"\"\n", |
| 503 | + " <style>\n", |
| 504 | + " img {{float:left;}}\n", |
| 505 | + " .full {{max-width:100%;}}\n", |
| 506 | + " .half {{max-width:50%;}}\n", |
| 507 | + " @media (max-width:640px) {{.half {{max-width:100%;}}}}\n", |
| 508 | + " </style>\n", |
| 509 | + " <div style=\"max-width:90%; padding:2em;\">\n", |
| 510 | + " <h1>Plots for {escape(jobname)}</h1>\n", |
| 511 | + " <img src=\"{pae}\" class=\"full\" />\n", |
| 512 | + " <img src=\"{cov}\" class=\"half\" />\n", |
| 513 | + " <img src=\"{plddt}\" class=\"half\" />\n", |
| 514 | + " </div>\n", |
| 515 | + " \"\"\"))" |
510 | 516 | ], |
511 | 517 | "execution_count": null, |
512 | 518 | "outputs": [] |
|
0 commit comments