← Files NVIDIA BioNeMo Agent ToolkitARCHIVED FILE

skills/openfold3-nim/references/examples.md

2.25 KB · Sep 30, 2026 · 23:14 UTC

↓ Download file

# OpenFold3 Examples

## Hosted Protein Smoke Test

```python
import os
import requests

seq = "MKTVRQERLKSIVR"
payload = {
    "inputs": [{
        "input_id": "protein_smoke",
        "output_format": "pdb",
        "molecules": [{
            "type": "protein",
            "id": "A",
            "sequence": seq,
            "diffusion_samples": 1,
            "msa": {"main": {"a3m": {"alignment": f">query\n{seq}", "format": "a3m"}}}
        }]
    }]
}

response = requests.post(
    "https://health.api.nvidia.com/v1/biology/openfold/openfold3/predict",
    headers={
        "Content-Type": "application/json",
        "Authorization": f"Bearer {os.environ['NGC_API_KEY']}",
    },
    json=payload,
    timeout=300,
)
response.raise_for_status()
result = response.json()
```

## Local Protein Smoke Test

```python
response = requests.post(
    "http://localhost:8000/biology/openfold/openfold3/predict",
    headers={"Content-Type": "application/json"},
    json=payload,
    timeout=300,
)
response.raise_for_status()
```

## Protein Plus CCD Ligand

```python
payload["inputs"][0]["molecules"] = [
    {
        "type": "protein",
        "id": "A",
        "sequence": seq,
        "msa": {"main": {"a3m": {"alignment": f">query\n{seq}", "format": "a3m"}}},
    },
    {"type": "ligand", "id": "L", "ccd_codes": "ATP"},
]
```

## Protein Plus SMILES Ligand

```python
payload["inputs"][0]["molecules"] = [
    {
        "type": "protein",
        "id": "A",
        "sequence": seq,
        "msa": {"main": {"a3m": {"alignment": f">query\n{seq}", "format": "a3m"}}},
    },
    {"type": "ligand", "id": "L", "smiles": "CC(=O)OC1=CC=CC=C1C(=O)O"},
]
```

## Protein-DNA Complex

```python
payload["inputs"][0]["molecules"] = [
    {
        "type": "protein",
        "id": "A",
        "sequence": seq,
        "msa": {"main": {"a3m": {"alignment": f">query\n{seq}", "format": "a3m"}}},
    },
    {"type": "dna", "id": "B", "sequence": "ATCGATCG"},
    {"type": "dna", "id": "C", "sequence": "CGATCGAT"},
]
```

## Save Structures

```python
for idx, sample in enumerate(result["outputs"][0]["structures_with_scores"], start=1):
    path = f"openfold3_structure_{idx}.{sample['format']}"
    with open(path, "w", encoding="utf-8") as handle:
        handle.write(sample["structure"])
```

SHA-256: 0f5e9df40033ee0e83ee2f1b6085f20edfcd989df6d4295931e1685e08a7114e