# Boltzina

Virtual screening of small molecules through docking and binding-affinity prediction.

## 基础信息

| 项目 | 值 |
|------|-----|
| 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 Gpu

**Tool Name:** `predict_gpu_predict_gpu_post`

**Method:** `POST`

### 参数

| 参数名 | 类型 | 必需 | 说明 | 枚举值 |
|--------|------|------|------|--------|
| `protein` | `array` | ✗ | Protein amino acid sequences, one per chain. Chains are auto-numbered P1, P2, ... in input order; modifications reference them by these IDs. Repeat this multipart field for multiple chains, or supply a JSON array of strings; colon-separated strings remain accepted. All chains form one receptor complex together with the optional dna/rna chains — not independent screening targets. Provide the target either via these chain lists or via protein_file. |  |
| `dna` | `array` | ✗ | DNA sequences, one per chain; chains are auto-numbered D1, D2, ... in input order. Optional; combined with the protein chains into the same receptor complex. At least one protein chain is required. |  |
| `rna` | `array` | ✗ | RNA sequences, one per chain; chains are auto-numbered R1, R2, ... in input order (use U, not T). Optional; combined with the protein chains into the same receptor complex. At least one protein chain is required. |  |
| `modifications` | `array` | ✗ | Residue modifications as '<ChainID>-<CCD>-<Position>' (1-based position), e.g. 'P1-SEP-15' = phosphoserine at residue 15 of protein chain P1, 'D1-6OG-3' = 8-oxo-guanine at DNA residue 3. Repeat the field or supply a JSON array. Chain IDs are the auto-numbered P#/D#/R# names assigned to the chain lists above. |  |
| `protein_file` | `file` | ✗ | Receptor complex as a single file instead of the chain lists: FASTA (.fa/.fasta, one protein chain per >header entry) or a pre-written Boltz-2 YAML (.yaml/.yml, defining all chains, the reference ligand and an affinity.binder entry under properties). The filename extension determines the format. DNA/RNA chains and residue modifications require either the chain lists or a Boltz YAML upload; they cannot be combined with a FASTA upload. A Boltz YAML that defines SMILES ligand entries may serve as the screening library itself — then ligand_file/ligand_smiles can be omitted. At least one ligand is always required: this tool is a virtual screening pipeline (pocket prediction -> docking -> pose scoring), not protein-only structure prediction; use the Boltz-2 structure prediction tool for protein-only runs.<br/>file suffix: `fa`, `fasta`, `yaml`, `yml` |  |
| `ligand_file` | `file` | ✗ | Ligand library for screening: .smi/.txt with one SMILES and an optional name per line (# comments are supported), or a multi-molecule .sdf file. Missing SMILES names are generated automatically; supplied names must be unique. Provide one of ligand_file / ligand_smiles, or upload a Boltz YAML that defines SMILES ligand entries. At least one ligand is required — protein-only structure prediction is not supported by this tool.<br/>file suffix: `smi`, `sdf`, `txt` |  |
| `ligand_smiles` | `string` | ✗ | Draw a molecule or paste one SMILES per line, optionally followed by a name. Missing names are generated automatically as ligand_1, ligand_2, etc., without colliding with supplied names. Provide one of ligand_smiles / ligand_file, or upload a Boltz YAML that defines SMILES ligand entries. At least one ligand is required — protein-only structure prediction is not supported by this tool. |  |
| `affinity_ligands` | `array` | ✗ | Molecules to dock and affinity-score, given by name or positionally. By name: repeat this field or supply a JSON array, e.g. ["roscovitine", "olomoucine"]; names must match SMILES names, generated ligand_N names or SDF molecule titles (unnamed SDF molecules use the sanitized filename stem followed by their zero-based record index). By position: L1, L2, ... reference the 1st, 2nd, ... library molecule in input order; an explicit molecule name that happens to equal an L# token wins over the positional reference. Omit or use an empty list to screen all molecules. Input order is preserved. The first selected molecule becomes the reference ligand (affinity binder) of the predicted complex, except for a Boltz YAML upload whose affinity.binder wins. Unselected library molecules are not docked or scored. |  |
| `diffusion_samples` | `number` | ✗ | Number of initial Boltz-2 complex structure samples. Defaults to 1; allowed range: 1-20. Higher values increase prediction time and may increase points. This is not the number of library ligands or docked poses. |  |
| `use_msa_server` | `boolean` | ✗ | Allow the online MMseqs2 service to retrieve a multiple sequence alignment (MSA). Defaults to false. Enabling this requires internet access and increases points and estimated runtime. Explicit msa entries in YAML, such as empty, are still respected. |  |
| `pocket_info` | `string` | ✗ | Docking region selected with the SciMiner pocket picker. The plugin returns 'center:x,y,z;size:x,y,z' in Angstroms; each side length must be between 10.0 and 40.0 inclusive. The current CLI uses the largest side length to build a cubic box. The selected structure must share the predicted receptor's coordinate frame. If omitted, the center is derived from the predicted reference ligand with a box side length of 20.0 Angstroms. |  |

### 示例代码

#### 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": "Boltzina",
    "tool_name": "predict_gpu_predict_gpu_post",
    "parameters": {
    "protein": [],
    "dna": [],
    "rna": [],
    "modifications": [],
    "protein_file": "<PROTEIN_FILE_FILE_ID>",
    "ligand_file": "<LIGAND_FILE_FILE_ID>",
    "ligand_smiles": "<LIGAND_SMILES>",
    "affinity_ligands": [],
    "diffusion_samples": 1,
    "use_msa_server": false,
    "pocket_info": "<POCKET_INFO>"
},
    # 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/Boltzina>
