igashov / DiffLinker

DiffLinker: Equivariant 3D-Conditional Diffusion Model for Molecular Linker Design
MIT License
290 stars 40 forks source link

sascorer.py calls removed RDkit module - ModuleNotFoundError: No module named 'rdkit.six' #11

Open rsherhod opened 4 months ago

rsherhod commented 4 months ago

delinker_utils/sascorer.py is calling a module of RDKit that was removed in Release_2024.03.1 See change log: https://github.com/rdkit/rdkit/blob/master/ReleaseNotes.md#code-removed-in-this-release-1

I encountered this when trying to run one of your case studies:

$ python ./DiffLinker/generate_with_protein.py \
    --fragments 3hz1_modified_fragments_obabel.sdf \
    --protein 3hz1_protein.pdb \
    --output samples \
    --model models/pockets_difflinker_full_given_anchors.ckpt \
    --linker_size models/zinc_size_gnn.ckpt \
    --anchors 12,22 \
    --n_samples 1000 \
    --max_batch_size 16 \
    --random_seed 1
Traceback (most recent call last):
  File "[...]/DiffLinker/generate_with_protein.py", line 14, in <module>
    from src.lightning import DDPM
  File "[...]/DiffLinker/src/lightning.py", line 7, in <module>
    from src import metrics, utils, delinker
  File "[...]/DiffLinker/src/delinker.py", line 7, in <module>
    from src.delinker_utils import sascorer, calc_SC_RDKit
  File "[...]/DiffLinker/src/delinker_utils/sascorer.py", line 22, in <module>
    from rdkit.six.moves import cPickle
ModuleNotFoundError: No module named 'rdkit.six'
ydzdfci commented 4 months ago

in sascorer.py you can change from rdkit.six.moves import cPickle to import pickle, then in line 39, change _fscores = cPickle.load(gzip.open('%s.pkl.gz' % name)) to _fscores = pickle.load(gzip.open('%s.pkl.gz' % name))