# OpenFold3

OpenFold3 (open PyTorch reproduction of AlphaFold3) predicts 3D structures of protein/RNA/DNA chains with small-molecule ligands. Supports precomputed main/paired MSAs, mmCIF templates, single complexes and JSON batch files. Returns diffusion samples ranked by confidence (pLDDT/pTM/ipTM/GPDE/PAE) with retrieved-MSA and template viewers.

## 基础信息

| 项目 | 值 |
|------|-----|
| Base URL | `https://sciminer.tech/console/api` |
| API Endpoint | `/v1/internal/tools/invoke` |
| Content-Type | `application/json` |
| Authentication | `X-Auth-Token: <YOUR_API_KEY>` |

## 1. Predict From Params

**Tool Name:** `predict_from_params_predict_from_params_post`

**Method:** `POST`

### 参数

| 参数名 | 类型 | 必需 | 说明 | 枚举值 |
|--------|------|------|------|--------|
| `protein_MSA_method` | `select` | ✗ | MSA strategy for protein chains: 'MMSeq2 Search' queries the public ColabFold server (MMseqs2 search, needs internet); 'Upload File' uses the msa_file uploads; 'No MSA' runs without MSAs. | `MMSeq2 Search`, `Upload File`, `No MSA` |
| `protein_Template_method` | `select` | ✗ | Template strategy for protein chains: 'MMSeq2 Search' retrieves PDB templates through the same ColabFold server query as the MSA search (requires protein_MSA_method='MMSeq2 Search'); 'Upload File' uses the template_file uploads; 'No Template' runs without templates. | `MMSeq2 Search`, `Upload File`, `No Template` |
| `protein` | `array` | ✗ | Protein chain sequences in one-letter amino acid code, one entry per chain. |  |
| `msa_file` | `file_array` | ✗ | Precomputed protein MSAs (.a3m/.sto), only with 'Upload File'. Each uploaded alignment is a MAIN/unpaired MSA (one per chain) and/or the shared PAIRED MSA (species-matched cross-chain rows, one for the whole complex); kind + chain assignment via msa_file_info (see below). The tool relabels each upload to OpenFold3's recognized layout (per-chain main under a chain directory, one shared colabfold_paired). An arbitrary filename alone does NOT tell OpenFold3 what to feed, so msa_file_info is mandatory.<br/>file suffix: `a3m`, `sto` |  |
| `msa_file_info` | `array` | ✗ | REQUIRED with msa_file: maps every uploaded alignment to its kind and protein chain(s): format '<msa_id>-<chain_ids>[-<kind>]'. '<msa_id>' = msa<n>, the n-th uploaded msa_file (1-based); '<kind>' = 'main'/'unpaired' or 'paired' (case-insensitive). For a SINGLE-chain request the kind MAY be omitted and defaults to MAIN/unpaired ('msa1-P1'); for MULTI-chain requests the kind is MANDATORY on every entry (e.g. per-chain mains 'msa1-P1-main','msa2-P2-main' plus one shared paired 'msa3-P1,P2-paired'). The PAIRED alignment is complex-wide: map it to every chain that should receive it. Each chain gets one main MSA; chains with no paired get it gap-filled. Chains not listed run without that MSA kind. |  |
| `template_file` | `file_array` | ✗ | Protein template structures as mmCIF, only with protein_Template_method 'Upload File' (CIF direct template mode; missing release date patched automatically). Requires template_file_info: every file must be mapped to its protein chain(s) explicitly.<br/>file suffix: `cif` |  |
| `template_file_info` | `array` | ✗ | REQUIRED with template_file: mapping '<temp_id>-<chain_ids>-<template_chain_ids>', e.g. 'temp1-P1,P2-A,B' (one-to-one) or 'temp1-P1-Auto' (automatic chain matching). 'temp<n>' = n-th uploaded template_file (1-based); template_chain_ids are chain IDs inside the CIF. The mapping is authoritative: chains not listed get no template and unreferenced files are ignored. |  |
| `rna` | `array` | ✗ | RNA chain sequences in one-letter RNA code (U for uracil), one entry per chain. |  |
| `dna` | `array` | ✗ | DNA chain sequences in one-letter DNA code (T for thymine), one entry per chain. |  |
| `ligand_smiles` | `array` | ✗ | Ligand SMILES strings, one per ligand. |  |
| `ligand_ccd` | `array` | ✗ | Ligand CCD codes (e.g. 'ATP'), one per ligand. |  |
| `modifications` | `array` | ✗ | Modified residues as '<ChainID>-<CCD>-<Position>', e.g. 'P1-SEP-15' = phosphoserine at residue 15 of protein chain 1. Chain names P<n>/R<n>/D<n> = n-th protein/RNA/DNA chain in input order. |  |
| `low_memory` | `boolean` | ✗ | OpenFold3 low-memory preset: slower, fits larger complexes into limited VRAM. |  |
| `num_diffusion_samples` | `number` | ✗ | Number of diffusion samples (predicted structures); the model seed is randomized per run by the backend. |  |

