isayevlab / pKa-ANI

Accurate prediction of protein pKa with representation learning
Other
41 stars 10 forks source link

missing scikit-learn dependency #2

Closed aozalevsky closed 1 year ago

aozalevsky commented 2 years ago

During the first run, the script complained about missing sklearn module:

(pka-ani) user@machine /path/pKa-ANI $ pkaani -i XXX.pdb
Loading pKa-ANI Models and ANI-2x...       
Traceback (most recent call last):            
  File "/path/miniconda3/envs/pka-ani/bin/pkaani", line 33, in <module>
    sys.exit(load_entry_point('pkaani==0.1.0', 'console_scripts', 'pkaani')())              
  File "/path/miniconda3/envs/pka-ani/lib/python3.10/site-packages/pkaani-0.1.0-py3.10.egg/pkaani/run.py", line 131, in main
    pkadict=calculate_pka(pdbfiles,writefile=True)
  File "/path/miniconda3/envs/pka-ani/lib/python3.10/site-packages/pkaani-0.1.0-py3.10.egg/pkaani/pkaani.py", line 30, in calculate_pka
    asp_model=joblib.load(os.path.join(os.path.dirname(__file__),'models/ASP_ani2x_FINAL_MODEL_F100.joblib'))
  File "/path/miniconda3/envs/pka-ani/lib/python3.10/site-packages/joblib/numpy_pickle.py", line 587, in load
    obj = _unpickle(fobj, filename, mmap_mode) 
  File "/path/miniconda3/envs/pka-ani/lib/python3.10/site-packages/joblib/numpy_pickle.py", line 506, in _unpickle
    obj = unpickler.load()                                                                                                                                                              
  File "/path/miniconda3/envs/pka-ani/lib/python3.10/pickle.py", line 1213, in load
    dispatch[key[0]](self)                    
  File "/path/miniconda3/envs/pka-ani/lib/python3.10/pickle.py", line 1538, in load_stack_global
    self.append(self.find_class(module, name))                                                                                                                                          
  File "/path/miniconda3/envs/pka-ani/lib/python3.10/pickle.py", line 1580, in find_class
    __import__(module, level=0)
  ModuleNotFoundError: No module named 'sklearn'      

After the installation, it also complains about possible sklearn version conflicts.

Loading pKa-ANI Models and ANI-2x...
/path/miniconda3/envs/pka-ani/lib/python3.10/site-packages/sklearn/base.py:329: UserWarning: Trying to unpickle estimator DecisionTreeRegressor from version 1.0.2 when using version 1.1.1. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:
https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations
  warnings.warn(
/path/miniconda3/envs/pka-ani/lib/python3.10/site-packages/sklearn/base.py:329: UserWarning: Trying to unpickle estimator RandomForestRegressor from version 1.0.2 when using version 1.1.1. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:
https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations
  warnings.warn(
Downloading ANI model parameters ...
Finished Loading.

Maybe it would be more convenient to provide the full .yml file with hardcoded versions.

HGokcan commented 2 years ago

Thanks for reporting the issue. The reason this error occurs is that there is no sklearn installed with the version the models are trained with. We have trained our models using the scikit-learn version 1.0.2. However, we will check and provide more detailed information on dependencies (maybe installation with a .yml file as you suggested)