# Hmmer

Biological sequence analysis using profile hidden Markov models (profile HMMs). 

## 基础信息

| 项目 | 值 |
|------|-----|
| 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. Search a protein sequence against a protein sequence database to find homologs.
Similar to BLASTP.

**Tool Name:** `phmmer_endpoint_phmmer_post`

**Method:** `POST`

### 参数

| 参数名 | 类型 | 必需 | 说明 | 枚举值 |
|--------|------|------|------|--------|
| `database` | `select` | ✓ | Target sequence database. Reference Proteomes: UniProt reference proteomes for homology search and functional annotation. | SwissProt (2026_01): Reviewed UniProt set for high-confidence annotation. | UniProt (2026_01): Broadest coverage for general homology search. | PDB (06.06): Sequences linked to experimentally determined structures. | RP 15 (2024_04): Most compact representative set for remote-homology scans. | RP 35 (2024_04): Balanced representative set for routine searches. | RP 55 (2024_04): Moderate redundancy with more near-neighbor retention. | RP 75 (2024_04): High-coverage representative set close to the full database. | `Reference Proteomes`, `SwissProt (2026_01)`, `UniProt (2026_01)`, `PDB (06.06)`, `RP 15 (2024_04)`, `RP 35 (2024_04)`, `RP 55 (2024_04)`, `RP 75 (2024_04)` |
| `query_file` | `file` | ✓ | Query protein sequence in FASTA format (.fasta/.fa/.faa)<br/>file suffix: `fasta`, `fa`, `faa`, `txt` |  |
| `evalue` | `number` | ✗ | E-value threshold for reporting hits. Lower values are more stringent, e.g. 1e-5. 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": "Hmmer",
    "tool_name": "phmmer_endpoint_phmmer_post",
    "parameters": {
    "database": "<DATABASE>",
    "query_file": "<QUERY_FILE_FILE_ID>",
    "evalue": 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. Search a protein sequence database with one or more profile HMMs.

**Tool Name:** `hmmsearch_endpoint_hmmsearch_post`

**Method:** `POST`

### 参数

| 参数名 | 类型 | 必需 | 说明 | 枚举值 |
|--------|------|------|------|--------|
| `database` | `select` | ✓ | Target sequence database. Reference Proteomes: UniProt reference proteomes for homology search and functional annotation. | SwissProt (2026_01): Reviewed UniProt set for high-confidence annotation. | UniProt (2026_01): Broadest coverage for general homology search. | PDB (06.06): Sequences linked to experimentally determined structures. | RP 15 (2024_04): Most compact representative set for remote-homology scans. | RP 35 (2024_04): Balanced representative set for routine searches. | RP 55 (2024_04): Moderate redundancy with more near-neighbor retention. | RP 75 (2024_04): High-coverage representative set close to the full database. | `Reference Proteomes`, `SwissProt (2026_01)`, `UniProt (2026_01)`, `PDB (06.06)`, `RP 15 (2024_04)`, `RP 35 (2024_04)`, `RP 55 (2024_04)`, `RP 75 (2024_04)` |
| `hmm_file` | `file` | ✓ | Profile HMM file (.hmm) or multiple sequence alignment file (.a2m/.a3m)<br/>file suffix: `hmm`, `a2m`, `a3m` |  |
| `evalue` | `number` | ✗ | E-value threshold for reporting hits. Lower values are more stringent, e.g. 1e-5. 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": "Hmmer",
    "tool_name": "hmmsearch_endpoint_hmmsearch_post",
    "parameters": {
    "database": "<DATABASE>",
    "hmm_file": "<HMM_FILE_FILE_ID>",
    "evalue": 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. Scan a protein sequence against a profile HMM database to identify protein domains.

**Tool Name:** `hmmscan_endpoint_hmmscan_post`

**Method:** `POST`

### 参数

| 参数名 | 类型 | 必需 | 说明 | 枚举值 |
|--------|------|------|------|--------|
| `database` | `select` | ✓ | Target HMM profile database. Pfam: Profile HMM library for protein domains and families. | `Pfam` |
| `threshold_mode` | `select` | ✗ | Reporting threshold mode. hmmscan currently supports Gathering only. | `Gathering` |
| `query_file` | `file` | ✓ | Query protein sequence in FASTA format (.fasta/.fa/.faa)<br/>file suffix: `fasta`, `fa`, `faa`, `txt` |  |

### 示例代码

#### 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": "Hmmer",
    "tool_name": "hmmscan_endpoint_hmmscan_post",
    "parameters": {
    "database": "<DATABASE>",
    "threshold_mode": "<THRESHOLD_MODE>",
    "query_file": "<QUERY_FILE_FILE_ID>"
},
    # 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.")
```


---

## 4. Iteratively search a protein sequence against a protein sequence database.
Similar to PSI-BLAST but HMM-based. May converge before reaching max iterations.

**Tool Name:** `jackhmmer_endpoint_jackhmmer_post`

**Method:** `POST`

### 参数

| 参数名 | 类型 | 必需 | 说明 | 枚举值 |
|--------|------|------|------|--------|
| `database` | `select` | ✓ | Target sequence database. Reference Proteomes: UniProt reference proteomes for homology search and functional annotation. | SwissProt (2026_01): Reviewed UniProt set for high-confidence annotation. | UniProt (2026_01): Broadest coverage for general homology search. | PDB (06.06): Sequences linked to experimentally determined structures. | RP 15 (2024_04): Most compact representative set for remote-homology scans. | RP 35 (2024_04): Balanced representative set for routine searches. | RP 55 (2024_04): Moderate redundancy with more near-neighbor retention. | RP 75 (2024_04): High-coverage representative set close to the full database. | `Reference Proteomes`, `SwissProt (2026_01)`, `UniProt (2026_01)`, `PDB (06.06)`, `RP 15 (2024_04)`, `RP 35 (2024_04)`, `RP 55 (2024_04)`, `RP 75 (2024_04)` |
| `query_file` | `file` | ✓ | Query protein sequence in FASTA format (.fasta/.fa/.faa)<br/>file suffix: `fasta`, `fa`, `faa`, `txt` |  |
| `evalue` | `number` | ✗ | E-value threshold for reporting hits. Lower values are more stringent, e.g. 1e-5. Default: 10.0 |  |
| `iterations` | `number` | ✗ | Number of search iterations (range: 1-20, 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": "Hmmer",
    "tool_name": "jackhmmer_endpoint_jackhmmer_post",
    "parameters": {
    "database": "<DATABASE>",
    "query_file": "<QUERY_FILE_FILE_ID>",
    "evalue": 10,
    "iterations": 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/Hmmer>
