Adme Prediction logo

Adme Prediction

Organization
InternScience
adme-prediction

ADME 性质预测工具。预测分子的吸收、分布、代谢、排泄性质,包括 Caco-2 通透性、PAMPA、HIA、Pgp 抑制、生物利用度、亲脂性等。使用 Morgan 指纹 + Random Forest/XGBoost。当用户提到 ADME 预测、药物性质、通透性、吸收、代谢等时触发。

Overview

PublisherInternScience
RepositoryChemClaw
Skill nameadme-prediction
Stars
53
Forks
13
Bundled files
15
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 15 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by InternScience on GitHub. Read the source before you install it.

Installation

Install the Adme Prediction AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/InternScience/ChemClaw/tree/main/skills/adme-prediction
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/InternScience/ChemClaw.git /tmp/ChemClaw
mkdir -p .claude/skills
cp -r /tmp/ChemClaw/skills/adme-prediction .claude/skills/adme-prediction
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Adme Prediction in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Adme Prediction on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Adme Prediction is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

ADME Prediction

ADME(吸收、分布、代谢、排泄)性质预测技能,用于药物发现和开发早期的药物动力学性质评估。

支持的 ADME 性质

性质数据集类型说明
Caco-2 通透性Caco2_Wang回归预测 Caco-2 细胞有效通透性 (log Papp)
PAMPA 通透性PAMPA_NCATS分类预测人工膜通透性 (高/低 - 中)
肠道吸收HIA_Hou分类预测人体肠道吸收 (活性/非活性)
Pgp 抑制Pgp_Broccatelli分类预测 P-糖蛋白抑制 (抑制剂/非抑制剂)
生物利用度Bioavailability_Ma分类预测口服生物利用度 (高/低)
亲脂性Lipophilicity_AstraZeneca回归预测亲脂性 (logD)

使用方法

对话框中使用

用户可以直接提供 SMILES 并要求预测:

预测这个分子的 ADME 性质:CCO
计算 Caco-2 通透性:c1ccccc1
这个化合物的肠道吸收怎么样?CC(=O)O
预测 Pgp 抑制活性:CCN(CC)CC

命令行使用

bash
# 预测单个分子
python3 scripts/adme_predictor.py --smiles "CCO"

# 预测特定性质
python3 scripts/adme_predictor.py --smiles "c1ccccc1" --property Caco2_Wang

# 批量预测(从文件读取 SMILES)
python3 scripts/adme_predictor.py --file molecules.smi --output results.json

# 列出所有可用性质
python3 scripts/adme_predictor.py --list

# JSON 输出
python3 scripts/adme_predictor.py --smiles "CCO" --json

参数说明

参数简写说明默认值
--smiles-sSMILES 字符串必需(或 --file)
--file-f包含 SMILES 的文件(每行一个)必需(或 --smiles)
--property-p要预测的性质(可多个)全部
--output-o输出文件路径标准输出
--json-j以 JSON 格式输出表格格式
--list-l列出所有可用性质-
--model-dir-m模型目录默认模型目录

工作流程

1. 分子输入

支持多种输入方式:

python
# 单个 SMILES
smiles = "CCO"

# 从文件读取
with open("molecules.smi") as f:
    smiles_list = [line.strip() for line in f]

# 从其他格式转换
from rdkit import Chem
mol = Chem.MolFromMolFile("input.mol")
smiles = Chem.MolToSmiles(mol)

2. 指纹计算

使用 Morgan 指纹(ECFP4)表示分子:

python
from rdkit.Chem import AllChem

fp = AllChem.GetMorganFingerprintAsBitVect(
    mol, 
    radius=2,      # ECFP4
    nBits=2048     # 指纹长度
)

3. 性质预测

加载预训练模型进行预测:

python
# 加载模型
import pickle
with open("models/Caco2_Wang.pkl", "rb") as f:
    model = pickle.load(f)

# 预测
prediction = model.predict([fp])[0]

输出示例

单个分子预测

bash
$ python3 scripts/adme_predictor.py --smiles "CCO" --json