### 示例代码

#### Python

```python
import requests

BASE_URL = "https://sciminer.tech/console/api"
API_KEY = "<YOUR_API_KEY>"
endpoint = "/v1/internal/tools/invoke"

# If the invoked API includes FILE-type parameters, upload the file first to obtain a `file_id`,
# then fill the corresponding field in `parameters` with the returned `file_id`.
# File upload example (form-data, parameter name is `file`):

# files = {'file': open('path/to/your_file.ext', 'rb')}
# upload_url = f"{BASE_URL}/v1/internal/tools/file"
# resp_upload = requests.post(upload_url, files=files, headers={"X-Auth-Token": f"{API_KEY}"}, timeout=60)
# resp_upload.raise_for_status()
# file_id = resp_upload.json().get("file_id")
# print(f"File uploaded successfully, file_id: {file_id}")
# # Then set the `file_id` in the corresponding field of `payload['parameters']`, for example: payload['parameters']["your_file_param_name"] = file_id

headers = {
    "X-Auth-Token": f"{API_KEY}",
    "Content-Type": "application/json",
}

payload = {
    "provider_name": "OpenFold3",
    "tool_name": "predict_from_params_predict_from_params_post",
    "parameters": {
    "protein_MSA_method": "<PROTEIN_MSA_METHOD>",
    "protein_Template_method": "<PROTEIN_TEMPLATE_METHOD>",
    "protein": [],
    "msa_file": [
        "<FILE_ID1>",
        "<FILE_ID2>"
    ],
    "msa_file_info": [],
    "template_file": [
        "<FILE_ID1>",
        "<FILE_ID2>"
    ],
    "template_file_info": [],
    "rna": [],
    "dna": [],
    "ligand_smiles": [],
    "ligand_ccd": [],
    "modifications": [],
    "low_memory": false,
    "num_diffusion_samples": 5
},
    # The job name is an optional parameter.
    #"job_name": "xxx",
}

# Step 1: Submit the task.
# Call the /invoke endpoint to start the task and obtain a task_id.
print("1. Submitting task...")
resp_submit = requests.post(f"{BASE_URL}{endpoint}", json=payload, headers=headers, timeout=30)
resp_submit.raise_for_status()
task_id = resp_submit.json().get("task_id")
print(f"Task ID: {task_id}")

# Step 2: Poll for the result.
# Use the task_id obtained above to call the /result endpoint to check status and fetch the result.
# If this tool takes a long time, you can increase the max_retries parameter or after exceeding the maximum number of times, you can use the task_id to re-request.
status_url = f"https://sciminer.tech/console/api/v1/internal/tools/result"
max_retries = 300
status = "PENDING"
for i in range(max_retries):
    print(f"Polling status (attempt {i+1}/{max_retries})...")
    resp_status = requests.get(
        status_url,
        params={"task_id": task_id},
        headers=headers,
        timeout=10
    )
    resp_status.raise_for_status()
    
    result = resp_status.json()
    status = result.get("status")
    print(f"Status: {status}")
    
    if status == "SUCCESS":
        print("✅ Task completed successfully！")
        print(f"Result: {result.get('result')}")
        break
    elif status == "FAILURE":
        print(f"❌ Task failed: {result.get('result')}")
        break
    else:
        # Wait 2 seconds before retrying
        import time
        time.sleep(2)
else:
    print("⏱️  Maximum retry attempts reached. The task is still running.")
```


---

## 2. Batch Openfold3

**Tool Name:** `batch_openfold3_batch_openfold3_post`

**Method:** `POST`

### 参数

