AlphaFold2-Multimer (Latest)
AlphaFold2-Multimer (Latest)

Quickstart Guide

Note

This guide assumes you have installed and set up Prerequisite Software (Docker Log-In, NGC CLI Setup & Registry Access, Model Cache Setup).

  1. Pull the NIM container with the following command.

Copy
Copied!
            

docker pull nvcr.io/nim/deepmind/alphafold2-multimer:1.0.0

  1. Run the NIM container with the following command.

Copy
Copied!
            

export LOCAL_NIM_CACHE=~/.cache/nim export NGC_CLI_API_KEY=<Your NGC CLI API Key> docker run -it --rm --name alphafold2-multimer --runtime=nvidia \ -e NGC_CLI_API_KEY \ -v $LOCAL_NIM_CACHE:/opt/nim/.cache \ -p 8000:8000 \ nvcr.io/nim/deepmind/alphafold2-multimer:1.0.0

This command will start the NIM container and expose port 8000 for the user to interact with the NIM. It will pull the model to the cache at $LOCAL_NIM_CACHE on the local filesystem.

Note

Downloading the AlphaFold2 model can take a very long time (4-10 hours on a 100+ Mbps internet connection).


Note

If the docker run command fails due to file permission errors after downloading the AlphaFold2 model, please run the following command: (sudo) chmod -R 777 $LOCAL_NIM_CACHE. Then docker run the NIM.


  1. Open a new terminal, leaving the current terminal open with the launched service.

  2. In the new terminal, wait until the health check end point returns {"status":"ready"} before proceeding. This may take a couple of minutes. You can use the following command to query the health check.

Copy
Copied!
            

curl -X 'GET' \ 'http://localhost:8000/v1/health/ready' \ -H 'accept: application/json'

If you would rather check the NIM’s status via python, you can use the requests module (once installed via pip install requests):

Copy
Copied!
            

import requests url = "http://localhost:8000/v1/health/ready" # Replace with the actual URL headers = { "content-type": "application/json" } try: response = requests.get(url, headers=headers) # Check if the request was successful if response.ok: print("Request succeeded:", response.json()) else: print("Request failed:", response.status_code, response.text) except Exception as E: print("Request failed:", E)

  1. Run inference to get a predicted protein structure for an amino acid sequence using the following command.

Copy
Copied!
            

curl -X 'POST' \ 'http://localhost:8000/protein-structure/alphafold2/multimer/predict-structure-from-sequences' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{"sequences": ["MNVIDIAIAMAI", "IAMNVIDIAAI"]}' > output.json

In python:

Copy
Copied!
            

import requests import json url = "http://localhost:8000/protein-structure/alphafold2/multimer/predict-structure-from-sequences" # Replace with the actual URL. sequences = ["MNVIDIAIAMAI", "IAMNVIDIAAI"] # Replace with the actual sequences you want to perform structure prediction on. headers = { "content-type": "application/json" } data = { "sequences": sequences, "databases": ["uniref90", "small_bfd"] } response = requests.post(url, headers=headers, data=json.dumps(data)) # Check if the request was successful if response.ok: print("Request succeeded:", response.json()) else: print("Request failed:", response.status_code, response.text)

  1. View the outputs. You can use the cat tool print the outputs to the command line as with the following command.

Copy
Copied!
            

cat output.json

However, we recommend installing jq, a command line tool that can format JSON for improved readability. You can use jq to visualize the output from the file (note, you must install jq; on Linux this can be done using apt-get install jq):

Copy
Copied!
            

jq . output.json

or you can pipe the output directly to jq as in the following command:

Copy
Copied!
            

curl -X 'POST' \ 'http://localhost:8000/protein-structure/alphafold2/multimer/predict-structure-from-sequences' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{"sequences": ["MNVIDIAIAMAI", "IAMNVIDIAAI"]}' | jq

Previous Prerequisites
Next Deployment Guide
© Copyright © 2024, NVIDIA Corporation. Last updated on Sep 24, 2024.