{
  "smiles": "CCO",
  "predictions": {
    "Caco2_Wang": {
      "value": -0.52,
      "type": "regression",
      "unit": "log Papp (10^-6 cm/s)",
      "description": "Caco-2 细胞有效通透性"
    },
    "HIA_Hou": {
      "class": "Active",
      "probability": 0.89,
      "type": "classification",
      "description": "人体肠道吸收"
    },
    "Lipophilicity_AstraZeneca": {
      "value": -0.31,
      "type": "regression",
      "unit": "logD",
      "description": "亲脂性"
    }
  }
}

表格输出

SMILES: CCO (乙醇)

ADME 性质预测结果:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
性质                    预测值          置信度
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Caco-2 通透性           -0.52          -
PAMPA 通透性            High           0.78
肠道吸收 (HIA)          Active         0.89
Pgp 抑制                Non-inhibitor  0.92
生物利用度              High           0.85
亲脂性 (logD)           -0.31          -
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

批量预测

bash
$ python3 scripts/adme_predictor.py --file drugs.smi -o results.csv

✓ 已处理:10/10 分子
✓ 输出:results.csv

$ cat results.csv
smiles,Caco2_Wang,HIA_Hou,Lipophilicity
CCO,-0.52,Active,-0.31
c1ccccc1,0.23,Active,2.15
CC(=O)O,-0.71,Active,-0.17

依赖

必需依赖

bash
pip install rdkit scikit-learn pandas numpy

可选依赖(推荐)

bash
# XGBoost(更好的性能)
pip install xgboost

# TDC(下载训练数据)
pip install PyTDC

检查安装

bash
# 检查 RDKit
python3 -c "from rdkit import Chem; print('RDKit OK')"

# 检查 scikit-learn
python3 -c "from sklearn.ensemble import RandomForestClassifier; print('sklearn OK')"

模型训练

下载 TDC 数据

python
from tdc.single_pred import ADME

# 下载 Caco-2 数据集
data = ADME(name='Caco2_Wang')
df = data.get_data()

# 获取数据分割
split = data.get_split()
train_df = data.get_split()['train']

训练模型

bash
# 训练 Caco-2 模型
python3 scripts/adme_train.py \
  --property Caco2_Wang \
  --data data/caco2_train.csv \
  --output models/Caco2_Wang.pkl

# 训练所有模型
python3 scripts/adme_train.py --all --data-dir ./tdc_data/ --output-dir ./models/

训练参数

参数说明默认值
--property要训练的性质必需
--data训练数据 CSV必需
--output输出模型路径必需
--model-type模型类型 (rf/xgboost)rf
--n-estimators树的数量100
--max-depth最大深度10

ADME 性质详解

Caco-2 通透性 (Caco2_Wang)

说明: Caco-2 细胞系用于模拟人体肠道组织,预测药物口服吸收能力。

单位: log Papp (10^-6 cm/s)

解释:

  • -5.0: 高通透性(吸收良好)

  • -6.0 to -5.0: 中等通透性
  • < -6.0: 低通透性(吸收差)

PAMPA 通透性 (PAMPA_NCATS)

说明: 平行人工膜通透性测定,高通量筛选药物渗透性。

类别:

  • High: 高通透性
  • Low-Moderate: 低 - 中等通透性

人体肠道吸收 (HIA_Hou)

说明: 预测药物从胃肠道吸收到血液的能力。

类别:

  • Active: 吸收良好
  • Inactive: 吸收差

P-糖蛋白抑制 (Pgp_Broccatelli)

说明: Pgp 是 ABC 转运蛋白,影响药物代谢和脑渗透。

类别:

  • Inhibitor: Pgp 抑制剂(可能影响其他药物代谢)
  • Non-inhibitor: 非抑制剂

口服生物利用度 (Bioavailability_Ma)

说明: 预测药物口服后到达作用部位的比例。

类别:

  • High: 生物利用度高(>50%)
  • Low: 生物利用度低

亲脂性 (Lipophilicity_AstraZeneca)

说明: 预测药物在脂质环境中的溶解能力。

单位: logD

解释:

  • 过高:代谢快、溶解度差
  • 过低:膜通透性差
  • 理想范围:1-3

与其他化学技能配合

与 mol_2d_viewer 配合

bash
# 1. 预测 ADME 性质
python3 scripts/adme_predictor.py --smiles "CCO" -o adme_results.json

