|
| 1 | +# RoseTTAFold for PyTorch |
| 2 | + |
| 3 | +This repository provides a script to run inference using the RoseTTAFold model. The content of this repository is tested and maintained by NVIDIA. |
| 4 | + |
| 5 | +## Table Of Contents |
| 6 | + |
| 7 | +- [Model overview](#model-overview) |
| 8 | + * [Model architecture](#model-architecture) |
| 9 | +- [Setup](#setup) |
| 10 | + * [Requirements](#requirements) |
| 11 | +- [Quick Start Guide](#quick-start-guide) |
| 12 | +- [Release notes](#release-notes) |
| 13 | + * [Changelog](#changelog) |
| 14 | + * [Known issues](#known-issues) |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | +## Model overview |
| 19 | + |
| 20 | +The RoseTTAFold is a model designed to provide accurate protein structure from its amino acid sequence. This model is |
| 21 | +based on [Accurate prediction of protein structures and interactions using a 3-track network](https://www.biorxiv.org/content/10.1101/2021.06.14.448402v1) by Minkyung Baek et al. |
| 22 | + |
| 23 | +This implementation is a dockerized version of the official [RoseTTAFold repository](https://github.com/RosettaCommons/RoseTTAFold/). |
| 24 | +Here you can find the [original RoseTTAFold guide](README-ROSETTAFOLD.md). |
| 25 | + |
| 26 | +### Model architecture |
| 27 | + |
| 28 | +The RoseTTAFold model is based on a 3-track architecture fusing 1D, 2D, and 3D information about the protein structure. |
| 29 | +All information is exchanged between tracks to learn the sequence and coordinate patterns at the same time. The final prediction |
| 30 | +is refined using an SE(3)-Transformer. |
| 31 | + |
| 32 | +<img src="images/NetworkArchitecture.jpg" width="900"/> |
| 33 | + |
| 34 | +*Figure 1: The RoseTTAFold architecture. Image comes from the [original paper](https://www.biorxiv.org/content/10.1101/2021.06.14.448402v1).* |
| 35 | + |
| 36 | +## Setup |
| 37 | + |
| 38 | +The following section lists the requirements that you need to meet in order to run inference using the RoseTTAFold model. |
| 39 | + |
| 40 | +### Requirements |
| 41 | + |
| 42 | +This repository contains a Dockerfile that extends the PyTorch NGC container and encapsulates necessary dependencies. Aside from these dependencies, ensure you have the following components: |
| 43 | +- [NVIDIA Docker](https://github.com/NVIDIA/nvidia-docker) |
| 44 | +- PyTorch 21.09-py3 NGC container |
| 45 | +- Supported GPUs: |
| 46 | + - [NVIDIA Volta architecture](https://www.nvidia.com/en-us/data-center/volta-gpu-architecture/) |
| 47 | + - [NVIDIA Turing architecture](https://www.nvidia.com/en-us/design-visualization/technologies/turing-architecture/) |
| 48 | + - [NVIDIA Ampere architecture](https://www.nvidia.com/en-us/data-center/nvidia-ampere-gpu-architecture/) |
| 49 | + |
| 50 | +For more information about how to get started with NGC containers, refer to the following sections from the NVIDIA GPU Cloud Documentation and the Deep Learning Documentation: |
| 51 | +- [Getting Started Using NVIDIA GPU Cloud](https://docs.nvidia.com/ngc/ngc-getting-started-guide/index.html) |
| 52 | +- [Accessing And Pulling From The NGC Container Registry](https://docs.nvidia.com/deeplearning/frameworks/user-guide/index.html#accessing_registry) |
| 53 | +- [Running PyTorch](https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes/running.html#running) |
| 54 | + |
| 55 | +For those unable to use the PyTorch NGC container, to set up the required environment or create your own container, refer to the versioned [NVIDIA Container Support Matrix](https://docs.nvidia.com/deeplearning/frameworks/support-matrix/index.html). |
| 56 | + |
| 57 | +In addition, 1 TB of disk space is required to unpack the required databases. |
| 58 | + |
| 59 | +## Quick Start Guide |
| 60 | + |
| 61 | +To run inference using the RoseTTAFold model, perform the following steps using the default parameters. |
| 62 | + |
| 63 | +1. Clone the repository. |
| 64 | + ``` |
| 65 | + git clone https://github.com/NVIDIA/DeepLearningExamples |
| 66 | + cd DeepLearningExamples/DGLPyTorch/ |
| 67 | + ``` |
| 68 | +
|
| 69 | +2. Download the pre-trained weights and databases needed for inference. |
| 70 | + The following command downloads the pre-trained weights and two databases needed to create derived features to the input to the model. |
| 71 | + The script will download the `UniRef30` (~50 GB) and `pdb100_2021Mar03` (~115 GB) databases, which might take a considerable amount |
| 72 | + of time. Additionally, unpacking those databases requires approximately 1 TB of free disk space. |
| 73 | +
|
| 74 | + By default, the data will be downloaded to `./weights` and `./databases` folders in the current directory. |
| 75 | + ``` |
| 76 | + bash scripts/download_databases.sh |
| 77 | + ``` |
| 78 | + If you would like to specify the download location you can pass the following parameters |
| 79 | + ``` |
| 80 | + bash scripts/download_databases.sh PATH-TO-WEIGHTS PATH-TO-DATABASES |
| 81 | + ``` |
| 82 | +
|
| 83 | +3. Build the RoseTTAFold PyTorch NGC container. This step builds the PyTorch dependencies on your machine and can take between 30 minutes and 1 hour to complete. |
| 84 | + ``` |
| 85 | + docker build -t rosettafold . |
| 86 | + ``` |
| 87 | +
|
| 88 | +4. Start an interactive session in the NGC container to run inference. |
| 89 | + |
| 90 | + The following command launches the container and mount the `PATH-TO-WEIGHTS` directory as a volume to the `/weights` directory in the container, the `PATH-TO-DATABASES` directory as a volume to the `/databases` directory in the container, and `./results` directory to the `/results` directory in the container. |
| 91 | + ``` |
| 92 | + mkdir data results |
| 93 | + docker run --ipc=host -it --rm --runtime=nvidia -p6006:6006 -v PATH-TO-WEIGHTS:/weights -v PATH-TO-DATABASES:/databases -v ${PWD}/results:/results rosettafold:latest /bin/bash |
| 94 | + ``` |
| 95 | + |
| 96 | +5. Start inference/predictions. |
| 97 | + |
| 98 | + To run inference you have to prepare a FASTA file and pass a path to it or pass a sequence directly. |
| 99 | + ``` |
| 100 | + python run_inference_pipeline.py [Sequence] |
| 101 | + ``` |
| 102 | + There is an example FASTA file at `example/input.fa` for you to try. Running the inference pipeline consists of four steps: |
| 103 | + 1. Preparing the Multiple Sequence Alignments (MSAs) |
| 104 | + 2. Preparing the secondary structures |
| 105 | + 3. Preparing the templates |
| 106 | + 4. Iteratively refining the prediction |
| 107 | + |
| 108 | + The first three steps can take between a couple of minutes and an hour, depending on the sequence. |
| 109 | + The output will be stored at the `/results` directory as an `output.e2e.pdb` file |
| 110 | +
|
| 111 | +6. Start Jupyter Notebook to run inference interactively. |
| 112 | +
|
| 113 | + To launch the application, copy the Notebook to the root folder. |
| 114 | + ``` |
| 115 | + cp notebooks/run_inference.ipynb . |
| 116 | + |
| 117 | + ``` |
| 118 | + To start Jupyter Notebook, run: |
| 119 | + ``` |
| 120 | + jupyter notebook run_inference.ipynb |
| 121 | + ``` |
| 122 | + |
| 123 | + For more information about Jupyter Notebook, refer to the Jupyter Notebook documentation. |
| 124 | +
|
| 125 | +
|
| 126 | +## Release notes |
| 127 | +
|
| 128 | +### Changelog |
| 129 | +
|
| 130 | +October 2021 |
| 131 | +- Initial release |
| 132 | +
|
| 133 | +### Known issues |
| 134 | +
|
| 135 | +There are no known issues with this model. |
| 136 | +
|
| 137 | +
|
| 138 | +
|
0 commit comments