mlp_synth / README.md
andreazhu's picture
Updated imports
40978d6 verified
|
Raw
History Blame Contribute Delete
2.2 kB
metadata
license: mit
tags:
  - PROTAC
  - drug-discovery
  - cheminformatics
  - regression
library_name: pytorch
pipeline_tag: tabular-regression

PROTAC Synthesizability — MLP

A PyTorch MLP that predicts the heavy-atom-count weighted synthesizability score (hac_weighted_score) of PROTAC molecules from SMILES. Nested 5×5 scaffold cross-validation, Optuna tuning. Mean CV R² = 0.598.

Files

  • mlp_v3_final.pt — network weights + architecture
  • mlp_v3_final.skops — fitted preprocessor + target transformer
  • mlp_v3_final_hparams.yaml — hyperparameters

(.pt and .skops are both required to load the model.)

Usage

Requires the project code: https://github.com/ribesstefano/PROTAC-Synthesizability

Install the package (editable) so protac_synth is importable, then:

from protac_synth.models.mlp.model import TorchMLPRegressor
from protac_synth.chem_utils import (
    standardize_all, compute_fingerprints, compute_descriptors,
)

model  = TorchMLPRegressor.load("mlp_v3_final")   # base path, no extension
smiles = ["O=C(O)c1ccccc1"]

# featurization consumes standardized RDKit Mols, not raw SMILES
mols  = standardize_all(smiles)
preds = model.predict(
    smiles,
    X_fp=compute_fingerprints(mols, model.fp_size, model.fp_radius),
    X_desc=compute_descriptors(mols),
)

Notes:

  • compute_fingerprints / compute_descriptors take pre-standardized Mols (from standardize_all), so each molecule is parsed and standardized once.
  • Using model.fp_size / model.fp_radius guarantees the fingerprint settings match those the model was trained with.

Dependencies

The .skops preprocessor and the RDKit descriptor set are version-sensitive — loading under a different version can raise InconsistentVersionWarning or produce a feature-count mismatch. Pin the versions the model was exported with:

  • scikit-learn==1.6.1 (the version the .skops pipeline was saved with)
  • rdkit — pin the exact version used at training; the RDKit descriptor list changes across releases, and a mismatch changes the descriptor column count.
  • skops, torch, numpy — pin to the training environment.

License

MIT