{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 药物分子SMARTS筛选：基于张夏恒反应替代Sandmeyer反应的策略\n",
    "\n",
    "## 研究背景\n",
    "\n",
    "本notebook旨在筛选药物分子数据库中可能使用**张夏恒反应**替代**Sandmeyer反应**合成的化合物。\n",
    "\n",
    "### 关键概念\n",
    "\n",
    "**Sandmeyer反应**：传统的芳香胺转化方法\n",
    "- 反应式：Ar-NH₂ → [Ar-N₂⁺] → Ar-X\n",
    "- 产物：芳香卤化物（X = Cl, Br, I, CN, OH, SCN等）\n",
    "\n",
    "**张夏恒反应**：新兴的绿色反应方法\n",
    "- 提供更环保的合成路线\n",
    "- 可能替代传统Sandmeyer反应\n",
    "\n",
    "### 筛选策略\n",
    "\n",
    "基于**同分异构体生物等排替换**原理：\n",
    "- 如果化合物A（使用Sandmeyer合成）有活性\n",
    "- 化合物B（使用张夏恒反应合成相同骨架）可能有相似活性\n",
    "\n",
    "### 筛选逻辑\n",
    "\n",
    "**核心假设**：含有芳香卤素的药物可能通过Sandmeyer反应合成\n",
    "\n",
    "**优先级排序**：\n",
    "1. **杂芳环卤素**（最高优先级）\n",
    "   - 氯代吡啶、氯代嘧啶等\n",
    "   - 这些结构更可能使用Sandmeyer或SNAr反应合成\n",
    "   \n",
    "2. **普通芳香卤素**（高优先级）\n",
    "   - 任意芳香氯、溴、碘\n",
    "   - 可能来自Sandmeyer反应，需要文献验证\n",
    "\n",
    "### 三种筛选方案\n",
    "\n",
    "#### 方案A（最保守）：杂芳环卤素筛选\n",
    "- **SMARTS模式**：`n:c:[Cl,Br,I]` 或 `n1c([Cl,Br,I])cccc1`\n",
    "- **优势**：精准度最高，假阳性率低\n",
    "- **适用**：快速找到最可能的候选药物\n",
    "- **预期结果**：候选数量少但精准\n",
    "\n",
    "#### 方案B（平衡）：所有芳香卤素筛选\n",
    "- **SMARTS模式**：`c[Cl,Br,I]`\n",
    "- **优势**：覆盖面更广，平衡精准度和广度\n",
    "- **适用**：全面筛选药物库\n",
    "- **预期结果**：候选数量中等，适中假阳性率\n",
    "\n",
    "#### 方案C（已删除）：简化版\n",
    "- 只筛选含卤素化合物\n",
    "- 精准度较低，已废弃\n",
    "\n",
    "---\n",
    "\n",
    "## 文件信息\n",
    "\n",
    "- **输入文件**：`/data/drug_targetmol/0c04ffc9fe8c2ec916412fbdc2a49bf4.sdf`\n",
    "- **输出目录**：`/data/drug_targetmol/`\n",
    "- **输出文件**：\n",
    "  - `candidates_planA_heteroaryl_halides.csv`（方案A结果）\n",
    "  - `candidates_planB_all_aromatic_halides.csv`（方案B结果）"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
