ChroCompare predicts whether two compounds can be adequately separated on a given chromatographic method, and helps identify which of several available methods is most likely to succeed. For each candidate column it predicts the retention factor of both compounds and, from a calibrated distribution of model errors, a probability that the pair will be separated within a required region and by a required margin. This supports choosing the most promising chromatographic method for a separation, as well as assigning likely elution order and peak identity.
This repository contains the code used to train the retention-factor models,
calibrate the separation-probability predictions, and reproduce the pairwise
test-set evaluation described in the accompanying manuscript
(DRAFT18_paper.pdf).
- Python 3.9+ (developed and tested with CPython; no OS-specific dependencies)
- RDKit (descriptor calculation)
- pandas, numpy, scipy
- scikit-learn (
RandomForestRegressor) - cloudpickle
- tqdm
No requirements.txt / dependency pinning is included yet — see the note in
CONTRIBUTING.md about the project's current maturity level.
| File | Purpose |
|---|---|
generate_fingerprints.py |
Calculates normalised physicochemical descriptor fingerprints for a set of SMILES strings, using the descriptors and normalisation constants in physico_descs.csv. |
generate_calibration.py |
Trains a random forest retention-factor model per chromatographic column (as listed in columns.csv) and builds the calibration PDF/CDF used to turn a pair of predictions into a separation probability. Saves models to ./Models/ and calibration data to ./CalibrationData/. |
ChroCompare.py |
Core prediction function (compare): given two fingerprints, returns the predicted retention factor of each on every column and the probability of separation, plus the best column overall. |
testing.py |
Runs compare() for every pair of compounds in a held-out test set and writes a detailed per-pair results file (results.csv), including comparisons against two "naive" (non-probabilistic) baseline strategies. |
run_single.py |
Runs the full pipeline for a single pair of SMILES strings, without needing a pre-built dataset file. See "Usage" below. |
analysis.py, percentage_plot.py, AUC_curve.py |
Analyse and plot the results produced by testing.py (calibration curves, ROC/AUC, method-recommendation accuracy). |
columns.csv |
List of chromatographic columns/methods used, with their run length (used to normalise retention time to retention factor). |
physico_descs.csv |
List of RDKit physicochemical descriptors used as model input, with the mean/standard deviation used to normalise each one. |
-
Train models and calibration data (one-off, requires a labelled dataset with a
Fingerprintcolumn, as produced bygenerate_fingerprints.py, and one retention-time column per chromatographic method):python generate_calibration.py
This populates
./Models/and./CalibrationData/, which are required by everything below. -
Predict for a single pair of compounds:
python run_single.py "<SMILES_1>" "<SMILES_2>"
-
Evaluate on a full test set (a CSV with
SMILESandFingerprintcolumns, plus one retention-time column per method, asTEST_SET.csv):python testing.py
followed by
analysis.py,percentage_plot.py, andAUC_curve.pyto analyse and plot the resultingresults.csv.
If you use this code, please cite the accompanying manuscript (will attach).
Apache License 2.0 — see LICENSE.md.