Closed xuzhang5788 closed 3 years ago
Can I ask which branch you're using? I think I may have fixed this issue in the master branch.
@MorganCThomas Thank you for your quick reply. I used the default branch. I checked it today. It is the main branch.
Can you please try updating this to the master branch git pull origin master
(or however you've named the remote repo).
If you installed molscore in the environment using python setup_molscore.py install
you'll need to uninstall via pip uninstall molscore
and reinstall it. If you installed it using python setup_molscore.py develop
you should not need to re-install molscore.
Meanwhile, I still need to more thoroughly test the master branch for merging it to make it default.
I used python setup_molscore.py develop to install molscore. I tried git pull origin master, and then ran $ streamlit run molscore/config_generator.py. I got:
2021-09-02 10:34:09.446 Traceback (most recent call last):
File "/home/xzhang/miniconda3/envs/molscore/lib/python3.6/site-packages/streamlit/script_runner.py", line 350, in _run_script
exec(code, module.dict)
File "/home/xzhang/projects/MolScore/molscore/config_generator.py", line 10, in
Which version of RDKit are you running? It seems the function doesn't exist in older versions < 2019.03 (which may be the issue). I'll also specify this in the environment file for future use in the master branch which as I said I'll merge soon. Alternatively, if you don't need the Glide code you can comment out the lines referring to Glide in molscore/scoring_functions/init.py which should fix this issue temporarily.
I've updated the master branch to reflect this dependency.
If you pull the master branch now and start fresh it should work, I've just tested it on my Linux and it works fine. i.e., install the conda environment again and then install molscore again
Sorry. It still doesn't work.
First of all, I git clone the master branch and reinstalled molscore, I got:
2021-09-02 12:09:10.867 Traceback (most recent call last):
File "/home/xzhang/miniconda3/envs/molscore/lib/python3.6/site-packages/streamlit/script_runner.py", line 350, in _run_script
exec(code, module.dict)
File "/home/xzhang/projects/MolScore/molscore/config_generator.py", line 344, in st.selectbox
widgets with
key='0: sp_name'
.
To fix this, please make sure that the key
argument is unique for
each st.selectbox
you create.
Then I followed your direction to reinstall molscore main branch, I did the followings:
$conda env create -f molscore_environment.yml
$conda activate molscore
$python setup_molscore.py develop
$git pull origin master
$streamlit run molscore/config_generator.py
Then I got:
2021-09-02 12:20:57.828 Traceback (most recent call last):
File "/home/xzhang/miniconda3/envs/molscore/lib/python3.6/site-packages/streamlit/script_runner.py", line 350, in _run_script
exec(code, module.dict)
File "/home/xzhang/projects/MolScore_main/molscore/config_generator.py", line 10, in
I modified molscore/scoring_functions/init.py into
from molscore.scoring_functions.smina import SminaDock from molscore.scoring_functions.rocs import ROCS from molscore.scoring_functions.oedock import FRED from molscore.scoring_functions.tanimoto import TanimotoSimilarity from molscore.scoring_functions.reinvent_svm import ActivityModel from molscore.scoring_functions.descriptors import RDKitDescriptors from molscore.scoring_functions.substructure_filters import SubstructureFilters from molscore.scoring_functions.substructure_match import SubstructureMatch from molscore.scoring_functions.sklearn_model import SKLearnModel, EnsembleSKLearnModel from molscore.scoring_functions.rascore_xgb import RAScore_XGB from molscore.scoring_functions.chemprop import ChemPropModel
all_scoring_functions = [ ROCS,
SminaDock,
FRED,
RDKitDescriptors,
TanimotoSimilarity,
SubstructureFilters,
SubstructureMatch,
SKLearnModel,
EnsembleSKLearnModel,
RAScore_XGB,
ChemPropModel
]
run $streamlit run molscore/config_generator.py
I got:
2021-09-02 12:23:52.731 Traceback (most recent call last):
File "/home/xzhang/miniconda3/envs/molscore/lib/python3.6/site-packages/streamlit/script_runner.py", line 350, in _run_script
exec(code, module.dict)
File "/home/xzhang/projects/MolScore_main/molscore/config_generator.py", line 10, in
I'm quite confused as to the order of things you've done here. If you used the updated master branch you shouldn't see the first error (if you click master branch in GitHub and then look at config_generator.p, line 193, the code reads key=f'{key_i}: sp_modifier' instead. So you must be using the old installation of molscore still (did you uninstall the old one with pip uninstall molscore
?)
When installing the molscore_environment.yml, check the file to ensure that the rdkit version is specified (i.e. 'rdkit>=2019.03') in the dependencies, if it's not there, you're not using the most recent update.
Apologies for the last error, I should have commented out import molscore.scoring_functions.reinvent_svm import ActivityModel
. This uses a script that requires a specific older sklearn version that also required a hot fix, if you wish to use this specific model you can install the dependency here by running the bash script found here generative_models/reinvent/install_scikit-learn.sh). This script is only needed for running the older DRD2 SVM model published in the original REINVENT publication - which you may not be interested in.
Thank you for your reply. You are right. I git clone the master branch just before you update molscore_environment.yml. Maybe I will try it later
Refer to molscore/scoring_functions/init.py in the main branch I comment out
Then it works now. But I am not sure if those comment out lines will affect the performance.
Then it works now. But I am not sure if those comment-out lines will affect the performance. Anyways, many thanks
Okay, in that case I'll close the issue, you should be able un-comment GlideDock & GlideDockFromROCS for use (with a license) as soon you ensure the rdkit version is 2019.03 or newer.
You should be able to run ChemProp once you install it, see here https://github.com/chemprop/chemprop
You can now view your Streamlit app in your browser.
Local URL: http://localhost:8501 Network URL: http://192.168.0.25:8501
2021-08-31 15:32:27.169 Traceback (most recent call last): File "/home/xzhang/miniconda3/envs/molscore/lib/python3.6/site-packages/streamlit/script_runner.py", line 350, in _run_script exec(code, module.dict) File "/home/xzhang/projects/MolScore/molscore/config_generator.py", line 344, in
config['scoring']['metrics'] = [getspconfig(options=smetric_options, key_i=i) for i in range(ss.n_sp)]
File "/home/xzhang/projects/MolScore/molscore/config_generator.py", line 344, in
config['scoring']['metrics'] = [getspconfig(options=smetric_options, key_i=i) for i in range(ss.n_sp)]
File "/home/xzhang/projects/MolScore/molscore/config_generator.py", line 193, in getspconfig
key=f'{key_i}: sp_name')
File "/home/xzhang/miniconda3/envs/molscore/lib/python3.6/site-packages/streamlit/elements/selectbox.py", line 129, in selectbox
serializer=serialize_select_box,
File "/home/xzhang/miniconda3/envs/molscore/lib/python3.6/site-packages/streamlit/state/widgets.py", line 149, in register_widget
user_key,
streamlit.errors.DuplicateWidgetID: There are multiple identical
st.selectbox
widgets withkey='0: sp_name'
.To fix this, please make sure that the
key
argument is unique for eachst.selectbox
you create.