con un clic
pka-predictor
预测小分子的 pKa,支持 custom 启发式后端和 Uni-pKa 单文件权重后端(Bohrium notebook 路线)。
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Menú
预测小分子的 pKa,支持 custom 启发式后端和 Uni-pKa 单文件权重后端(Bohrium notebook 路线)。
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Basado en la clasificación ocupacional SOC
Extract structured chemical compound characterization data from chemistry supplementary material documents (PDF/Markdown). 从化学论文补充材料(PDF/Markdown)中提取结构化化合物表征数据。 Use when Kimi needs to extract compound properties including NMR spectra, HRMS, HPLC data, melting points, optical rotation, and yield information from chemistry research papers or supplementary materials. 支持提取NMR谱图、HRMS、HPLC数据、熔点、旋光度、产率等信息。 Supports both single compound extraction and batch extraction of all compounds. 支持单个化合物提取和批量提取所有化合物。
Convert Gaussian gjf input files to XYZ format. 将Gaussian gjf输入文件转换为XYZ格式。 Use when agent needs to convert molecular structure files from Gaussian input format (.gjf) to XYZ format for visualization or use with other computational chemistry software. 当智能体需要将Gaussian输入格式(.gjf)的分子结构文件转换为XYZ格式用于可视化或其他计算化学软件时使用。
Convert PDF files to Markdown using MinerU API. 使用MinerU API将PDF文件转换为Markdown格式。 Use when Kimi needs to extract structured text, images, tables, and formulas from PDF documents while preserving document layout and formatting. 适用于需要提取结构化文本、图片、表格和公式并保留文档布局的场景。 Supports batch conversion and outputs full.md with images/, JSON metadata, and other extracted assets. 支持批量转换,输出full.md、images/目录、JSON元数据等。 Now supports large PDFs (600+ pages) by automatic splitting and merging. 现已支持大文件(600+页)自动拆分和合并处理。
Extract DFT calculation coordinates from PDF files and generate Gaussian gjf files. 从PDF文件中提取DFT计算坐标并生成Gaussian gjf输入文件。 Supports batch processing with separate output folders for each PDF. 支持批量处理,每个PDF单独生成输出文件夹。
Predict and visualize MS/MS spectra from a single SMILES using the fioRa online app. Use when the user wants a mass spectrum, MGF/MSP output, or a plotted stick spectrum from SMILES, with optional custom Name, precursor type, collision energy, and instrument settings.
Predict liquid-phase ¹H and ¹³C NMR chemical shifts from a SMILES string using NMRNet (deep learning, SE(3)-Transformer). Outputs per-atom shift values (ppm) and Lorentzian-broadened spectrum PNG files.
| name | pka_predictor |
| description | 预测小分子的 pKa,支持 custom 启发式后端和 Uni-pKa 单文件权重后端(Bohrium notebook 路线)。 |
| trigger | ["pKa","酸度常数","电离常数","acidic pKa","basic pKa","macro pKa","microstate","protonation","deprotonation","质子化","去质子化"] |
预测小分子的 pKa,支持两类后端:
cd skills/pka-predictor
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
使用 Hugging Face CLI(推荐):
# 安装 huggingface_hub(如果尚未安装)
pip install huggingface_hub
# 下载模型权重文件
mkdir -p skills/pka-predictor/assets/Uni-pKa/uni-pka-ckpt_v2
hf download Lai-ao/uni-pka-ckpt_v2 t_dwar_v_novartis_a_b.pt \
--repo-type model \
--local-dir skills/pka-predictor/assets/Uni-pKa/uni-pka-ckpt_v2
# 下载模板文件(如果本地没有)
hf download Lai-ao/uni-pka-ckpt_v2 smarts_pattern.tsv \
--repo-type model \
--local-dir skills/pka-predictor/assets/Uni-pKa/uni-pka-ckpt_v2
hf download Lai-ao/uni-pka-ckpt_v2 simple_smarts_pattern.tsv \
--repo-type model \
--local-dir skills/pka-predictor/assets/Uni-pKa/uni-pka-ckpt_v2
或手动下载:
访问 https://huggingface.co/Lai-ao/uni-pka-ckpt_v2 下载以下文件到 assets/Uni-pKa/uni-pka-ckpt_v2/ 目录:
t_dwar_v_novartis_a_b.pt(~571MB,模型权重)smarts_pattern.tsv(SMARTS 模板)simple_smarts_pattern.tsv(简化 SMARTS 模板)# 测试 custom 后端
./scripts/run_with_venv.sh --smiles "CC(=O)O" --name "乙酸" --backend custom
# 测试 unipka 后端
./scripts/run_with_venv.sh --smiles "CC(=O)O" --name "乙酸" --backend unipka --cpu
当用户有以下需求时适合调用:
.smi / .txt / .csv / .json)适合本地快速使用,不依赖 Uni-pKa 环境。
输出主要是启发式 strongest acidic/basic pKa。
基于 Bohrium notebook 单权重流程,而不是 GitHub 仓库中 infer_pka.sh 的 5-fold 推理流程。
它的基本逻辑是:
因此,unipka 输出中最重要的是:
dominant_neutral_to_anion_pkadominant_cation_to_neutral_pkaall_predictions(每一步 from_charge -> to_charge)CC(=O)O一键安装(首次使用):
# 运行安装脚本(自动下载模型和模板文件)
./scripts/setup_models.sh
使用虚拟环境(推荐,支持 UniPKA 后端):
# 使用包装脚本(自动激活虚拟环境)
./scripts/run_with_venv.sh --smiles "CC(=O)O" --name "乙酸"
# unipka 后端(使用默认单文件权重与模板)
./scripts/run_with_venv.sh --smiles "CC(=O)O" --name "乙酸" --backend unipka --cpu
# 显式指定模型与模板
./scripts/run_with_venv.sh \
--smiles "CC(=O)O" \
--name "乙酸" \
--backend unipka \
--model "assets/Uni-pKa/uni-pka-ckpt_v2/t_dwar_v_novartis_a_b.pt" \
--template "assets/Uni-pKa/uni-pka-ckpt_v2/smarts_pattern.tsv" \
--cpu
直接运行(仅 Custom 后端):
# custom 后端
python3 scripts/predict_pka.py --smiles "CC(=O)O" --name "乙酸" --backend custom
方案 1:虚拟环境(推荐)
cd skills/pka-predictor
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
方案 2:Conda 环境
conda create -n pka-predictor python=3.12
conda activate pka-predictor
pip install -r requirements.txt
| 错误 | 解决方案 |
|---|---|
No module named 'pandas' | pip install pandas |
No module named 'scipy' | pip install scipy |
No module named 'torch' | pip install torch |
| RDKit 导入失败 | pip uninstall rdkit && pip install rdkit |
启用详细输出:
./scripts/run_with_venv.sh --smiles "CC(=O)O" --verbose
交互式调试:
from scripts.backends.custom_backend import CustomBackend
backend = CustomBackend()
result = backend.predict("CC(=O)O", "乙酸")
print(result)
检查依赖版本:
python3 -c "import rdkit, pandas, torch; print(rdkit.__version__, pandas.__version__, torch.__version__)"
基础测试:
# custom 后端
./scripts/run_with_venv.sh --smiles "CC(=O)O" --backend custom
# unipka 后端
./scripts/run_with_venv.sh --smiles "CC(=O)O" --backend unipka --cpu
批量测试:
cat > test_compounds.smi << EOF
CC(=O)O 乙酸
c1ccccc1O 苯酚
CCO 乙醇
EOF
./scripts/run_with_venv.sh --input test_compounds.smi --output results.json