API Reference#

This documentation contains the API reference for the MSA Search NIM.

OpenAPI Specification#

You can download the complete OpenAPI Specification for the MSA Search NIM here.

Get the configured databases#

Endpoint path: /biology/colabfold/msa-search/config/msa-database-configs

Request type: get

Input parameters#

None: This endpoint takes no inputs.

Outputs#

  • configs (dictionary): Always returned, except on error. This is a nested dictionary that contains information about all of the configured MSA databases. This can be converted to YAML to see the original configuration file.

Example#

#!/bin/bash

SEQUENCE="MALWMRLLPLLALLALWGPDPAAAFVNQHLCGSHLVEALYLVCGERGFFYTPKTRREAEDLQVGQVELGGGPGAGSLQPLALEGSLQKRGIVEQCCTSICSLYQLENYCN"

# Create JSON payload
JSON_DATA='{
"sequence": "'"$SEQUENCE"'",
"e_value": 0.0001,
"iterations": 1,
"databases": ["Uniref30_2302", "colabfold_envdb_202108", "PDB70_220313"],
"search_type": "alphafold2",
"output_alignment_formats": ["fasta", "a3m"],
"max_msa_sequences": 1000
}'

echo "Making request..."

# Make the POST request
# Note: This script requires jq to be installed for JSON processing
response=$(curl -s -X POST \
-H "Content-Type: application/json" \
-d "$JSON_DATA" \
http://localhost:8000/biology/colabfold/msa-search/predict)

# Extract and display the A3M format and alignment
# Using jq to parse the JSON response
echo "Format: $(echo $response | jq -r '.alignments.Uniref30_2302.a3m.format')"
echo "Alignment:"
echo "$response" | jq -r '.alignments.Uniref30_2302.a3m.alignment'
import requests
import json


if __name__ == "__main__":
    headers = {
        "content-type": "application/json"
        }
    print("Making request...")
    response = requests.get("http://localhost:8000/biology/colabfold/msa-search/config/msa-database-configs",headers=headers)
    print(json.dumps(response.json(), indent=4))

Readiness check#

Endpoint path: /v1/health/ready

Input parameters#

None.

Outputs#

The output of the endpoint is a JSON response with a value that indicates the readiness of the microservice. When the NIM is ready, it returns the response 200.

Example#

#!/bin/bash
URL=${NIM_URL:-"http://localhost:8000/v1/health/ready"}
curl -s -w "\nStatus code: %{http_code}\n" -H "Content-Type: application/json" $URL
import requests
import os

if __name__ == "__main__":
    url = os.environ.get("NIM_URL", "http://localhost:8000/v1/health/ready")
    headers = {
        "content-type": "application/json"
    }
    try:
        response = requests.get(url, headers=headers)
        print(f"NIM readiness check returned {response.status_code}")
        assert response.status_code == 200, f"Unexpected status code: {response.status_code}"
    except Exception as e:
        print(f"Health query failed: {e}")