DeepPurpose
This skill is adapted from DeepPurpose, copyright (c) 2020 Kexin Huang,
Tianfan Fu, licensed under BSD 3-Clause.
Prefer a local DeepPurpose checkout over web summaries. Treat a directory as the
repo root when it contains setup.py, requirements.txt, DeepPurpose/,
DEMO/, and toy_data/.
Workflow
- 1. Classify the request: environment/install, task pipeline, dataset format,
pretrained model, notebook/demo adaptation, or troubleshooting.
- 2. Read only the relevant reference file:
- installation, dependency sanity, or smoke tests:
references/install-and-dependencies.md
- task/module selection, encodings, splits, and core APIs:
references/tasks-and-entrypoints.md
- dataset loaders, custom text formats, pretrained downloads, and result
outputs:
references/data-and-pretrained.md
- 3. Verify advice against local files before answering. Prefer
README.md,
DeepPurpose/utils.py,
DeepPurpose/dataset.py, and the task module the user
actually needs.
- 4. Reuse the upstream API shape instead of inventing wrappers. The maintained
paths are:
- DTI:
DeepPurpose/DTI.py
- compound property prediction:
DeepPurpose/CompoundPred.py
- DDI:
DeepPurpose/DDI.py
- PPI:
DeepPurpose/PPI.py
- protein function prediction:
DeepPurpose/ProteinPred.py
- one-line repurposing and virtual screening:
DeepPurpose/oneliner.py
- 5. Prefer the closest notebook in
DEMO/ when the user wants an example or a
starting point.
Execution Rules
- - Build datasets with
DeepPurpose.dataset helpers or local text files in the
expected format.
- - Encode and split with
data_process(...), then build a config with
generate_config(...), then call
model_initialize(**config) or
model_pretrained(...).
- - Keep the task/module aligned:
- DTI uses both drug and target inputs
- compound property uses drug-only inputs
- DDI uses
X_drug plus
X_drug_
- PPI uses
X_target plus
X_target_
- protein function uses target-only inputs
- - For repurposing or screening, prefer the existing helpers:
DTI.repurpose,
DTI.virtual_screening,
CompoundPred.repurpose, and
oneliner.repurpose or
oneliner.virtual_screening.
- - Warn when a step triggers network downloads. Dataset helpers and pretrained
model helpers fetch remote files.
- - Distinguish static validation from runtime validation. INLINECODE32
imports heavy dependencies immediately, so a real import needs RDKit, PyTorch,
Descriptastorus, and related packages installed first.
Source Files
Use these local files as the primary source of truth when present:
- - INLINECODE33
- INLINECODE34
- INLINECODE35
- INLINECODE36
- INLINECODE37
- INLINECODE38
- INLINECODE39
- INLINECODE40
- INLINECODE41
- INLINECODE42
- INLINECODE43
- INLINECODE44
- INLINECODE45
- INLINECODE46
DeepPurpose
本技能改编自DeepPurpose,版权所有(c)2020 Kexin Huang、Tianfan Fu,基于BSD 3-Clause许可证发布。
优先使用本地DeepPurpose代码库而非网络摘要。当目录包含setup.py、requirements.txt、DeepPurpose/、DEMO/和toy_data/时,将其视为仓库根目录。
工作流程
- 1. 对请求进行分类:环境/安装、任务流程、数据集格式、预训练模型、笔记本/演示适配或故障排除。
- 仅读取相关参考文件:
- 安装、依赖完整性检查或冒烟测试:references/install-and-dependencies.md
- 任务/模块选择、编码、数据划分和核心API:references/tasks-and-entrypoints.md
- 数据集加载器、自定义文本格式、预训练模型下载和结果输出:references/data-and-pretrained.md
- 3. 在回答前,对照本地文件验证建议。优先使用README.md、DeepPurpose/utils.py、DeepPurpose/dataset.py以及用户实际需要的任务模块。
- 复用上游API结构,而非自行封装。维护的路径包括:
- DTI:DeepPurpose/DTI.py
- 化合物属性预测:DeepPurpose/CompoundPred.py
- DDI:DeepPurpose/DDI.py
- PPI:DeepPurpose/PPI.py
- 蛋白质功能预测:DeepPurpose/ProteinPred.py
- 单行重定位和虚拟筛选:DeepPurpose/oneliner.py
- 5. 当用户需要示例或起点时,优先使用DEMO/中最接近的笔记本。
执行规则
- - 使用DeepPurpose.dataset辅助函数或符合预期格式的本地文本文件构建数据集。
- 使用dataprocess(...)进行编码和划分,然后使用generateconfig(...)构建配置,再调用modelinitialize(config)或modelpretrained(...)。
- 保持任务/模块对齐:
- DTI同时使用药物和目标输入
- 化合物属性仅使用药物输入
- DDI使用X
drug加Xdrug_
- PPI使用X
target加Xtarget_
- 蛋白质功能仅使用目标输入
- - 对于重定位或筛选,优先使用现有辅助函数:DTI.repurpose、DTI.virtualscreening、CompoundPred.repurpose以及oneliner.repurpose或oneliner.virtualscreening。
- 当某步骤触发网络下载时发出警告。数据集辅助函数和预训练模型辅助函数会获取远程文件。
- 区分静态验证和运行时验证。DeepPurpose/utils.py会立即导入重量级依赖,因此实际导入需要先安装RDKit、PyTorch、Descriptastorus及相关包。
源文件
当以下本地文件存在时,将其作为主要信息来源:
- - README.md
- requirements.txt
- environment.yml
- setup.py
- DeepPurpose/utils.py
- DeepPurpose/dataset.py
- DeepPurpose/oneliner.py
- DeepPurpose/DTI.py
- DeepPurpose/CompoundPred.py
- DeepPurpose/DDI.py
- DeepPurpose/PPI.py
- DeepPurpose/ProteinPred.py
- toy_data/
- DEMO/