DiffLinker icon indicating copy to clipboard operation
DiffLinker copied to clipboard

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

Open rsherhod opened this issue 1 year ago • 1 comments

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'

rsherhod avatar Apr 19 '24 08:04 rsherhod

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))

ydzdfci avatar Apr 29 '24 20:04 ydzdfci