# Protenix-v1

Protein/RNA/DNA complex structure prediction powered by Protenix. Supports protein, DNA, RNA chains, ligand docking (SMILES/CCD/file), ions, post-translational modifications, covalent bonds, and contact/pocket constraints. Covalent docking is enabled by filling 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. Get Protenix Info

**Tool Name:** `get_protenix_info_get_protenix_info_post`

**Method:** `POST`

### 参数

| 参数名 | 类型 | 必需 | 说明 | 枚举值 |
|--------|------|------|------|--------|
| `protein_MSA_method` | `select` | ✗ | Protein MSA search method | `No MSA`, `Upload File`, `MMSeq2` |
| `protein_template_method` | `select` | ✗ | Protein template search method | `No Template`, `Upload File`, `Hmmer` |
| `rna_MSA_method` | `select` | ✗ | RNA MSA search method | `No MSA`, `Upload File`, `MMSeq2` |
| `protein` | `array` | ✗ | Protein amino acid sequences. Entity IDs: P1, P2, P3... by array order. |  |
| `dna` | `array` | ✗ | DNA nucleotide sequences. Entity IDs: D1, D2, D3... by array order. |  |
| `rna` | `array` | ✗ | RNA nucleotide sequences. Entity IDs: R1, R2, R3... by array order. |  |
| `modifications` | `array` | ✗ | Post-translational modifications for sequences. Format: EntityID-ModificationType-Position, separated by '-'. EntityID: P1/P2... for protein, D1/D2... for DNA, R1/R2... for RNA (index starts from 1). ModificationType uses CCD code (e.g., SMC, M1G, 6MA). Position is 1-based residue/base index. e.g., ["P1-SMC-13", "R1-M1G-5", "D1-6MA-3"] |  |
| `protein_unpaired_MSA_file` | `file` | ✗ | Unpaired MSA file for proteins (.a3m). When protein_MSA_method is 'Upload File', BOTH this file and protein_paired_MSA_file must be uploaded together.<br/>file suffix: `a3m` |  |
| `protein_paired_MSA_file` | `file` | ✗ | Paired MSA file for proteins (.a3m). When protein_MSA_method is 'Upload File', BOTH this file and protein_unpaired_MSA_file must be uploaded together.<br/>file suffix: `a3m` |  |
| `protein_template_file` | `file` | ✗ | Protein template structure file (.a3m/.hhr). Required when protein_template_method is 'Upload File'.<br/>file suffix: `a3m`, `hhr` |  |
| `rna_unpaired_MSA_file` | `file` | ✗ | Unpaired MSA file for RNA (.a3m). Required when rna_MSA_method is 'Upload File'.<br/>file suffix: `a3m` |  |
| `ligand_smiles` | `array` | ✗ | Ligand molecules in SMILES format. Entity IDs (L1, L2...) are shared across ligand_smiles, ligand_ccd, ligand_file in order. A '.select(AtomName)' suffix (added by the frontend atom picker) is stripped before inference; the covalent bond itself must still be fully defined in covalent_bonds (6 fields). |  |
| `ligand_ccd` | `array` | ✗ | Ligand molecules in CCD code (plain code only, e.g., 'P4G'). Entity IDs shared with ligand_smiles and ligand_file. The covalent-bond atom is NOT marked here; define it in covalent_bonds (6-field format) instead. |  |
| `ligand_file` | `file_array` | ✗ | Ligand molecule files. Entity IDs shared with ligand_smiles and ligand_ccd. Supported formats: SDF, PDB, MOL, MOL2. SDF files with multiple molecules are split automatically.<br/>file suffix: `sdf`, `pdb`, `mol`, `mol2` |  |
| `ion_ccd` | `array` | ✗ | Ion molecules in CCD code. Entity IDs: I1, I2, I3... by array order. |  |
| `covalent_bonds` | `array` | ✗ | Covalent bonds (polymer-ligand or ligand-ligand). Format: Entity1-Pos1-Atom1-Entity2-Pos2-Atom2. Entity: P1 (protein), L1 (ligand), D1 (DNA), R1 (RNA), I1 (ion). Pos: 1-based residue index, 1 for ligands. Atom: CCD atom name (e.g. SG) for polymers/CCD ligands; for SMILES/FILE ligands use 'C3' (element + occurrence, 1-based per element) or 0-based atom index. e.g., protein-ligand via occurrence name ["P1-13-SG-L1-1-C3"], via atom index ["P1-13-SG-L1-1-2"], ligand-ligand ["L1-1-C1-L2-1-N1"] |  |
| `pocket_restraints` | `array` | ✗ | Pocket constraints for targeted docking. Format: Binder-ContactEntity-ResIdx-MaxDist. Binder: entity to dock (e.g., L1). Contact: receptor entity (e.g., P1). ResIdx: 1-based position. One entry per pocket residue; all entries must share the same binder and MaxDist (in Angstroms). e.g., a 3-residue pocket on P1 for ligand L1: ["L1-P1-126-6.0", "L1-P1-128-6.0", "L1-P1-130-6.0"] |  |
| `contact_restraints` | `array` | ✗ | Contact restraints between entities. Format: Entity1-ResIdx1-Atom1-Entity2-ResIdx2-Atom2-MinDist-MaxDist. Atom: '.' (or 'none') for token-level, or an atom name for atom-level — CCD name (e.g. CA) for polymers/CCD ligands, 'C3' (element + occurrence) or 0-based index for SMILES/FILE ligands; the two sides are chosen independently. e.g., atom-level ["P1-387-CA-L1-1-C3-0.0-6.0"], token-level ["P1-387-.-L1-1-.-0.0-6.0"], mixed ["P1-387-CA-L1-1-.-0.0-6.0"] |  |
| `diffusion_samples` | `number` | ✗ | Number of diffusion samples to generate. More samples yield more candidate structures but take longer. Default: 5. |  |

