# Docking-Based Open Library Virtual Screen

A tiered virtual screening tool designed for commercial compound libraries and user-defined molecular datasets. Users can select a commercial compound library available on the platform or upload their own small-molecule files, with optional PAINS, RO3, and RO5 filters. The filtered compounds are first subjected to protein sequence-based screening using TransformerCPI. Based on the predicted scores, the top tCPI_topK candidates are selected for molecular docking with Gnina. The tool returns results from each stage, including TransformerCPI screening and Gnina docking, and further uses PLIP to identify key residues involved in compound–target interactions. 

## 基础信息

| 项目 | 值 |
|------|-----|
| 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. The built-in library covers multiple categories such as macrocycles, covalent compounds, drug‑like compounds, fragments, and others.

**Tool Name:** `virtual_screening_smart_dock_by_category_post`

**Method:** `POST`

### 参数

| 参数名 | 类型 | 必需 | 说明 | 枚举值 |
|--------|------|------|------|--------|
| `library` | `select` | ✗ | Select a compound library. | `Bioactive Library (1.9W)`, `Covalent Library (11W)`, `Drug-like Library (1156W)`, `Fragment Library (15K)`, `Macrocycle Library (3K)`, `Molecular Glue Library (13K)`, `Natural Product Library (30K)`, `Peptidomimetic Library (44K)`, `PROTAC Library (215W)` |
| `filter_rules` | `select_array` | ✗ | Set basic filtering rules before screening | `PAINS`, `Ro5`, `Ro3` |
| `Interaction_type` | `select` | ✗ | Select the type of key interaction | `None`, `Hydrophobic`, `HydrogenBond`, `WeakHydrogenBond`, `IonicInteraction`, `PiStacking`, `Cation-PiInteractions`, `HalogenBond`, `MetalCoordination` |
| `receptor_file` | `file` | ✓ |  Remove the original small molecules from the binding pocket, while retaining those required for docking.<br/>file suffix: `pdb` |  |
| `reference_ligand` | `file` | ✗ | Either reference_ligand or docking_box can be provided alone. If both are supplied, the docking will be based on the reference_ligand.<br/>file suffix: `sdf`, `pdb` |  |
| `custom_file` | `file` | ✗ | Custom candidate molecular file<br/>file suffix: `sdf`, `csv` |  |
| `docking_box` | `string` | ✗ | Either reference_ligand or docking_box can be provided alone. If both are supplied, the docking will be based on the reference_ligand. 
 Input format eg: Center:-2.96,-28.05,-2.75;Size:20,20,20 |  |
| `num_modes` | `number` | ✓ | The number of docking poses. N <= 10 |  |
| `Interaction_residue` | `string` | ✗ | Specify key specific residues. For example: A:1600,1601-1604 |  |
| `tCPI_topK` | `number` | ✗ | Select the top K compounds ranked by TransformerCPI for Gnina docking (K ≤ 20,000).  |  |
| `target_chain` | `string` | ✓ | The target chain bound by small molecules |  |

### 示例代码

#### 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": "Docking-Based Open Library Virtual Screen",
    "tool_name": "virtual_screening_smart_dock_by_category_post",
    "parameters": {
    "library": "<LIBRARY>",
    "filter_rules": [
        "OPTION VALUE1",
        "OPTION VALUE2"
    ],
    "Interaction_type": "<INTERACTION_TYPE>",
    "receptor_file": "<RECEPTOR_FILE_FILE_ID>",
    "reference_ligand": "<REFERENCE_LIGAND_FILE_ID>",
    "custom_file": "<CUSTOM_FILE_FILE_ID>",
    "docking_box": "<DOCKING_BOX>",
    "num_modes": 1,
    "Interaction_residue": "<INTERACTION_RESIDUE>",
    "tCPI_topK": 500,
    "target_chain": "<TARGET_CHAIN>"
},
    # 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. The built-in libraries are mainly sourced from the Enamine series, Life Chemicals, and the Chemdiv series.

**Tool Name:** `virtual_screening_smart_dock_post`

**Method:** `POST`

### 参数