# 2. 生成 2D 结构图
python3 ../mol-2d-viewer/scripts/mol_2d_viewer.py --smiles "CCO" --output structure.png

与 smiles_to_iupac 配合

bash
# 1. SMILES 转 IUPAC 名称
python3 ../smiles-to-iupac/scripts/smiles_to_iupac.py --smiles "CCO"

# 2. 预测 ADME 性质
python3 scripts/adme_predictor.py --smiles "CCO"

与 mol_paper_renderer 配合

bash
# 1. 预测性质
python3 scripts/adme_predictor.py --smiles "CCO" --json > adme.json

# 2. 生成论文级渲染图
python3 ../mol-paper-renderer/scripts/mol_paper_renderer.py \
  --smiles "CCO" \
  --output ethanol_figure.svg \
  --caption "Ethanol: ADME properties predicted"

常见问题

Q: 预测结果不准确怎么办?

A:

  • 检查分子是否在训练数据范围内(类似结构)
  • 尝试使用 XGBoost 模型(通常更准确)
  • 考虑使用集成方法(多个模型平均)

Q: 如何评估模型质量?

A: 使用 TDC 提供的 scaffold split 进行评估:

python
from sklearn.metrics import roc_auc_score, mean_squared_error

# 分类任务
auc = roc_auc_score(y_true, y_pred)

# 回归任务
rmse = mean_squared_error(y_true, y_pred, squared=False)

Q: 支持大分子(蛋白质、抗体)吗?

A: 当前版本仅支持小分子。大分子需要使用专门的模型(如 Developability 预测)。

Q: 如何自定义模型参数?

A: 修改训练脚本中的模型配置:

python
model = RandomForestClassifier(
    n_estimators=200,  # 增加树的数量
    max_depth=15,      # 增加深度
    class_weight='balanced'  # 处理类别不平衡
)

注意事项

  • ✅ 快速预测 - 每个分子 <100ms
  • ✅ 批量处理 - 支持数千分子批量预测
  • ✅ 置信度评估 - 分类任务提供概率
  • ✅ TDC 兼容 - 使用标准数据集和分割方法
  • ⚠️ 小分子限制 - 仅适用于小分子药物
  • ⚠️ 结构相似性 - 对训练集外结构预测可能不准确
  • ⚠️ 实验验证 - 预测结果需实验验证

错误处理

错误说明解决方案
Invalid SMILESSMILES 格式错误检查 SMILES 语法
Model not found模型文件缺失运行训练脚本
RDKit error分子处理失败检查分子是否有效
Property not supported不支持的性质使用 --list 查看可用性质

性能参考

分子数量预测时间(单线程)预测时间(多线程)
1<0.1s<0.1s
100.5s0.2s
1005s1s
100050s10s

数据来源

所有数据集来自 Therapeutics Data Commons (TDC)

引用:

@article{huang2022therapeutics,
  title={Therapeutics Data Commons: Machine Learning Datasets and Tasks for Drug Discovery and Development},
  author={Huang, Kexin and Fu, Tianfan and Gao, Wenhao and Zhao, Yu and Roohani, Yusuf and Leskovec, Jure},
  journal={Nature Chemical Biology},
  year={2022}
}

输出文件位置

默认输出到当前目录,或使用 --output 指定:

bash
python3 scripts/adme_predictor.py --smiles "CCO" -o ./output/adme_results.json

对于飞书兼容性,建议输出到白名单目录:

  • ~/.openclaw/media/adme-prediction/
  • ~/.openclaw/workspace/

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Adme Prediction AI skill do?

ADME 性质预测工具。预测分子的吸收、分布、代谢、排泄性质,包括 Caco-2 通透性、PAMPA、HIA、Pgp 抑制、生物利用度、亲脂性等。使用 Morgan 指纹 + Random Forest/XGBoost。当用户提到 ADME 预测、药物性质、通透性、吸收、代谢等时触发。

Why use Adme Prediction on TypingMind?

Because you install it once and use it with any model. Adme Prediction is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Adme Prediction in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/InternScience/ChemClaw/tree/main/skills/adme-prediction. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Adme Prediction?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Adme Prediction?

As many as you like. As long as a model supports skills, you can use Adme Prediction with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Adme Prediction AI skill free?

Yes. It is published on GitHub by InternScience under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