# Mol-1

Mol-1: all-atom biomolecular structure prediction (proteins, DNA, RNA, ligands, ions and covalent bonds).

## 基础信息

| 项目 | 值 |
|------|-----|
| 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 all-atom structures of proteins, nucleic acids and ligand complexes. Enter each chain separately; P1/P2, R1/R2, D1/D2, L1/L2 and I1/I2 IDs follow input order within each type. Ligand order is SMILES, files, then CCD. Task names, input files and random seeds are managed by the server. For a single eligible chain, uploaded MSA/template filenames are unrestricted; for multiple chains, name files P1.a3m, R1.a3m, P1.hhr, etc.

**Tool Name:** `predict_biomolecular_structure`

**Method:** `POST`

### 参数

| 参数名 | 类型 | 必需 | 说明 | 枚举值 |
|--------|------|------|------|--------|
| `msa_method` | `select` | ✗ | Protein MSA method: none (no protein MSA), mmseqs2 (MMseqs2 search via the ColabFold online service), or file (upload precomputed .a3m files). Default: mmseqs2. RNA MSA uploads are handled separately; MMseqs2 is used for proteins only. | `none`, `mmseqs2`, `file` |
| `template_method` | `select` | ✗ | Protein template method: none (no templates), hmmsearch (HMMER hmmsearch against the local PDB SEQRES database), or file (upload precomputed template hits). Default: none. | `none`, `hmmsearch`, `file` |
| `protein` | `array` | ✗ | Protein amino-acid sequences, one per chain; IDs P1, P2, ... . Repeat a sequence to model multiple copies. Spaces/newlines within a sequence are removed. |  |
| `rna` | `array` | ✗ | RNA sequences, one per chain; IDs R1, R2, ... . |  |
| `dna` | `array` | ✗ | Single-stranded DNA sequences, one per chain; IDs D1, D2, ... . For double-stranded DNA, enter both strands separately. |  |
| `ligand_smiles` | `array` | ✗ | Ligand SMILES strings, one per ligand. Ligand IDs L1, L2, ... follow SMILES, uploaded ligand files, then CCD codes. |  |
| `ligand_ccd` | `array` | ✗ | Ligand CCD codes, e.g. ATP or CCD_ATP; one per ligand. IDs continue after SMILES and uploaded ligand files. |  |
| `ligand_files` | `file_array` | ✗ | Ligand structure files with 3D coordinates, one per ligand (sdf, mol, mol2, pdb). IDs continue after SMILES ligands.<br/>file suffix: `sdf`, `mol`, `mol2`, `pdb` |  |
| `ion` | `array` | ✗ | Ion CCD codes, e.g. MG, ZN, NA; IDs I1, I2, ... . Repeat an entry for multiple ions. |  |
| `modifications` | `array` | ✗ | Residue modifications as ChainID-CCD-Position, e.g. P1-SEP-15 or R1-2MG-1; positions start at 1. |  |
| `covalent_bonds` | `array` | ✗ | Bonds as ChainA-ResIdx-Atom-ChainB-ResIdx-Atom, e.g. P1-13-SG-L1-1-C1. Residue indices start at 1; a single-component ligand uses residue 1. |  |
| `msa_files` | `file_array` | ✗ | Protein/RNA MSAs (.a3m). Single eligible chain: any filename. Multiple chains: P1.a3m, P2.a3m, R1.a3m. For paired protein MSAs use P1_paired.a3m. Uploading an RNA MSA enables RNA MSAs automatically.<br/>file suffix: `a3m` |  |
| `template_files` | `file_array` | ✗ | Template hits (.a3m/.hhr) or Mol-1 template JSON. Single protein: any filename. Multiple proteins: P1.hhr, P2.hhr, etc. Raw PDB/CIF templates require conversion first.<br/>file suffix: `a3m`, `hhr`, `json` |  |
| `diffusion_samples` | `number` | ✗ | Number of predicted structures to generate (1-1000, default: 5), ranked by confidence. Runtime scales linearly with this value. Random seeds are handled automatically. |  |

### 示例代码

#### 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": "Mol-1",
    "tool_name": "predict_biomolecular_structure",
    "parameters": {
    "msa_method": "<MSA_METHOD>",
    "template_method": "<TEMPLATE_METHOD>",
    "protein": [],
    "rna": [],
    "dna": [],
    "ligand_smiles": [],
    "ligand_ccd": [],
    "ligand_files": [
        "<FILE_ID1>",
        "<FILE_ID2>"
    ],
    "ion": [],
    "modifications": [],
    "covalent_bonds": [],
    "msa_files": [
        "<FILE_ID1>",
        "<FILE_ID2>"
    ],
    "template_files": [
        "<FILE_ID1>",
        "<FILE_ID2>"
    ],
    "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.")
```


---

## User Interface URL

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

**URL:** <https://sciminer.tech/utility/tool/Mol-1>
