Generates a multiple sequence alignment from a query sequence and a protein sequence database search.
Follow the steps below to download and run the NVIDIA NIM inference microservice for this model on your infrastructure of choice.
Pull and run colabfold/msa-search
using Docker (this will download the full model and run it in your local environment)
$ docker login nvcr.io Username: $oauthtoken Password: <PASTE_API_KEY_HERE>
NGC_API_KEY
environment variable.export NGC_API_KEY=<your personal NGC key>
export LOCAL_NIM_CACHE=~/.cache/nim mkdir -p $LOCAL_NIM_CACHE
docker run -it \ --runtime=nvidia \ -p 8000:8000 \ -e NGC_API_KEY \ -v "$LOCAL_NIM_CACHE":/opt/nim/.cache \ nvcr.io/nim/colabfold/msa-search:1.0.0
This will by default run on all available GPUs. Below is an example of running the NIM specifically on device 1:
docker run -it \ --runtime=nvidia \ --gpus='"device=0"' \ -p 8000:8000 \ -e NGC_API_KEY \ -v "$LOCAL_NIM_CACHE":/opt/nim/.cache \ nvcr.io/nim/colabfold/msa-search:1.0.0
The following python script can be saved to a file named query-msa-search.py
and can then be run using
python query-msa-search.py
. This will post
a request to the locally-running NIM and print the response
if it returns successfully. If the NIM fails, the response's text field will be printed.
import requests import json def main(): # Define the URL to which the request will be sent NIM_URL_FULL_PATH = "http://0.0.0.0:8000/biology/colabfold/msa-search/predict" # Replace with your actual URL # Define the sequence data sequence = ( "MVPSAGQLALFALGIVLAACQALENSTSPLSADPPVAAAVVSHFNDCPDSHTQFCFHGTCRFL" "VQEDKPACVCHSGYVGARCEHADLLAVVAASQKKQAITALVVVSIVALAVLIITCVLIHCCQVRKHCEWCR" "ALICRHEKPSALLKGRTACCHSETVV" ) # Set the request headers headers = { "Content-Type": "application/json" } # Prepare the payload data = { "sequence": sequence, "search_type": "colabfold" } print("Making request to", NIM_URL_FULL_PATH) # Make the POST request response = requests.post(NIM_URL_FULL_PATH, headers=headers, data=json.dumps(data)) # Check the response status if response.status_code == 200: print("Request was successful.") # Optionally, process the response content with open('response.json', 'w') as f: json.dump(response.json(), f) else: print(f"Unexpected status code: {response.status_code}") print("Response data:", response.text) if __name__ == "__main__": main()