| 参数名 | 类型 | 必需 | 说明 | 枚举值 |
|--------|------|------|------|--------|
| `library` | `select` | ✗ | A preset library of business molecules | `Enamine_Bioreference_Compound_Library (3K)`, `Enamine_FDA_approved_Drugs (2K)`, `Enamine_Phenotypic_Screening_Library (6K)`, `LC_Bioactive_Compound_Library (2W)`, `Chemdiv_Covalent_Cysteine_Library (4W)`, `Chemdiv_Covalent_Inhibitors_Generic (9K)`, `Chemdiv_Covalent_serine_binders_library (5K)`, `Enamine_Covalent_Screening_Library (2W)`, `LC_Covalent_Screening_Library (5W)`, `Chemdiv_adme (4W)`, `Chemdiv_BMS_300K (30W)`, `Chemdiv_Representative_Diversity_set (24W)`, `Enamine_Discovery_Diversity_Set (6W)`, `Enamine_Hit_Locator_Library (46W)`, `LC_Stock_HTS_Compounds (58W)`, `Chemdiv_Fragments_Library (2W)`, `Enamine_3D-Shape_Diverse_Fragment_Library (2K)`, `Enamine_Essential_Fragment_Library (320)`, `Enamine_High_Fidelity_Fragment_Library (2K)`, `Chemdiv_Macrocycles_Library (3K)`, `Enamine_Macrocycles_Library (500)`, `Chemdiv_IMiD_lib (2K)`, `Enamine_CRBN_Molecular_Glue_Library (5K)`, `Enamine_DCAF_Library (6K)`, `Enamine_Diverse_CRBN_Library (960)`, `Enamine_PhenylAmino_Glutarimide_scaffold-based_Library (640)`, `Chemdiv_Natural_Product_Based_Library (2W)`, `LC_Natural_Product_like_Compounds_Library (2W)`, `Chemdiv_Peptidomimetics_Library (4W)`, `LC_Peptidomimetic_Compound_Library (8K)`, `Enamine_Active_Degraders_Stock (77)`, `Enamine_IMiD_Library (5K)`, `Enamine_REAL_VHL (214W)` |
| `filter_rules` | `select_array` | ✗ | Set basic filtering rules before screening | `PAINS`, `Ro5`, `Ro3` |
| `Interaction_type` | `select` | ✗ | Select the type of key interaction | `None`, `Hydrophobic`, `HydrogenBond`, `WeakHydrogenBond`, `IonicInteraction`, `PiStacking`, `Cation-PiInteractions`, `HalogenBond`, `MetalCoordination` |
| `receptor_file` | `file` | ✓ |  Remove the original small molecules from the binding pocket, while retaining those required for docking.<br/>file suffix: `pdb` |  |
| `reference_ligand` | `file` | ✗ | Either reference_ligand or docking_box can be provided alone. If both are supplied, the docking will be based on the reference_ligand.<br/>file suffix: `sdf`, `pdb` |  |
| `custom_file` | `file` | ✗ | Custom candidate molecular files<br/>file suffix: `sdf`, `csv` |  |
| `docking_box` | `string` | ✗ | Either reference_ligand or docking_box can be provided alone. If both are supplied, the docking will be based on the reference_ligand. 
 Input format eg: Center:-2.96,-28.05,-2.75;Size:20,20,20 |  |
| `num_modes` | `number` | ✓ | The number of docking poses. N <=10 |  |
| `Interaction_residue` | `string` | ✗ | Specify key specific residues. For example: A:1600,1601-1604 |  |
| `tCPI_topK` | `number` | ✗ | Select the top K compounds ranked by TransformerCPI for Gnina docking (K ≤ 20,000).  |  |
| `target_chain` | `string` | ✓ | The target chain bound by small molecules |  |

### 示例代码

#### 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": "Docking-Based Open Library Virtual Screen",
    "tool_name": "virtual_screening_smart_dock_post",
    "parameters": {
    "library": "<LIBRARY>",
    "filter_rules": [
        "OPTION VALUE1",
        "OPTION VALUE2"
    ],
    "Interaction_type": "<INTERACTION_TYPE>",
    "receptor_file": "<RECEPTOR_FILE_FILE_ID>",
    "reference_ligand": "<REFERENCE_LIGAND_FILE_ID>",
    "custom_file": "<CUSTOM_FILE_FILE_ID>",
    "docking_box": "<DOCKING_BOX>",
    "num_modes": 1,
    "Interaction_residue": "<INTERACTION_RESIDUE>",
    "tCPI_topK": 500,
    "target_chain": "<TARGET_CHAIN>"
},
    # 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/Docking-Based-Open-Library-Virtual-Screen>
