Predicts the 3D structure of a protein from its amino acid sequence.
Follow the steps below to download and run the NVIDIA NIM inference microservice for this model on your infrastructure of choice.
NGC_CLI_API_KEY
variable.export NGC_CLI_API_KEY=<your personal NGC key>
export LOCAL_NIM_CACHE=~/.cache/nim mkdir -p $LOCAL_NIM_CACHE
Note that you may need to run (sudo) chmod -R 777 $LOCAL_NIM_CACHE
after the AlphaFold2 model is downloaded to avoid permission issues.
docker run -it --rm \ --runtime=nvidia \ -p 8000:8000 \ -e NGC_CLI_API_KEY \ -v $LOCAL_NIM_CACHE:/opt/nim/.cache \ 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.
{"status":"ready"}
before proceeding. This may take a couple of minutes. You can use the following command to query the health check.curl -X 'GET' \ 'http://localhost:8000/v1/health/ready' \ -H 'accept: application/json'
nim_client.py
.import requests import json url = "http://localhost:8000/protein-structure/alphafold2/multimer/predict-structure-from-sequences" # Replace with the actual URL sequences = ["MNVIDIAIAMAI", "NESKHCAWVMIPTFRQYDGL"] # Replace with the actual sequences. headers = { "content-type": "application/json" } data = { "sequences": sequences, "databases": ["small_bfd"], "e_value": 0.000001, "algorithm": "jackhmmer", "num_predictions_per_model" : 1, "relax_prediction": False, } response = requests.post(url, headers=headers, data=json.dumps(data)) # Check if the request was successful if response.ok: with open("output.pdb", "w") as ofi: ofi.write(json.dumps(response.json())) print("Request succeeded:", response.json()) else: print("Request failed:", response.status_code, response.text)
python nim_client.py
output.pdb
.cat output.pdb
nim_client.sh
.#!/usr/bin/env bash set -e URL=http://localhost:8000/protein-structure/alphafold2/multimer/predict-structure-from-sequences request='{ "sequences": ["MNVIDIAIAMAI", "NESKHCAWVMIPTFRQYDGL"] }' curl -H 'Content-Type: application/json' \ -d "$request" "$URL"
chmod +x nim_client.sh ./nim_client.sh