On the use of this material

Coding AlphaFold yourself is not done in one day, not if you aren’t a machine-learning and geometry expert before already. The material tries to cover all the necessary topics on the way, but to do this, it quickly picks up the pace. Depending on your background, the tutorials here can be really hard for you. That’s not a problem, it is expected. There are many different ways to go through this material.

We explicitly provide solutions to all the tutorials on our GitHub. If you struggle with an exercise, feel free to check them out. Programming is way less like math when it comes to ‘spoiling the learning effect by not coming to the result yourself’. Rather, seeing how another programmer has solved a task can be really educative, as there are a lot of different styles and approaches to problems, and looking at code from another developer can greatly improve your own style.

Another good option for when you are stuck are Chatbots, like ChatGPT or Google Gemini. You are probably already familiar with their use, and not only can they solve most of the problems here if you provide them with the context, they can also explain the solution and the syntax being used, and showcase different ways to solve the problem.

If you find that you heavily rely on the solutions, on googling or on using ChatGPT to solve the tutorials, there is nothing wrong with that. We suggest however, that when you are done with the notebook, try redoing it, or even redo it twice for speed. Programming is a lot about memoization of patterns to solve different settings.

With that out of the way, we are happy that you start on this journey! Learning AlphaFold is somewhat complex, but it is also incredibly educative. It’s not just an example for a modern machine learning architecture, but it is also deeply geometric. You will learn how rotations in 3D work, what quaternions are, and how to consider geometric vicinity in attention modules. This is a lot of material, so don’t overstress yourself and go through everything at your own pace. Now, if you are ready, read on to go through the setup for the tutorial material.

Setup Instructions

Choose the method that works best for you:

Working with Colab (Recommended for beginners)

Colab provides a fast and easy way to get started with the tutorials, especially if you don’t have a powerful GPU. You can even access a GPU within Colab for the final prediction steps.

  1. Create a folder named ‘alphafold-tutorials’ on Google Drive.

  2. Activate Colab in Google Drive:

    • Go to My Drive -> More -> Connect more Apps
    • Search for “Colaboratory” and install it
  3. In each chapter, download the material and upload it to ‘alphafold-tutorials’. You can try it out with the material for the tensor introduction.

  4. Open a tutorial notebook in Colab:

    • Navigate to the .ipynb file of the tutorial you want to run in your Google Drive.
    • Right-click the file and select Open with -> Colaboratory
  5. Grant permissions when prompted.

  6. Enable GPU (optional):

    • If the tutorial requires a GPU, go to Runtime -> Change Runtime Type -> Select “GPU” and save.
  7. Set your folder path (first cell):

    • In the first code cell of your notebook, you’ll likely see a line to set the folder_name. Update this with the correct path to your ‘alphafold-tutorials’ folder in Google Drive.

Local Setup (For advanced users)

If you’re an advanced user and prefer working in your own local environment, follow these steps:

  1. Install a Package Manager (if needed):

  2. Install Dependencies

    • Select the right environment file:
      • environment_cpu.yml (no GPU)
      • environment_cuda.yml (NVIDIA GPU)
      • environment_mac.yml (Mac systems)
    • Install using Conda or Mamba:
      # With Conda:
      conda env create -f environment_cpu.yml  # Or environment_cuda.yml/mac.yml
      
      # With Mamba:
      mamba env create -f environment_cpu.yml  # Or environment_cuda.yml/mac.yml
      
  3. Activate the Environment:

    conda activate alphafold
    
  4. Launch Jupyter Notebook and Select Kernel:

    • Start Jupyter Notebook from the ‘tutorials’ folder.
    • In text editors like VS Code, set the workspace setting “Jupyter: Notebook File Root” to ‘tutorials’.
    • Open a tutorial, ensuring the kernel name matches your environment (‘alphafold’).