|
6 | 6 | "colab": { |
7 | 7 | "name": "AlphaFold2.ipynb", |
8 | 8 | "provenance": [], |
| 9 | + "gpuType": "T4", |
9 | 10 | "include_colab_link": true |
10 | 11 | }, |
11 | 12 | "kernelspec": { |
12 | | - "display_name": "Python 3 (ipykernel)", |
13 | | - "language": "python", |
| 13 | + "display_name": "Python 3", |
14 | 14 | "name": "python3" |
15 | 15 | }, |
16 | 16 | "language_info": { |
|
24 | 24 | "nbconvert_exporter": "python", |
25 | 25 | "pygments_lexer": "ipython3", |
26 | 26 | "version": "3.8.10" |
27 | | - }, |
28 | | - "gpuClass": "standard" |
| 27 | + } |
29 | 28 | }, |
30 | 29 | "cells": [ |
31 | 30 | { |
|
48 | 47 | "\n", |
49 | 48 | "##ColabFold v1.5.2-patch: AlphaFold2 using MMseqs2\n", |
50 | 49 | "\n", |
51 | | - "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", |
| 50 | + "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", |
52 | 51 | "Old versions: [v1.4](https://colab.research.google.com/github/sokrypton/ColabFold/blob/v1.4.0/AlphaFold2.ipynb), [v1.5.1](https://colab.research.google.com/github/sokrypton/ColabFold/blob/v1.5.1/AlphaFold2.ipynb)\n", |
53 | 52 | "\n", |
54 | 53 | "[Mirdita M, Schütze K, Moriwaki Y, Heo L, Ovchinnikov S, Steinegger M. ColabFold: Making protein folding accessible to all.\n", |
|
75 | 74 | "import hashlib\n", |
76 | 75 | "import random\n", |
77 | 76 | "\n", |
78 | | - "from sys import version_info \n", |
| 77 | + "from sys import version_info\n", |
79 | 78 | "python_version = f\"{version_info.major}.{version_info.minor}\"\n", |
80 | 79 | "\n", |
81 | 80 | "def add_hash(x,y):\n", |
|
176 | 175 | " if USE_TEMPLATES and not os.path.isfile(\"HH_READY\"):\n", |
177 | 176 | " print(\"installing hhsuite...\")\n", |
178 | 177 | " os.system(f\"mamba install -y -c conda-forge -c bioconda kalign2=2.04 hhsuite=3.3.0 python='{PYTHON_VERSION}'\")\n", |
179 | | - " os.system(\"touch HH_READY\") \n", |
| 178 | + " os.system(\"touch HH_READY\")\n", |
180 | 179 | " if USE_AMBER and not os.path.isfile(\"AMBER_READY\"):\n", |
181 | 180 | " print(\"installing amber...\")\n", |
182 | 181 | " os.system(f\"mamba install -y -c conda-forge openmm=7.7.0 python='{PYTHON_VERSION}' pdbfixer\")\n", |
|
220 | 219 | " os.rename(custom_msa, a3m_file)\n", |
221 | 220 | " queries_path=a3m_file\n", |
222 | 221 | " print(f\"moving {custom_msa} to {a3m_file}\")\n", |
223 | | - " \n", |
| 222 | + "\n", |
224 | 223 | "else:\n", |
225 | 224 | " a3m_file = os.path.join(jobname,f\"{jobname}.single_sequence.a3m\")\n", |
226 | 225 | " with open(a3m_file, \"w\") as text_file:\n", |
|
238 | 237 | "source": [ |
239 | 238 | "#@markdown ### Advanced settings\n", |
240 | 239 | "model_type = \"auto\" #@param [\"auto\", \"alphafold2_ptm\", \"alphafold2_multimer_v1\", \"alphafold2_multimer_v2\", \"alphafold2_multimer_v3\"]\n", |
241 | | - "#@markdown - if `auto` selected, will use `alphafold2_ptm` for monomer prediction and `alphafold2_multimer_v3` for complex prediction. \n", |
| 240 | + "#@markdown - if `auto` selected, will use `alphafold2_ptm` for monomer prediction and `alphafold2_multimer_v3` for complex prediction.\n", |
242 | 241 | "#@markdown Any of the mode_types can be used (regardless if input is monomer or complex).\n", |
243 | 242 | "num_recycles = \"auto\" #@param [\"auto\", \"0\", \"1\", \"3\", \"6\", \"12\", \"24\", \"48\"]\n", |
244 | 243 | "recycle_early_stop_tolerance = \"auto\" #@param [\"auto\", \"0.0\", \"0.5\", \"1.0\"]\n", |
|
325 | 324 | "if use_amber and f\"/usr/local/lib/python{python_version}/site-packages/\" not in sys.path:\n", |
326 | 325 | " sys.path.insert(0, f\"/usr/local/lib/python{python_version}/site-packages/\")\n", |
327 | 326 | "\n", |
328 | | - "def input_features_callback(input_features): \n", |
329 | | - " if display_images: \n", |
| 327 | + "def input_features_callback(input_features):\n", |
| 328 | + " if display_images:\n", |
330 | 329 | " plot_msa_v2(input_features)\n", |
331 | 330 | " plt.show()\n", |
332 | 331 | " plt.close()\n", |
|
360 | 359 | " use_templates=use_templates,\n", |
361 | 360 | " custom_template_path=custom_template_path,\n", |
362 | 361 | " num_relax=num_relax,\n", |
363 | | - " msa_mode=msa_mode, \n", |
| 362 | + " msa_mode=msa_mode,\n", |
364 | 363 | " model_type=model_type,\n", |
365 | 364 | " num_models=5,\n", |
366 | 365 | " num_recycles=num_recycles,\n", |
|
438 | 437 | " view.addStyle({'and':[{'resn':\"GLY\"},{'atom':'CA'}]},\n", |
439 | 438 | " {'sphere':{'colorscheme':f\"WhiteCarbon\",'radius':0.3}})\n", |
440 | 439 | " view.addStyle({'and':[{'resn':\"PRO\"},{'atom':['C','O'],'invert':True}]},\n", |
441 | | - " {'stick':{'colorscheme':f\"WhiteCarbon\",'radius':0.3}}) \n", |
| 440 | + " {'stick':{'colorscheme':f\"WhiteCarbon\",'radius':0.3}})\n", |
442 | 441 | " if show_mainchains:\n", |
443 | 442 | " BB = ['C','O','N','CA']\n", |
444 | 443 | " view.addStyle({'atom':BB},{'stick':{'colorscheme':f\"WhiteCarbon\",'radius':0.3}})\n", |
|
448 | 447 | "\n", |
449 | 448 | "show_pdb(rank_num, show_sidechains, show_mainchains, color).show()\n", |
450 | 449 | "if color == \"lDDT\":\n", |
451 | | - " plot_plddt_legend().show() " |
| 450 | + " plot_plddt_legend().show()" |
452 | 451 | ], |
453 | 452 | "execution_count": null, |
454 | 453 | "outputs": [] |
|
563 | 562 | "\n", |
564 | 563 | "**Using a custom MSA as input**\n", |
565 | 564 | "\n", |
566 | | - "To predict the structure with a custom MSA (A3M formatted): (1) Change the `msa_mode`: to \"custom\", (2) Wait for an upload box to appear at the end of the \"MSA options ...\" box. Upload your A3M. The first fasta entry of the A3M must be the query sequence without gaps. \n", |
| 565 | + "To predict the structure with a custom MSA (A3M formatted): (1) Change the `msa_mode`: to \"custom\", (2) Wait for an upload box to appear at the end of the \"MSA options ...\" box. Upload your A3M. The first fasta entry of the A3M must be the query sequence without gaps.\n", |
567 | 566 | "\n", |
568 | 567 | "It is also possilbe to proide custom MSAs for complex predictions. Read more about the format [here](https://github.com/sokrypton/ColabFold/issues/76).\n", |
569 | 568 | "\n", |
570 | 569 | "As an alternative for MSA generation the [HHblits Toolkit server](https://toolkit.tuebingen.mpg.de/tools/hhblits) can be used. After submitting your query, click \"Query Template MSA\" -> \"Download Full A3M\". Download the A3M file and upload it in this notebook.\n", |
571 | 570 | "\n", |
572 | 571 | "**PDB100** <a name=\"pdb100\"></a>\n", |
573 | 572 | "\n", |
574 | | - "As of 23/06/08, we have transitioned from using the PDB70 to a 100% clustered PDB, the PDB100. The construction methodology of PDB100 differs from that of PDB70. \n", |
| 573 | + "As of 23/06/08, we have transitioned from using the PDB70 to a 100% clustered PDB, the PDB100. The construction methodology of PDB100 differs from that of PDB70.\n", |
575 | 574 | "\n", |
576 | 575 | "The PDB70 was constructed by running each PDB70 representative sequence through [HHblits](https://github.com/soedinglab/hh-suite) against the [Uniclust30](https://uniclust.mmseqs.com/). On the other hand, the PDB100 is built by searching each PDB100 representative structure with [Foldseek](https://github.com/steineggerlab/foldseek) against the [AlphaFold Database](https://alphafold.ebi.ac.uk).\n", |
577 | 576 | "\n", |
|
591 | 590 | "\n", |
592 | 591 | "**Comparison to the full AlphaFold2 and AlphaFold2 Colab**\n", |
593 | 592 | "\n", |
594 | | - "This notebook replaces the homology detection and MSA pairing of AlphaFold2 with MMseqs2. For a comparison against the [AlphaFold2 Colab](https://colab.research.google.com/github/deepmind/alphafold/blob/main/notebooks/AlphaFold.ipynb) and the full [AlphaFold2](https://github.com/deepmind/alphafold) system read our [paper](https://www.nature.com/articles/s41592-022-01488-1). \n", |
| 593 | + "This notebook replaces the homology detection and MSA pairing of AlphaFold2 with MMseqs2. For a comparison against the [AlphaFold2 Colab](https://colab.research.google.com/github/deepmind/alphafold/blob/main/notebooks/AlphaFold.ipynb) and the full [AlphaFold2](https://github.com/deepmind/alphafold) system read our [paper](https://www.nature.com/articles/s41592-022-01488-1).\n", |
595 | 594 | "\n", |
596 | 595 | "**Troubleshooting**\n", |
597 | 596 | "* Check that the runtime type is set to GPU at \"Runtime\" -> \"Change runtime type\".\n", |
|
620 | 619 | "The source code of ColabFold is licensed under [MIT](https://raw.githubusercontent.com/sokrypton/ColabFold/main/LICENSE). Additionally, this notebook uses the AlphaFold2 source code and its parameters licensed under [Apache 2.0](https://raw.githubusercontent.com/deepmind/alphafold/main/LICENSE) and [CC BY 4.0](https://creativecommons.org/licenses/by-sa/4.0/) respectively. Read more about the AlphaFold license [here](https://github.com/deepmind/alphafold).\n", |
621 | 620 | "\n", |
622 | 621 | "**Acknowledgments**\n", |
623 | | - "- We thank the AlphaFold team for developing an excellent model and open sourcing the software. \n", |
| 622 | + "- We thank the AlphaFold team for developing an excellent model and open sourcing the software.\n", |
624 | 623 | "\n", |
625 | 624 | "- [KOBIC](https://kobic.re.kr) and [Söding Lab](https://www.mpinat.mpg.de/soeding) for providing the computational resources for the MMseqs2 MSA server.\n", |
626 | 625 | "\n", |
|
0 commit comments