# swiss_target_batch **Repository Path**: akikali/swiss_target_batch ## Basic Information - **Project Name**: swiss_target_batch - **Description**: Automated batch client for SwissTargetPrediction — Submit SMILES strings programmatically, retrieve protein target predictions (including UniProt/ChEMBL IDs, probability scores, and known actives), and export results to CSV. Unofficial, lightweight, and research-friendly. - **Primary Language**: Python - **License**: ISC - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-04-01 - **Last Updated**: 2026-04-04 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # SwissTargetPrediction 批量查询工具 [English](README.md) | [中文](README_zh.md) 该 Python 脚本可自动化向 [SwissTargetPrediction](https://www.swisstargetprediction.ch/) 提交 SMILES 字符串,批量获取靶点预测结果,并保存为 CSV 文件。 > **注意**:本工具为**非官方实现**,与 [瑞士生物信息学研究所(SIB)](https://www.sib.swiss/) 无任何关联。请合理使用,遵守其服务器使用政策。 --- ## ✨ 功能特点 - 支持批量提交 SMILES 字符串 - 自动轮询任务状态(默认最多等待 30 秒) - 自动解析结果表格,包含以下信息: - 靶点名称(Target) - 通用名(Common name) - UniProt 与 ChEMBL ID - 靶点类别(Target Class) - 预测概率(Probability*) - 已知活性分子(3D/2D 相似性) - 将所有结果结构化保存为 CSV 文件 --- ## 🛠️ 依赖环境 - Python 3.12 或更高版本 - 所需 Python 包: ```bash pip install requests pandas lxml html5lib ``` --- ## 🚀 使用方法 1. **克隆或下载本仓库** 2. **安装依赖** ```bash pip install -r requirements.txt ``` 3. **运行脚本** ```python python swiss_target_batch.py ``` 脚本中已包含示例 SMILES 列表(如阿司匹林、咖啡因等)。你可以替换成自己的分子列表: ```python smiles_list = [ "CC(=O)OC1=CC=CC=C1C(=O)O", # 阿司匹林 "CN1C=NC2=C1C(=O)N(C(=O)N2C)C", # 咖啡因 # 在此处添加你的 SMILES... ] ``` 4. **结果**默认保存为 `swiss_results.csv`(可通过 `output_csv` 参数修改)。 --- ## ⚠️ 重要注意事项 - **请求频率限制**:SwissTargetPrediction 服务器可能对高频请求进行限流或封禁。脚本中已加入 2 秒提交间隔——**请勿移除**。 - **物种支持**:默认为 `"Homo_sapiens"`(人)。支持的物种包括: - `"Homo_sapiens"`(人) - `"Mus_musculus"`(小鼠) - `"Rattus_norvegicus"`(大鼠) --- ## 📄 输出示例(`swiss_results.csv`) | Target | Common name | Uniprot ID | ChEMBL ID | Target Class | Probability* | Known actives (3D/2D) | input_smiles | |-------------------|-------------|------------|-------------|--------------|--------------|------------------------|----------------------------| | Cyclooxygenase-1 | PTGS1 | P23219 | CHEMBL221 | Oxidoreductase | 0.756002348928 | 3 / 2 | CC(=O)OC1=CC=CC=C1C(=O)O | --- ## 📜 许可证 本代码采用 **ISC 许可证**发布。 预测结果及数据版权归属 SwissTargetPrediction / SIB 所有。 --- ## 💡 致谢 - [SwissTargetPrediction](https://www.swisstargetprediction.ch/) — 免费的小分子靶点预测网络服务 - [瑞士生物信息学研究所(SIB)](https://www.sib.swiss/) --- > 🙏 **若在科研中使用本工具,请引用 SwissTargetPrediction 原始论文!** > Daina, A., Michielin, O., & Zoete, V. (2019). *SwissTargetPrediction: updated data and new features for efficient prediction of protein targets of small molecules.* Nucleic Acids Research, 47(W1), W357–W364. https://doi.org/10.1093/nar/gkz382