一键导入
chemical-file-converter
化学文件格式转换工具。支持 .xyz, .gjf (Gaussian), .mol, .sdf, .pdb, .mol2 等格式互转。使用 Open Babel 或 RDKit 进行转换。当用户提供化学文件并要求转换格式、生成不同格式的文件、或提到文件转换时触发。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
化学文件格式转换工具。支持 .xyz, .gjf (Gaussian), .mol, .sdf, .pdb, .mol2 等格式互转。使用 Open Babel 或 RDKit 进行转换。当用户提供化学文件并要求转换格式、生成不同格式的文件、或提到文件转换时触发。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 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 | chemical-file-converter |
| description | 化学文件格式转换工具。支持 .xyz, .gjf (Gaussian), .mol, .sdf, .pdb, .mol2 等格式互转。使用 Open Babel 或 RDKit 进行转换。当用户提供化学文件并要求转换格式、生成不同格式的文件、或提到文件转换时触发。 |
化学文件格式转换技能,支持多种常见化学文件格式之间的互转。
| 格式 | 扩展名 | 说明 |
|---|---|---|
| XYZ | .xyz | 简单坐标格式,包含原子类型和 3D 坐标 |
| Gaussian Input | .gjf, .com | Gaussian 计算输入文件 |
| MDL Molfile | .mol | 单个分子的 2D/3D 结构 |
| Structure Data | .sdf, .sd | 多个分子的结构数据文件 |
| Protein Data Bank | .pdb | 生物大分子结构 |
| Tripos Mol2 | .mol2 | Tripos 分子格式 |
| SMILES | .smi, .smiles | 线性分子表示 |
| CML | .cml | 化学标记语言 (XML) |
| MOPAC | .mop, .zmt | MOPAC 输入文件 |
用户可以直接上传文件并要求转换:
把这个 xyz 文件转成 gjf 格式
将 molecule.mol 转换为 .sdf 格式
帮我生成 Gaussian 输入文件,用 B3LYP/6-31G* 方法
把 pdb 文件转成 xyz 坐标
批量转换这些文件为 .mol2 格式
# 基本转换
python3 scripts/convert_chemical.py input.xyz -o output.gjf
# 指定输出格式
python3 scripts/convert_chemical.py input.mol --format sdf
# 批量转换
python3 scripts/convert_chemical.py *.xyz --output-dir ./converted
# Gaussian 输入文件(指定方法和基组)
python3 scripts/convert_chemical.py input.xyz -o output.gjf \
--method B3LYP --basis 6-31G* --charge 0 --multiplicity 1
# 使用 Open Babel(如果可用)
python3 scripts/convert_chemical.py input.pdb -o output.xyz --use-openbabel
| 参数 | 简写 | 说明 | 默认值 |
|---|---|---|---|
--input | -i | 输入文件路径 | 必需 |
--output | -o | 输出文件路径 | 自动生成 |
--format | -f | 输出格式 (xyz/sdf/mol2/pdb/gjf 等) | 从输出文件扩展名推断 |
--output-dir | -d | 输出目录(批量模式) | 当前目录 |
--method | -m | Gaussian 计算方法 | B3LYP |
--basis | -b | Gaussian 基组 | 6-31G* |
--charge | 分子电荷 | 0 | |
--multiplicity | 自旋多重度 | 1 | |
--link0 | Gaussian Link0 命令(如 %mem=4GB) | 自动 | |
--use-openbabel | 强制使用 Open Babel | 自动检测 | |
--use-rdkit | 强制使用 RDKit | 自动检测 |
用户上传化学文件后,自动识别文件格式:
# 根据扩展名识别格式
.xyz → xyz
.gjf/.com → gaussian
.mol → mdl
.sdf → sdf
.pdb → pdb
.mol2 → mol2
根据目标格式选择合适的转换引擎:
| 转换类型 | 推荐引擎 | 说明 |
|---|---|---|
| xyz ↔ mol/sdf | RDKit | 支持 3D 坐标 |
| pdb ↔ xyz | Open Babel | 生物大分子支持好 |
| 任意 → gjf | 内置脚本 | 可自定义 Gaussian 参数 |
| 任意格式互转 | Open Babel | 支持 100+ 格式 |
对于 .gjf 格式,可以自定义计算参数:
%chk=molecule.chk
%mem=4GB
%nproc=4
#p B3LYP/6-31G* opt freq
分子标题
电荷 多重度
原子坐标
...
$ python3 convert_chemical.py ethanol.xyz -o ethanol.gjf
✓ 已读取:ethanol.xyz (9 原子)
✓ 已生成:ethanol.gjf (Gaussian 输入,B3LYP/6-31G*)
$ python3 convert_chemical.py *.mol --output-dir ./sdf_output
✓ 已转换:mol_1.mol → sdf_output/mol_1.sdf
✓ 已转换:mol_2.mol → sdf_output/mol_2.sdf
✓ 已转换:mol_3.mol → sdf_output/mol_3.sdf
完成:3/3 成功
$ python3 convert_chemical.py input.xyz -o custom.gjf \
--method wB97XD --basis def2TZVP --charge -1 --multiplicity 2 \
--link0 "%mem=8GB,%nproc=8"
✓ 已生成:custom.gjf (wB97XD/def2TZVP, 阴离子,双重态)
pip install rdkit
# Open Babel(支持更多格式)
conda install -c conda-forge openbabel
# 或
pip install openbabel-wheel
# ASE(原子模拟环境,支持更多量子化学格式)
pip install ase
# 检查 RDKit
python3 -c "from rdkit import Chem; print('RDKit OK')"
# 检查 Open Babel
obabel -L formats | head -20
# 检查 ASE
python3 -c "import ase; print('ASE OK')"
9
乙醇分子
C 0.000000 0.000000 0.000000
C 1.500000 0.000000 0.000000
O 2.000000 1.200000 0.000000
H -0.300000 -1.000000 0.000000
...
%chk=molecule.chk
%mem=4GB
%nproc=4
#p B3LYP/6-31G* opt freq
乙醇优化和频率计算
0 1
C 0.000000 0.000000 0.000000
C 1.500000 0.000000 0.000000
O 2.000000 1.200000 0.000000
...
Mrv2014 01012021
9 8 0 0 0 0 999 V2000
0.0000 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
1.5000 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
...
1 2 1 0 0 0 0
2 3 1 0 0 0 0
...
M END
A: 某些格式转换可能涉及坐标变换(如内坐标↔笛卡尔坐标)。使用 --use-openbabel 通常能保持坐标一致。
A: 检查:
A: 检查失败文件的格式是否正确。某些文件可能包含不支持的原子类型或格式错误。
A: 对于 PDB 文件,建议使用 Open Babel 或 ASE:
obabel protein.pdb -o xyz -O protein.xyz
# 1. 转换格式
python3 scripts/convert_chemical.py input.xyz -o output.mol
# 2. 生成 2D 结构图
python3 ../mol-2d-viewer/scripts/mol_2d_viewer.py --input output.mol --output structure.png
# 1. 从 Gaussian 文件提取坐标
python3 scripts/convert_chemical.py input.gjf -o output.xyz
# 2. 生成 3D 可视化
python3 ../mol-3d-viewer/scripts/mol_3d_viewer.py --smiles "CCO" --output ethanol_3d
# 1. 从文件提取 SMILES
python3 scripts/convert_chemical.py input.mol -o output.smiles
# 2. 转换名称为 SMILES
python3 ../iupac-to-smiles/scripts/iupac_to_smiles.py --name "ethanol" --output name_result.json
| 错误 | 说明 | 解决方案 |
|---|---|---|
Format not supported | 不支持的格式 | 检查扩展名,使用 --format 明确指定 |
RDKit error | RDKit 转换失败 | 尝试 --use-openbabel |
Open Babel not found | 未安装 Open Babel | 安装:conda install openbabel |
Invalid Gaussian parameters | Gaussian 参数错误 | 检查方法和基组名称 |
File read error | 文件读取失败 | 检查文件编码和格式 |
| 分子大小 | 转换时间 (RDKit) | 转换时间 (Open Babel) |
|---|---|---|
| 小分子 (<20 原子) | <0.1s | <0.2s |
| 中等分子 (20-50 原子) | 0.1-0.5s | 0.2-1s |
| 大分子 (50-200 原子) | 0.5-2s | 1-5s |
| 蛋白质 (>200 原子) | 不支持 | 5-30s |
默认输出到输入文件同目录,或使用 --output-dir 指定:
python3 scripts/convert_chemical.py input.xyz -o ./output/converted.gjf
对于飞书兼容性,建议输出到白名单目录:
~/.openclaw/media/chemical-converter/~/.openclaw/workspace/