# BioPhi

BioPhi is an open-source antibody design platform. It features methods for automated antibody humanization (Sapiens), humanness evaluation (OASis) and an interface for computer-assisted antibody sequence design.

## 基础信息

| 项目 | 值 |
|------|-----|
| 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. Antibody humanness evaluation using 9-mer peptide search.

**Tool Name:** `humanness_report_humanness_report__post`

**Method:** `POST`

### 参数

| 参数名 | 类型 | 必需 | 说明 | 枚举值 |
|--------|------|------|------|--------|
| `scheme` | `select` | ✗ | ANARCI numbering scheme used to align the sequence and annotate position numbers (options: kabat, chothia, imgt, aho; default: kabat) | `kabat`, `chothia`, `imgt`, `aho` |
| `cdr_definition` | `select` | ✗ | Scheme used to define the CDR regions (options: kabat, chothia, imgt, north; default: kabat) | `kabat`, `chothia`, `imgt`, `north` |
| `heavy_chain` | `string` | ✓ | Heavy chain amino acid sequence (single antibody) |  |
| `light_chain` | `string` | ✗ | Light chain amino acid sequence (single antibody) |  |
| `min_subjects_percent` | `number` | ✗ | OASis prevalence threshold as percent of subjects. OASis identity score is calculated as the fraction of 9-mer peptides considered human. This threshold determines what fraction of human subjects from OAS database should contain a peptide for it to be considered human. The higher the threshold, the stricter the evaluation (range: 1.0 <= value < 100.0, default: 10.0) |  |

### 示例代码

#### 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": "BioPhi",
    "tool_name": "humanness_report_humanness_report__post",
    "parameters": {
    "scheme": "<SCHEME>",
    "cdr_definition": "<CDR_DEFINITION>",
    "heavy_chain": "<HEAVY_CHAIN>",
    "light_chain": "<LIGHT_CHAIN>",
    "min_subjects_percent": 10
},
    # 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. Antibody humanization using deep learning or CDR grafting.

**Tool Name:** `humanize_humanize__post`

**Method:** `POST`

### 参数

