Protein Docking Configurator
Features
- - Parse protein PDB files, identify ligand binding pockets
- Automatically calculate Grid Box center coordinates and dimensions
- Generate AutoDock Vina configuration files
- Generate AutoDock4 Grid parameter files
- Support Box positioning based on active site residues or ligands
Usage
As Command Line Tool
CODEBLOCK0
As Python Module
CODEBLOCK1
Parameter Description
Command Line Parameters
| Parameter | Description | Required |
|---|
| INLINECODE0 | Receptor protein PDB file path | Yes |
| INLINECODE1 |
Docking software type (vina/autodock4) | Yes |
|
--active-site-residues | Active site residue list, format: "chain:residue_number" | No |
|
--reference-ligand | Reference ligand PDB/MOL file | No |
|
--center-x/y/z | Grid Box center coordinates | No |
|
--size-x/y/z | Grid Box dimensions (Å) | No |
|
--spacing | Grid spacing (AutoDock4 only) | No (default 0.375) |
|
--exhaustiveness | Search exhaustiveness (Vina only) | No (default 32) |
|
--output | Output file path | No |
Output
- - AutoDock Vina: Generates config.txt configuration file
- AutoDock4: Generates .gpf (Grid Parameter File) and corresponding macromolecule files
Dependencies
Examples
CODEBLOCK2
Notes
- 1. Input PDB files should have water molecules and heteroatoms removed (unless needed)
- It is recommended to protonate and calculate charges for the receptor (using AutoDock Tools, etc.)
- Grid Box size should be sufficient to cover ligand conformational space, typically 20-30Å
- Active site residues should include catalytic residues and key binding residues
Risk Assessment
| Risk Indicator | Assessment | Level |
|---|
| Code Execution | Python/R scripts executed locally | Medium |
| Network Access |
No external API calls | Low |
| File System Access | Read input files, write output files | Medium |
| Instruction Tampering | Standard prompt guidelines | Low |
| Data Exposure | Output files saved to workspace | Low |
Security Checklist
- - [ ] No hardcoded credentials or API keys
- [ ] No unauthorized file system access (../)
- [ ] Output does not expose sensitive information
- [ ] Prompt injection protections in place
- [ ] Input file paths validated (no ../ traversal)
- [ ] Output directory restricted to workspace
- [ ] Script execution in sandboxed environment
- [ ] Error messages sanitized (no stack traces exposed)
- [ ] Dependencies audited
Prerequisites
No additional Python packages required.
Evaluation Criteria
Success Metrics
- - [ ] Successfully executes main functionality
- [ ] Output meets quality standards
- [ ] Handles edge cases gracefully
- [ ] Performance is acceptable
Test Cases
- 1. Basic Functionality: Standard input → Expected output
- Edge Case: Invalid input → Graceful error handling
- Performance: Large dataset → Acceptable processing time
Lifecycle Status
- - Current Stage: Draft
- Next Review Date: 2026-03-06
- Known Issues: None
- Planned Improvements:
- Performance optimization
- Additional feature support
蛋白质对接配置器
功能特性
- - 解析蛋白质PDB文件,识别配体结合口袋
- 自动计算Grid Box中心坐标和尺寸
- 生成AutoDock Vina配置文件
- 生成AutoDock4网格参数文件
- 支持基于活性位点残基或配体的Box定位
使用方法
作为命令行工具
bash
基于活性位点残基计算Grid Box
python scripts/main.py --receptor protein.pdb --active-site-residues A:120,A:145,A:189 --software vina
基于参考配体计算Grid Box
python scripts/main.py --receptor protein.pdb --reference-ligand ligand.pdb --software vina
手动指定Box参数
python scripts/main.py --receptor protein.pdb --center-x 10.5 --center-y -5.2 --center-z 20.1 --size-x 20 --size-y 20 --size-z 20 --software vina
作为Python模块
python
from scripts.main import DockingConfigurator
config = DockingConfigurator()
从受体和活性位点计算Box
config.from
activesite(protein.pdb, [A:120, A:145, A:189])
config.write
vinaconfig(config.txt, exhaustiveness=32)
从受体和参考配体计算Box
config.from
referenceligand(protein.pdb, ligand.pdb, padding=5.0)
config.write
autodock4gpf(protein.gpf, spacing=0.375)
参数说明
命令行参数
| 参数 | 描述 | 是否必需 |
|---|
| --receptor | 受体蛋白质PDB文件路径 | 是 |
| --software |
对接软件类型(vina/autodock4) | 是 |
| --active-site-residues | 活性位点残基列表,格式:链:残基编号 | 否 |
| --reference-ligand | 参考配体PDB/MOL文件 | 否 |
| --center-x/y/z | Grid Box中心坐标 | 否 |
| --size-x/y/z | Grid Box尺寸(Å) | 否 |
| --spacing | 网格间距(仅AutoDock4) | 否(默认0.375) |
| --exhaustiveness | 搜索详尽度(仅Vina) | 否(默认32) |
| --output | 输出文件路径 | 否 |
输出文件
- - AutoDock Vina:生成config.txt配置文件
- AutoDock4:生成.gpf(网格参数文件)及对应的大分子文件
依赖环境
示例
bash
示例1:使用活性位点残基
python scripts/main.py --receptor 1abc
receptor.pdb --active-site-residues A:45,A:92,A:156 --software vina --output vinaconfig.txt
示例2:使用参考配体并自定义Box尺寸
python scripts/main.py --receptor kinase.pdb --reference-ligand ATP.pdb --software vina --size-x 25 --size-y 25 --size-z 25
示例3:AutoDock4配置
python scripts/main.py --receptor protein.pdb --active-site-residues A:100 --software autodock4 --spacing 0.375 --output protein.gpf
注意事项
- 1. 输入PDB文件应去除水分子和杂原子(除非必要)
- 建议对受体进行质子化和电荷计算(使用AutoDock Tools等工具)
- Grid Box尺寸应足够覆盖配体构象空间,通常为20-30Å
- 活性位点残基应包含催化残基和关键结合残基
风险评估
| 风险指标 | 评估 | 等级 |
|---|
| 代码执行 | 本地执行Python/R脚本 | 中 |
| 网络访问 |
无外部API调用 | 低 |
| 文件系统访问 | 读取输入文件,写入输出文件 | 中 |
| 指令篡改 | 标准提示词指南 | 低 |
| 数据泄露 | 输出文件保存至工作区 | 低 |
安全检查清单
- - [ ] 无硬编码凭据或API密钥
- [ ] 无未经授权的文件系统访问(../)
- [ ] 输出不泄露敏感信息
- [ ] 已实施提示注入防护
- [ ] 输入文件路径已验证(无../遍历)
- [ ] 输出目录限制在工作区内
- [ ] 脚本在沙盒环境中执行
- [ ] 错误信息已清理(不暴露堆栈跟踪)
- [ ] 依赖项已审计
前置条件
无需额外Python包。
评估标准
成功指标
- - [ ] 成功执行主要功能
- [ ] 输出符合质量标准
- [ ] 优雅处理边缘情况
- [ ] 性能可接受
测试用例
- 1. 基本功能:标准输入 → 预期输出
- 边缘情况:无效输入 → 优雅错误处理
- 性能测试:大数据集 → 可接受处理时间
生命周期状态
- - 当前阶段:草案
- 下次审查日期:2026-03-06
- 已知问题:无
- 计划改进:
- 性能优化
- 增加额外功能支持