AlphaFold 3

repository·main·Indexed 27 days ago

https://github.com/google-deepmind/alphafold3

An implementation of the inference pipeline for predicting the structures of biomolecular interactions. It supports protein sequences and other molecular data via a Dockerized Python environment, utilizing the run_alphafold.py script for execution. The system uses a specific JSON input schema (versions 1-4) to define protein, RNA, DNA, and ligand entities, including support for external MSAs, templates, and custom CCD files.

Tokens
51.4K
Snippets
47
Records
139
Agent score
93%

What's inside alphafold3

  1. Understand AlphaFold 3 Output Terms of Use

    main

    AlphaFold 3 Output (structure predictions and related information) is provided free of charge for non-commercial use only.

    If you have already agreed to the AlphaFold 3 Model Parameters Terms of Use, your use of Output is governed by those terms. If you have not agreed to the Model Parameters terms, you must follow these Output Terms of Use. If you do not agree to these terms, do not use the Output.

  2. System Requirements for AlphaFold 3

    main

    AlphaFold 3 requires a Linux environment. Key hardware and software requirements include:

    • OS: Linux (other operating systems are not supported).
    • GPU: NVIDIA GPU with Compute Capability 8.0 or greater (e.g., NVIDIA A100 80 GB or H100 80 GB).
    • RAM: At least 64 GB of RAM is recommended, especially for long targets during the genetic search stage.
    • Storage: Up to 1 TB of disk space is required for genetic databases. SSD storage is highly recommended for performance.
    • Docker Host: If using the Docker container, the host machine must have CUDA 12.6 installed.
    • Local Installation: If installing outside of Docker, ensure CUDA, cuDNN, and JAX are correctly installed.
  3. Understand AlphaFold 3 Licensing and Terms of Use

    main

    AlphaFold 3 is subject to different terms for its source code and its model parameters:

    • Source Code: Licensed under the Apache License, Version 2.0.
    • Model Parameters: Subject to the AlphaFold 3 Model Parameters Terms of Use. You must comply with these specific terms to use the weights.

    Important Disclaimers:

    • AlphaFold 3 and its output are for theoretical modeling only. They are not validated or approved for clinical use and should not be used for medical or professional advice.
    • Outputs are predictions with varying levels of confidence and should be interpreted with caution.
    • The software is provided on an "AS IS" basis without warranties.
  4. Install NVIDIA Drivers

    main

    Install NVIDIA drivers on Ubuntu using ubuntu-drivers-common. After installation, verify the drivers with nvidia-smi. You may need to reboot the instance if you encounter communication errors.

    sudo apt -y install alsa-utils ubuntu-drivers-common
    sudo ubuntu-drivers install
    
    sudo nvidia-smi --gpu-reset
    
    nvidia-smi
  5. Requirements for distributing or publishing AlphaFold 3 Output

    main

    When distributing or publishing Output, you must comply with the following requirements:

    1. Provide Notice: You must provide conspicuous notice that the Output is subject to these Terms. If you remove the original terms or notices, you must include a copy of the AlphaFold 3 Output Terms of Use and a "Legally Binding Terms of Use" text file containing the specific notice below.
    2. Cite the Paper: You must cite the following paper when distributing Output or disclosing findings: Abramson, J et al. Accurate structure prediction of biomolecular interactions with AlphaFold 3. Nature (2024).
    3. No Conflicting Terms: You must not include additional or different terms that conflict with the AlphaFold 3 Output Terms of Use.
    By using this information, you agree to AlphaFold 3 Output Terms of
    Use found at
    https://github.com/google-deepmind/alphafold3/blob/main/OUTPUT_TERMS_OF_USE.md.
    
    To request access to the AlphaFold 3 model parameters, follow the
    process set out at https://github.com/google-deepmind/alphafold3. You
    may only use these if received directly from Google. Use is subject to
    terms of use available at
    https://github.com/google-deepmind/alphafold3/blob/main/WEIGHTS_TERMS_OF_USE.md.
  6. Understand AlphaFold 3 Usage Terms and Restrictions

    main

    AlphaFold 3 model parameters and outputs are provided for non-commercial use only. This applies to non-commercial organizations such as universities, non-profit organizations, research institutions, educational institutions, journalism, and government agencies.

    Key Restrictions:

    • No Commercial Use: You may not use AlphaFold 3 parameters or outputs for any commercial activity, including research conducted on behalf of a commercial organization.
    • No Model Training: You are prohibited from using AlphaFold 3 outputs to train machine learning models or related technologies for biomolecular structure prediction similar to AlphaFold 3.
    • Parameter Distribution: You must not publish or share the AlphaFold 3 model parameters, except within your own organization in accordance with these terms.
    • Prohibited Use Policy: All usage must comply with the AlphaFold 3 Model Parameter Prohibited Use Policy.
  7. Run the AlphaFold 3 pipeline in stages

    main

    To optimize resource usage (e.g., separating CPU-heavy data processing from GPU-heavy inference), you can run run_alphafold.py in stages using specific flags.

    Data Pipeline Only

    Run the data pipeline to generate Multiple Sequence Alignments (MSAs) and templates without performing inference. This produces JSON files that can be used for subsequent inference runs.

    • Flag: --run_inference=false

    Featurisation and Model Inference Only

    Skip the data pipeline (MSA and template search) and run only the featurisation and model inference steps. This requires the input JSON to already contain pre-computed MSAs and templates.

    • Flag: --run_data_pipeline=false
  8. Run AlphaFold 3 using Singularity

    main

    To run AlphaFold 3 in Singularity, you must first build a Singularity image (.sif) from a Docker image by pushing the Docker image to a local registry.

    Workflow:

    1. Start a local registry: docker run -d -p 5000:5000 --name registry registry:2
    2. Tag and push your AlphaFold 3 image: docker tag alphafold3 localhost:5000/alphafold3 and docker push localhost:5000/alphafold3
    3. Build the .sif file: singularity build alphafold3.sif docker://localhost:5000/alphafold3:latest
    4. Execute using singularity exec --nv to enable GPU support.
    # Build the Singularity container
    SINGULARITY_NOHTTPS=1 singularity build alphafold3.sif docker://localhost:5000/alphafold3:latest
    
    # Run AlphaFold 3 with Singularity
    singularity exec \
         --nv \
         --bind $HOME/af_input:/root/af_input \
         --bind $HOME/af_output:/root/af_output \
         --bind <MODEL_PARAMETERS_DIR>:/root/models \
         --bind <DB_DIR>:/root/public_databases \
         alphafold3.sif \
         python run_alphafold.py \
         --json_path=/root/af_input/fold_input.json \
         --model_dir=/root/models \
         --db_dir=/root/public_databases \
         --output_dir=/root/af_output
  9. Understand AlphaFold 3 Model Parameter Usage Terms

    main

    The AlphaFold 3 model parameters and generated outputs are provided for non-commercial use only by non-commercial organizations (e.g., universities, non-profits, research institutes, government agencies).

    Key Usage Rules:

    • Permitted Users: Non-commercial organizations or researchers affiliated with them, provided they are not acting on behalf of a commercial entity.
    • Prohibited Commercial Use: You may not use parameters or outputs for any commercial activity, including research conducted on behalf of commercial organizations.
    • Prohibited Model Training: You may not use AlphaFold 3 outputs to train machine learning models or related technologies for biomolecular structure prediction similar to AlphaFold 3.
    • Parameter Sharing: You are not permitted to publish or share the model parameters, except within your own organization in accordance with these terms.
    • Output Sharing: You are permitted to publish, share, and adapt the outputs of AlphaFold 3, subject to the AlphaFold 3 Output Terms of Use.
  10. Install Docker on Ubuntu 22.04 LTS

    main

    To install Docker on a clean Ubuntu 22.04 LTS host, follow these steps to add the official GPG key and repository, then install the Docker engine components.

    sudo apt-get update
    sudo apt-get install ca-certificates curl
    sudo install -m 0755 -d /etc/apt/keyrings
    sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
    sudo chmod a+r /etc/apt/keyrings/docker.asc
    
    echo \
      "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
      $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
      sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
    
    sudo apt-get update
    sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
    sudo docker run hello-world
  11. Configure XLA flags for CUDA Capability 7.x GPUs

    main

    For CUDA Capability 7.x GPUs (such as the NVIDIA V100), you must set the XLA_FLAGS environment variable to disable specific HLO passes. Triton GEMM kernels are not required for these GPUs.

    ENV XLA_FLAGS="--xla_disable_hlo_passes=custom-kernel-fusion-rewriter"
  12. Restrict AlphaFold 3 Output to non-commercial use

    main

    Output may only be used by non-commercial organizations (e.g., universities, non-profits, research institutes, government bodies).

    Prohibited uses include:

    • Use on behalf of a commercial organization or in connection with commercial activities (including research for commercial organizations).
    • Sharing Output with a commercial organization (except when making it publicly available via scientific publication, open source release, or journalism).
    • Using Output to train or create machine learning models for biomolecular structure prediction similar to AlphaFold 3 ("Derived Models"), including via distillation.