| 参数名 | 类型 | 必需 | 说明 | 枚举值 |
|--------|------|------|------|--------|
| `method` | `select` | ✗ | Humanization method. Sapiens: deep learning on antibody repertoires from >500 human subjects. CDR Grafting: graft CDR regions into nearest human V and J gene sequences based on % identity (options: sapiens, cdr_grafting, manual; default: sapiens) | `sapiens`, `cdr_grafting` |
| `scheme` | `select` | ✗ | ANARCI numbering scheme used to align the sequence and annotate position numbers (options: kabat, chothia, imgt, aho; default: kabat) | `kabat`, `chothia`, `imgt`, `aho` |
| `cdr_definition` | `select` | ✗ | Scheme used to define the CDR regions. Given regions are not humanized, the parental sequence is preserved. Use 'kabat_vernier' to enable backmutation of vernier zone (options: kabat, kabat_vernier, chothia, imgt, north; default: kabat) | `kabat`, `kabat_vernier`, `chothia`, `imgt`, `north` |
| `heavy_v_germline` | `select` | ✗ | Heavy chain V germline gene for CDR grafting method. Use 'auto' to pick nearest germline based on sequence homology, or select a specific germline gene from the available options (default: auto). Only used when method='cdr_grafting' | `auto`, `IGHV1`, `IGHV1-18`, `IGHV1-2`, `IGHV1-24`, `IGHV1-3`, `IGHV1-38-4`, `IGHV1-45`, `IGHV1-46`, `IGHV1-58`, `IGHV1-68`, `IGHV1-69`, `IGHV1-69-2`, `IGHV1-69D`, `IGHV1-8`, `IGHV1-NL1`, `IGHV2`, `IGHV2-10`, `IGHV2-26`, `IGHV2-5`, `IGHV2-70`, `IGHV2-70D`, `IGHV3`, `IGHV3-11`, `IGHV3-13`, `IGHV3-15`, `IGHV3-16`, `IGHV3-19`, `IGHV3-20`, `IGHV3-21`, `IGHV3-22`, `IGHV3-23`, `IGHV3-23D`, `IGHV3-25`, `IGHV3-29`, `IGHV3-30`, `IGHV3-30-2`, `IGHV3-30-22`, `IGHV3-30-3`, `IGHV3-30-33`, `IGHV3-30-42`, `IGHV3-30-5`, `IGHV3-30-52`, `IGHV3-32`, `IGHV3-33`, `IGHV3-33-2`, `IGHV3-35`, `IGHV3-38`, `IGHV3-38-3`, `IGHV3-41`, `IGHV3-43`, `IGHV3-43D`, `IGHV3-47`, `IGHV3-48`, `IGHV3-49`, `IGHV3-52`, `IGHV3-53`, `IGHV3-54`, `IGHV3-62`, `IGHV3-63`, `IGHV3-64`, `IGHV3-64D`, `IGHV3-66`, `IGHV3-69-1`, `IGHV3-7`, `IGHV3-71`, `IGHV3-72`, `IGHV3-73`, `IGHV3-74`, `IGHV3-9`, `IGHV3-NL1`, `IGHV4`, `IGHV4-28`, `IGHV4-30-2`, `IGHV4-30-4`, `IGHV4-31`, `IGHV4-34`, `IGHV4-38-2`, `IGHV4-39`, `IGHV4-4`, `IGHV4-55`, `IGHV4-59`, `IGHV4-61`, `IGHV5`, `IGHV5-10-1`, `IGHV5-51`, `IGHV5-78`, `IGHV6`, `IGHV6-1`, `IGHV7`, `IGHV7-34-1`, `IGHV7-4-1`, `IGHV7-40`, `IGHV7-81`, `IGHV8`, `IGHV8-51-1` |
| `light_v_germline` | `select` | ✗ | Light chain V germline gene for CDR grafting method. Use 'auto' to pick nearest germline based on sequence homology, or select a specific germline gene from the available options (default: auto). Only used when method='cdr_grafting' | `auto`, `IGKV`, `IGKV1`, `IGKV1-12`, `IGKV1-13`, `IGKV1-16`, `IGKV1-17`, `IGKV1-27`, `IGKV1-33`, `IGKV1-37`, `IGKV1-39`, `IGKV1-5`, `IGKV1-6`, `IGKV1-8`, `IGKV1-9`, `IGKV1-NL1`, `IGKV1D`, `IGKV1D-12`, `IGKV1D-13`, `IGKV1D-16`, `IGKV1D-17`, `IGKV1D-33`, `IGKV1D-37`, `IGKV1D-39`, `IGKV1D-42`, `IGKV1D-43`, `IGKV1D-8`, `IGKV2`, `IGKV2-18`, `IGKV2-24`, `IGKV2-28`, `IGKV2-29`, `IGKV2-30`, `IGKV2-4`, `IGKV2-40`, `IGKV2D`, `IGKV2D-18`, `IGKV2D-24`, `IGKV2D-26`, `IGKV2D-28`, `IGKV2D-29`, `IGKV2D-30`, `IGKV2D-40`, `IGKV3`, `IGKV3-11`, `IGKV3-15`, `IGKV3-20`, `IGKV3-7`, `IGKV3D`, `IGKV3D-11`, `IGKV3D-15`, `IGKV3D-20`, `IGKV3D-7`, `IGKV4`, `IGKV4-1`, `IGKV5`, `IGKV5-2`, `IGKV6`, `IGKV6-21`, `IGKV6D`, `IGKV6D-21`, `IGKV6D-41`, `IGKV7`, `IGKV7-3`, `IGLV`, `IGLV1`, `IGLV1-36`, `IGLV1-40`, `IGLV1-41`, `IGLV1-44`, `IGLV1-47`, `IGLV1-50`, `IGLV1-51`, `IGLV1-62`, `IGLV10`, `IGLV10-54`, `IGLV11`, `IGLV11-55`, `IGLV2`, `IGLV2-11`, `IGLV2-14`, `IGLV2-18`, `IGLV2-23`, `IGLV2-33`, `IGLV2-34`, `IGLV2-5`, `IGLV2-8`, `IGLV3`, `IGLV3-1`, `IGLV3-10`, `IGLV3-12`, `IGLV3-13`, `IGLV3-16`, `IGLV3-19`, `IGLV3-21`, `IGLV3-22`, `IGLV3-25`, `IGLV3-27`, `IGLV3-31`, `IGLV3-32`, `IGLV3-9`, `IGLV4`, `IGLV4-3`, `IGLV4-60`, `IGLV4-69`, `IGLV5`, `IGLV5-37`, `IGLV5-39`, `IGLV5-45`, `IGLV5-48`, `IGLV5-52`, `IGLV6`, `IGLV6-57`, `IGLV7`, `IGLV7-43`, `IGLV7-46`, `IGLV8`, `IGLV8-61`, `IGLV9`, `IGLV9-49` |
| `heavy_chain` | `string` | ✓ | Heavy chain amino acid sequence (single antibody) |  |
| `light_chain` | `string` | ✗ | Light chain amino acid sequence (single antibody). Optional — omit for heavy-chain-only / NanoBody inputs. |  |
| `iterations` | `number` | ✗ | Number of Sapiens iterations. Can be repeated multiple times to produce a more human sequence (range: 1-5, default: 1). Only used when method='sapiens' |  |
| `humanize_cdrs` | `boolean` | ✗ | Whether to design (humanize) the CDR regions. By default (false) the CDR regions are preserved from the parental sequence; set to true to let Sapiens also redesign CDR residues. Only used when method='sapiens' |  |
| `min_subjects_percent` | `number` | ✗ | OASis prevalence threshold as percent of subjects. OASis identity score is calculated as the fraction of 9-mer peptides considered human. This threshold determines what fraction of human subjects from OAS database should contain a peptide for it to be considered human. The higher the threshold, the stricter the evaluation (range: 1.0 <= value < 100.0, default: 10.0). Only used when method='sapiens' |  |