### 示例代码

#### 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": "Protenix-v1",
    "tool_name": "get_protenix_info_get_protenix_info_post",
    "parameters": {
    "protein_MSA_method": "<PROTEIN_MSA_METHOD>",
    "protein_template_method": "<PROTEIN_TEMPLATE_METHOD>",
    "rna_MSA_method": "<RNA_MSA_METHOD>",
    "protein": [],
    "dna": [],
    "rna": [],
    "modifications": [],
    "protein_unpaired_MSA_file": "<PROTEIN_UNPAIRED_MSA_FILE_FILE_ID>",
    "protein_paired_MSA_file": "<PROTEIN_PAIRED_MSA_FILE_FILE_ID>",
    "protein_template_file": "<PROTEIN_TEMPLATE_FILE_FILE_ID>",
    "rna_unpaired_MSA_file": "<RNA_UNPAIRED_MSA_FILE_FILE_ID>",
    "ligand_smiles": [],
    "ligand_ccd": [],
    "ligand_file": [
        "<FILE_ID1>",
        "<FILE_ID2>"
    ],
    "ion_ccd": [],
    "covalent_bonds": [],
    "pocket_restraints": [],
    "contact_restraints": [],
    "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 version of /get_protenix_info: predicts structures for multiple folding tasks from one JSON array in a single GPU job. MSA / template / sampling settings are global for all tasks. See examples/batch_example.json.

**Tool Name:** `get_protenix_info_from_batch_get_protenix_info_from_batch_post`

**Method:** `POST`

### 参数

| 参数名 | 类型 | 必需 | 说明 | 枚举值 |
|--------|------|------|------|--------|
| `protein_MSA_method` | `select` | ✗ | Protein MSA method, applied to all tasks. Options: 'No MSA' (default) / 'MMSeq2'. | `No MSA`, `MMSeq2` |
| `protein_template_method` | `select` | ✗ | Protein template method, applied to all tasks. Options: 'No Template' (default) / 'Hmmer'. | `No Template`, `Hmmer` |
| `rna_MSA_method` | `select` | ✗ | RNA MSA method, applied to all tasks. Options: 'No MSA' (default) / 'MMSeq2'. | `No MSA`, `MMSeq2` |
| `batch_json_file` | `file` | ✓ | Batch task list JSON: a non-empty array of task objects (see examples/batch_example.json). Per-task keys use the same formats as the corresponding parameters of /get_protenix_info (e.g. 'covalent_bonds' ↔ covalent_bonds); file uploads (ligand_file / MSA / template) are not supported. |  |
| `diffusion_samples` | `number` | ✗ | Diffusion samples per task. Default: 5, range 1-1000. |  |

### 示例代码

#### 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": "Protenix-v1",
    "tool_name": "get_protenix_info_from_batch_get_protenix_info_from_batch_post",
    "parameters": {
    "protein_MSA_method": "<PROTEIN_MSA_METHOD>",
    "protein_template_method": "<PROTEIN_TEMPLATE_METHOD>",
    "rna_MSA_method": "<RNA_MSA_METHOD>",
    "batch_json_file": "<BATCH_JSON_FILE_FILE_ID>",
    "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/Protenix-v1>