| 参数名 | 类型 | 必需 | 说明 | 枚举值 |
|--------|------|------|------|--------|
| `protein_MSA_method` | `select` | ✗ | MSA strategy for EVERY task: 'MMSeq2 Search' queries the public ColabFold server (MMseqs2 search, needs internet); 'No MSA' runs without MSAs. No MSA file uploads in batch mode. | `MMSeq2 Search`, `No MSA` |
| `protein_Template_method` | `select` | ✗ | Template strategy for EVERY task: 'MMSeq2 Search' retrieves PDB templates through the same ColabFold server query as the MSA search (requires protein_MSA_method='MMSeq2 Search'); 'No Template' runs without templates. No template file uploads in batch mode. | `MMSeq2 Search`, `No Template` |
| `batch_file` | `file` | ✓ | Batch JSON file: a list of tasks or {'tasks': [...]}. Per task: task_name (optional), protein/dna/rna (arrays), ligand_smiles, ligand_ccd, modifications ('<ChainID>-<CCD>-<Position>'). Limits: 50 tasks/file, 5 biomolecule chains and 10 ligands per task. No covalent bonds or MSA/template uploads in batch mode.<br/>file suffix: `json` |  |
| `num_diffusion_samples` | `number` | ✗ | Diffusion samples generated for EVERY task (total structures = tasks x samples); the model seed is randomized per batch by the backend. |  |
| `low_memory` | `boolean` | ✗ | OpenFold3 low-memory preset: slower, fits larger complexes into limited VRAM. |  |

### 示例代码

#### Python

```python
import requests

BASE_URL = "https://sciminer.tech/console/api"
API_KEY = "<YOUR_API_KEY>"
endpoint = "/v1/internal/tools/invoke"

# If the invoked API includes FILE-type parameters, upload the file first to obtain a `file_id`,
# then fill the corresponding field in `parameters` with the returned `file_id`.
# File upload example (form-data, parameter name is `file`):

# files = {'file': open('path/to/your_file.ext', 'rb')}
# upload_url = f"{BASE_URL}/v1/internal/tools/file"
# resp_upload = requests.post(upload_url, files=files, headers={"X-Auth-Token": f"{API_KEY}"}, timeout=60)
# resp_upload.raise_for_status()
# file_id = resp_upload.json().get("file_id")
# print(f"File uploaded successfully, file_id: {file_id}")
# # Then set the `file_id` in the corresponding field of `payload['parameters']`, for example: payload['parameters']["your_file_param_name"] = file_id

headers = {
    "X-Auth-Token": f"{API_KEY}",
    "Content-Type": "application/json",
}

payload = {
    "provider_name": "OpenFold3",
    "tool_name": "batch_openfold3_batch_openfold3_post",
    "parameters": {
    "protein_MSA_method": "<PROTEIN_MSA_METHOD>",
    "protein_Template_method": "<PROTEIN_TEMPLATE_METHOD>",
    "batch_file": "<BATCH_FILE_FILE_ID>",
    "num_diffusion_samples": 5,
    "low_memory": false
},
    # The job name is an optional parameter.
    #"job_name": "xxx",
}

# Step 1: Submit the task.
# Call the /invoke endpoint to start the task and obtain a task_id.
print("1. Submitting task...")
resp_submit = requests.post(f"{BASE_URL}{endpoint}", json=payload, headers=headers, timeout=30)
resp_submit.raise_for_status()
task_id = resp_submit.json().get("task_id")
print(f"Task ID: {task_id}")

# Step 2: Poll for the result.
# Use the task_id obtained above to call the /result endpoint to check status and fetch the result.
# If this tool takes a long time, you can increase the max_retries parameter or after exceeding the maximum number of times, you can use the task_id to re-request.
status_url = f"https://sciminer.tech/console/api/v1/internal/tools/result"
max_retries = 300
status = "PENDING"
for i in range(max_retries):
    print(f"Polling status (attempt {i+1}/{max_retries})...")
    resp_status = requests.get(
        status_url,
        params={"task_id": task_id},
        headers=headers,
        timeout=10
    )
    resp_status.raise_for_status()
    
    result = resp_status.json()
    status = result.get("status")
    print(f"Status: {status}")
    
    if status == "SUCCESS":
        print("✅ Task completed successfully！")
        print(f"Result: {result.get('result')}")
        break
    elif status == "FAILURE":
        print(f"❌ Task failed: {result.get('result')}")
        break
    else:
        # Wait 2 seconds before retrying
        import time
        time.sleep(2)
else:
    print("⏱️  Maximum retry attempts reached. The task is still running.")
```


---

## User Interface URL

> When the user needs a tool recommendation, output the URL.

**URL:** <https://sciminer.tech/utility/tool/OpenFold3>