### 示例代码

#### 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": "BioPhi",
    "tool_name": "humanize_humanize__post",
    "parameters": {
    "method": "<METHOD>",
    "scheme": "<SCHEME>",
    "cdr_definition": "<CDR_DEFINITION>",
    "heavy_v_germline": "<HEAVY_V_GERMLINE>",
    "light_v_germline": "<LIGHT_V_GERMLINE>",
    "heavy_chain": "<HEAVY_CHAIN>",
    "light_chain": "<LIGHT_CHAIN>",
    "iterations": 1,
    "humanize_cdrs": false,
    "min_subjects_percent": 10
},
    # 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.")
```


---

## 3. Antibody designer with OASis evaluation and optional point mutations.

**Tool Name:** `design_design__post`

**Method:** `POST`

### 参数

| 参数名 | 类型 | 必需 | 说明 | 枚举值 |
|--------|------|------|------|--------|
| `scheme` | `select` | ✗ | ANARCI numbering scheme used to align the sequence and annotate position numbers (options: kabat, chothia, imgt, aho; default: kabat) | `kabat`, `chothia`, `imgt`, `aho` |
| `cdr_definition` | `select` | ✗ | Scheme used to define the CDR regions (options: kabat, chothia, imgt, north; default: kabat) | `kabat`, `chothia`, `imgt`, `north` |
| `heavy_chain` | `string` | ✓ | Heavy chain amino acid sequence (single antibody) |  |
| `light_chain` | `string` | ✗ | Light chain amino acid sequence (single antibody). Optional — omit for heavy-chain-only / NanoBody inputs. When omitted, only H-prefix mutations are allowed. |  |
| `min_subjects_percent` | `number` | ✗ | OASis prevalence threshold as percent of subjects. OASis identity score is calculated as the fraction of 9-mer peptides considered human. This threshold determines what fraction of human subjects from OAS database should contain a peptide for it to be considered human. The higher the threshold, the stricter the evaluation (range: 1.0 <= value < 100.0, default: 10.0) |  |
| `mutations` | `string` | ✗ | Optional substitutions using the selected numbering scheme: 'H27:A,L32:R' (comma/semicolon separated). H=heavy, L=light; L requires light_chain. Use existing positions and standard amino acid codes. Returns separate evaluations of mutated and original sequences. Blank = original only. |  |

### 示例代码

#### 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": "BioPhi",
    "tool_name": "design_design__post",
    "parameters": {
    "scheme": "<SCHEME>",
    "cdr_definition": "<CDR_DEFINITION>",
    "heavy_chain": "<HEAVY_CHAIN>",
    "light_chain": "<LIGHT_CHAIN>",
    "min_subjects_percent": 10,
    "mutations": "<MUTATIONS>"
},
    # 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/BioPhi>
