protein-struct-viz
Generate PyMOL scripts for highlighting specific protein residues in molecular structures.
Overview
This skill creates PyMOL command scripts to visualize protein structures with specific residues highlighted using various representation styles (sticks, spheres, surface, etc.).
Usage
The skill generates .pml script files that can be executed directly in PyMOL to:
- - Load PDB structures
- Apply custom color schemes
- Highlight specific residues with different representation styles
- Create publication-ready visualization settings
Input Parameters
| Parameter | Type | Description |
|---|
| INLINECODE1 | string | Path to PDB file or PDB ID (e.g., "1abc") |
| INLINECODE2 |
list | List of residue specifications (chain:resnum:resname) |
|
style | string | Visualization style: "sticks", "spheres", "surface", "cartoon" |
|
color_scheme | string | Color scheme: "rainbow", "chain", "element", custom hex |
|
output_name | string | Output filename for the generated script |
Residue Specification Format
- - Format:
chain:resnum:resname or resnum (for single chain) - Examples:
A:145:ASP, B:23:LYS, INLINECODE10 - Wildcards:
A:* (all residues in chain A)
Example
CODEBLOCK0
This will generate a PyMOL script highlighting the specified residues in myoglobin's active site.
Output
Generated .pml script includes:
- 1. Structure loading commands
- Background and lighting settings
- Global representation settings
- Specific residue highlighting
- View optimization commands
- Optional: ray tracing for high-quality images
References
See references/ directory for:
- - PyMOL command reference
- Color palette templates
- Example scripts for common visualization tasks
Technical Difficulty
Medium - requires understanding of PyMOL scripting syntax and protein structure concepts.
Dependencies
- - PyMOL (installed separately)
- Python 3.7+
- No Python package dependencies (generates plain text scripts)
Risk Assessment
| Risk Indicator | Assessment | Level |
|---|
| Code Execution | Python scripts with tools | High |
| Network Access |
External API calls | High |
| File System Access | Read/write data | Medium |
| Instruction Tampering | Standard prompt guidelines | Low |
| Data Exposure | Data handled securely | Medium |
Security Checklist
- - [ ] No hardcoded credentials or API keys
- [ ] No unauthorized file system access (../)
- [ ] Output does not expose sensitive information
- [ ] Prompt injection protections in place
- [ ] API requests use HTTPS only
- [ ] Input validated against allowed patterns
- [ ] API timeout and retry mechanisms implemented
- [ ] Output directory restricted to workspace
- [ ] Script execution in sandboxed environment
- [ ] Error messages sanitized (no internal paths exposed)
- [ ] Dependencies audited
- [ ] No exposure of internal service architecture
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
protein-struct-viz
生成用于在分子结构中高亮特定蛋白质残基的PyMOL脚本。
概述
该技能创建PyMOL命令脚本,用于可视化蛋白质结构,并使用不同的表示样式(棍状、球状、表面等)高亮特定残基。
使用方法
该技能生成可直接在PyMOL中执行的.pml脚本文件,用于:
- - 加载PDB结构
- 应用自定义配色方案
- 使用不同表示样式高亮特定残基
- 创建可发表级别的可视化设置
输入参数
| 参数 | 类型 | 描述 |
|---|
| pdb_file | 字符串 | PDB文件路径或PDB ID(例如:1abc) |
| residues |
列表 | 残基规格列表(链:残基编号:残基名称) |
| style | 字符串 | 可视化样式:sticks、spheres、surface、cartoon |
| color_scheme | 字符串 | 配色方案:rainbow、chain、element、自定义十六进制颜色 |
| output_name | 字符串 | 生成脚本的输出文件名 |
残基规格格式
- - 格式:链:残基编号:残基名称 或 残基编号(单链情况)
- 示例:A:145:ASP、B:23:LYS、156
- 通配符:A:*(链A中的所有残基)
示例
bash
python scripts/main.py --pdb 1mbn --residues A:64:HIS,A:93:VAL,A:97:LEU --style sticks --colorscheme rainbow --output myoglobinactive_site.pml
这将生成一个PyMOL脚本,高亮肌红蛋白活性位点中的指定残基。
输出
生成的.pml脚本包括:
- 1. 结构加载命令
- 背景和光照设置
- 全局表示设置
- 特定残基高亮
- 视图优化命令
- 可选:高质量图像的射线追踪
参考
参见references/目录:
- - PyMOL命令参考
- 调色板模板
- 常见可视化任务的示例脚本
技术难度
中等 - 需要理解PyMOL脚本语法和蛋白质结构概念。
依赖项
- - PyMOL(单独安装)
- Python 3.7+
- 无Python包依赖(生成纯文本脚本)
风险评估
| 风险指标 | 评估 | 等级 |
|---|
| 代码执行 | 使用工具的Python脚本 | 高 |
| 网络访问 |
外部API调用 | 高 |
| 文件系统访问 | 读写数据 | 中等 |
| 指令篡改 | 标准提示词指南 | 低 |
| 数据暴露 | 安全处理数据 | 中等 |
安全检查清单
- - [ ] 无硬编码凭据或API密钥
- [ ] 无未经授权的文件系统访问(../)
- [ ] 输出不暴露敏感信息
- [ ] 已实施提示注入保护
- [ ] API请求仅使用HTTPS
- [ ] 输入已根据允许模式进行验证
- [ ] 已实现API超时和重试机制
- [ ] 输出目录限制在工作空间内
- [ ] 在沙盒环境中执行脚本
- [ ] 错误消息已清理(不暴露内部路径)
- [ ] 依赖项已审计
- [ ] 不暴露内部服务架构
先决条件
无需额外Python包。
评估标准
成功指标
- - [ ] 成功执行主要功能
- [ ] 输出符合质量标准
- [ ] 优雅处理边界情况
- [ ] 性能可接受
测试用例
- 1. 基本功能:标准输入 → 预期输出
- 边界情况:无效输入 → 优雅错误处理
- 性能:大数据集 → 可接受处理时间
生命周期状态
- - 当前阶段:草稿
- 下次审查日期:2026-03-06
- 已知问题:无
- 计划改进:
- 性能优化
- 额外功能支持