$npx -y skills add jinzhezenggroup/computational-chemistry-agent-skills --skill rdkit-reprA standardized CLI wrapper for RDKit molecular featurization workflows that handles physicochemical descriptor computation (outputs .csv) and molecular fingerprint extraction (outputs .npy or .csv), with built-in SMILES validation. USE WHEN you need to compute RDKit molecular des
| 1 | # RDKit Molecular Featurization |
| 2 | |
| 3 | This skill provides practical command patterns for **RDKit descriptor and fingerprint extraction** |
| 4 | using the standardized CLI wrapper: `<skill_path>/scripts/rdkit_helper.py`. |
| 5 | |
| 6 | Key behaviors (important for Agents): |
| 7 | |
| 8 | - The script prints **environment detection** (Python/RDKit/NumPy/Pandas) by default. |
| 9 | - Bad/illegal SMILES are **skipped and logged** to `*.skipped.csv` (no crash). |
| 10 | - Each run ends by printing **absolute output paths** like: |
| 11 | - `[RESULT] desc_csv=/abs/path.csv` |
| 12 | - `[RESULT] fp_npy=/abs/path.npy` |
| 13 | - `[RESULT] fp_csv=/abs/path.csv` |
| 14 | |
| 15 | ## Quick Start |
| 16 | |
| 17 | Check CLI help: |
| 18 | |
| 19 | ```bash |
| 20 | uv run <skill_path>/scripts/rdkit_helper.py --help |
| 21 | ``` |
| 22 | |
| 23 | Check subcommand help: |
| 24 | |
| 25 | ```bash |
| 26 | uv run <skill_path>/scripts/rdkit_helper.py desc --help |
| 27 | uv run <skill_path>/scripts/rdkit_helper.py fp --help |
| 28 | uv run <skill_path>/scripts/rdkit_helper.py list-desc --help |
| 29 | ``` |
| 30 | |
| 31 | Disable environment printing (optional): |
| 32 | |
| 33 | ```bash |
| 34 | uv run <skill_path>/scripts/rdkit_helper.py --no-env desc --smiles "CCO" --output out.csv |
| 35 | ``` |
| 36 | |
| 37 | ## Core Tasks |
| 38 | |
| 39 | ### 1) Compute physicochemical descriptors → .csv |
| 40 | |
| 41 | Single SMILES (default preset: `physchem`, 25 descriptors): |
| 42 | |
| 43 | ```bash |
| 44 | uv run <skill_path>/scripts/rdkit_helper.py desc \ |
| 45 | --smiles "CCO" \ |
| 46 | --output /tmp/CCO.desc.csv |
| 47 | ``` |
| 48 | |
| 49 | From CSV (default SMILES column is `smiles`): |
| 50 | |
| 51 | ```bash |
| 52 | uv run <skill_path>/scripts/rdkit_helper.py desc \ |
| 53 | --file data.csv \ |
| 54 | --smiles-col smiles \ |
| 55 | --output data.desc.csv |
| 56 | ``` |
| 57 | |
| 58 | From SMI: |
| 59 | |
| 60 | ```bash |
| 61 | uv run <skill_path>/scripts/rdkit_helper.py desc \ |
| 62 | --file molecules.smi \ |
| 63 | --output molecules.desc.csv |
| 64 | ``` |
| 65 | |
| 66 | Choose a descriptor preset: |
| 67 | |
| 68 | ```bash |
| 69 | # Lipinski drug-likeness (6 descriptors: MolWt, MolLogP, NumHDonors, ...) |
| 70 | uv run <skill_path>/scripts/rdkit_helper.py desc \ |
| 71 | --file data.csv --preset lipinski --output data.lipinski.csv |
| 72 | |
| 73 | # Extended physicochemical (25 descriptors, default) |
| 74 | uv run <skill_path>/scripts/rdkit_helper.py desc \ |
| 75 | --file data.csv --preset physchem --output data.physchem.csv |
| 76 | |
| 77 | # Topological / graph indices (56 descriptors: BalabanJ, BertzCT, Chi*, PEOE_VSA*, ...) |
| 78 | uv run <skill_path>/scripts/rdkit_helper.py desc \ |
| 79 | --file data.csv --preset topological --output data.topo.csv |
| 80 | |
| 81 | # All RDKit descriptors (~200 descriptors) |
| 82 | uv run <skill_path>/scripts/rdkit_helper.py desc \ |
| 83 | --file data.csv --preset all --output data.all_desc.csv |
| 84 | ``` |
| 85 | |
| 86 | Select specific descriptors (overrides `--preset`): |
| 87 | |
| 88 | ```bash |
| 89 | uv run <skill_path>/scripts/rdkit_helper.py desc \ |
| 90 | --file data.csv \ |
| 91 | --descriptors "MolWt,MolLogP,TPSA,NumHDonors,NumHAcceptors" \ |
| 92 | --output data.custom.csv |
| 93 | ``` |
| 94 | |
| 95 | Suppress merging back original CSV columns (output only smiles + descriptors): |
| 96 | |
| 97 | ```bash |
| 98 | uv run <skill_path>/scripts/rdkit_helper.py desc \ |
| 99 | --file data.csv --preset physchem --no-merge --output data.desc_only.csv |
| 100 | ``` |
| 101 | |
| 102 | ______________________________________________________________________ |
| 103 | |
| 104 | ### 2) Compute molecular fingerprints → .npy or .csv |
| 105 | |
| 106 | Available fingerprint types: |
| 107 | |
| 108 | | Type | Description | Default bits | |
| 109 | | --------------- | ---------------------------------------------------------- | ------------ | |
| 110 | | `morgan2` | Morgan circular FP radius 2 (ECFP4-like), bit vector | 2048 | |
| 111 | | `morgan3` | Morgan circular FP radius 3 (ECFP6-like), bit vector | 2048 | |
| 112 | | `morgan2_count` | Morgan radius-2 count vector | 2048 | |
| 113 | | `rdkit` | RDKit path-based FP, bit vector | 2048 | |
| 114 | | `maccs` | MACCS 167 structural keys (bit vector, `--nbits` ignored) | 167 | |
| 115 | | `topological` | Topological torsion FP (count vector, hashed to `--nbits`) | 2048 | |
| 116 | | `atompair` | Atom-pair FP (count vector, hashed to `--nbits`) | 2048 | |
| 117 | | `layered` | Layered substructure FP, bit vector | 2048 | |
| 118 | | `pattern` | SMARTS pattern FP, bit vector | 2048 | |
| 119 | |
| 120 | Single SMILES, output as NumPy array (.npy): |
| 121 | |
| 122 | ```bash |
| 123 | uv run <skill_path>/scripts/rdkit_helper.py |