$npx -y skills add jinzhezenggroup/computational-chemistry-agent-skills --skill rdkit-confA standardized CLI wrapper for RDKit 3D/2D conformer generation that samples multiple conformers per molecule (ETKDGv3, default 10), optimizes each with a force field (MMFF94s/UFF), keeps the lowest-energy conformer, automatically falls back to 2D layout on total embedding failur
| 1 | # RDKit Conformer Generation |
| 2 | |
| 3 | This skill provides practical command patterns for **RDKit 3D/2D conformer generation** |
| 4 | using the standardized CLI wrapper: `<skill_path>/scripts/rdkit_conf_helper.py`. |
| 5 | |
| 6 | Key behaviors (important for Agents): |
| 7 | |
| 8 | - The script prints **environment detection** (Python/RDKit/Pandas) by default. |
| 9 | - **Multi-conformer sampling**: embeds `--num-confs` conformers (default 10) per molecule |
| 10 | via `EmbedMultipleConfs`, optimizes each with the chosen force field, and keeps the |
| 11 | **lowest-energy** one. Set `--num-confs 1` to revert to single-conformer behavior. |
| 12 | - **2D fallback**: if all 3D embedding attempts fail, `Compute2DCoords` is used instead |
| 13 | and a `[WARN]` line is printed to stderr for that molecule. |
| 14 | - Bad/illegal SMILES are **skipped entirely** and logged to `*.skipped.csv` (no crash). |
| 15 | - Molecules that fell back to 2D are **additionally logged** to `*.fallback.csv`. |
| 16 | - Each run ends with a summary line and **absolute output paths**: |
| 17 | - `[INFO] Done: <N_3d> 3D, <N_2d> 2D-fallback, <N_skip> skipped (total input: <N>)` |
| 18 | - `[RESULT] conf_sdf=/abs/path.sdf` |
| 19 | - `[RESULT] conf_xyz=/abs/path.xyz` |
| 20 | - `[RESULT] fallback_csv=/abs/path.fallback.csv` (only if any 2D fallbacks occurred) |
| 21 | - `[RESULT] skipped_csv=/abs/path.skipped.csv` (only if any SMILES were skipped) |
| 22 | |
| 23 | ## Quick Start |
| 24 | |
| 25 | Check CLI help: |
| 26 | |
| 27 | ```bash |
| 28 | uv run <skill_path>/scripts/rdkit_conf_helper.py --help |
| 29 | uv run <skill_path>/scripts/rdkit_conf_helper.py conf --help |
| 30 | ``` |
| 31 | |
| 32 | Disable environment printing (optional): |
| 33 | |
| 34 | ```bash |
| 35 | uv run <skill_path>/scripts/rdkit_conf_helper.py --no-env conf --smiles "CCO" --output out.sdf |
| 36 | ``` |
| 37 | |
| 38 | ## Core Tasks |
| 39 | |
| 40 | ### 1) Generate 3D conformers (SDF output, default) |
| 41 | |
| 42 | Single SMILES: |
| 43 | |
| 44 | ```bash |
| 45 | uv run <skill_path>/scripts/rdkit_conf_helper.py conf \ |
| 46 | --smiles "CCO" \ |
| 47 | --output /tmp/CCO.sdf |
| 48 | ``` |
| 49 | |
| 50 | Single SMILES with a custom molecule name: |
| 51 | |
| 52 | ```bash |
| 53 | uv run <skill_path>/scripts/rdkit_conf_helper.py conf \ |
| 54 | --smiles "c1ccccc1" \ |
| 55 | --name benzene \ |
| 56 | --output /tmp/benzene.sdf |
| 57 | ``` |
| 58 | |
| 59 | From CSV (default SMILES column: `smiles`): |
| 60 | |
| 61 | ```bash |
| 62 | uv run <skill_path>/scripts/rdkit_conf_helper.py conf \ |
| 63 | --file data.csv \ |
| 64 | --smiles-col smiles \ |
| 65 | --output data.sdf |
| 66 | ``` |
| 67 | |
| 68 | From CSV with a name column: |
| 69 | |
| 70 | ```bash |
| 71 | uv run <skill_path>/scripts/rdkit_conf_helper.py conf \ |
| 72 | --file data.csv \ |
| 73 | --smiles-col smiles \ |
| 74 | --name-col compound_id \ |
| 75 | --output data.sdf |
| 76 | ``` |
| 77 | |
| 78 | From SMI (second token per line is used as name automatically): |
| 79 | |
| 80 | ```bash |
| 81 | uv run <skill_path>/scripts/rdkit_conf_helper.py conf \ |
| 82 | --file molecules.smi \ |
| 83 | --output molecules.sdf |
| 84 | ``` |
| 85 | |
| 86 | ### 2) Control conformer sampling count |
| 87 | |
| 88 | Default (10 conformers sampled, lowest-energy kept): |
| 89 | |
| 90 | ```bash |
| 91 | uv run <skill_path>/scripts/rdkit_conf_helper.py conf \ |
| 92 | --file data.csv --output data.sdf |
| 93 | ``` |
| 94 | |
| 95 | Single conformer (fastest, least thorough): |
| 96 | |
| 97 | ```bash |
| 98 | uv run <skill_path>/scripts/rdkit_conf_helper.py conf \ |
| 99 | --file data.csv --num-confs 1 --output data.sdf |
| 100 | ``` |
| 101 | |
| 102 | Increase sampling for flexible or macrocyclic molecules: |
| 103 | |
| 104 | ```bash |
| 105 | uv run <skill_path>/scripts/rdkit_conf_helper.py conf \ |
| 106 | --file data.csv --num-confs 50 --output data.sdf |
| 107 | ``` |
| 108 | |
| 109 | ### 3) Choose force-field minimization |
| 110 | |
| 111 | MMFF94s (default, falls back to UFF if unavailable): |
| 112 | |
| 113 | ```bash |
| 114 | uv run <skill_path>/scripts/rdkit_conf_helper.py conf \ |
| 115 | --file data.csv --ff mmff94s --output data.mmff.sdf |
| 116 | ``` |
| 117 | |
| 118 | UFF (universal force field): |
| 119 | |
| 120 | ```bash |
| 121 | uv run <skill_path>/scripts/rdkit_conf_helper.py conf \ |
| 122 | --file data.csv --ff uff --output data.uff.sdf |
| 123 | ``` |
| 124 | |
| 125 | Skip force-field optimization (raw ETKDG geometry only): |
| 126 | |
| 127 | ```bash |
| 128 | uv run <skill_path>/scripts/rdkit_conf_helper.py conf \ |
| 129 | --file data.csv --ff none --output data.etkdg_raw.sdf |
| 130 | ``` |
| 131 | |
| 132 | ### 4) XYZ output |
| 133 | |
| 134 | ```bash |
| 135 | uv run <skill_path>/scripts/rdkit_conf_helper.py conf \ |
| 136 | --file data.csv \ |
| 137 | --format xyz \ |
| 138 | --output data.xyz |
| 139 | ``` |
| 140 | |
| 141 | ### 5) Tuning embedding for difficult molecules |
| 142 | |
| 143 | Large or macrocyclic molecules sometimes fail standard ETKDG; try random initial coordinates: |
| 144 | |
| 145 | ```bash |
| 146 | uv run <skill_path>/sc |