CDDLeiden / DrugEx

De Novo Drug Design with RNNs and Transformers
https://cddleiden.github.io/DrugEx/docs/
MIT License
119 stars 16 forks source link

Evaluator must be provided to filter molecules by desirability #4

Closed WANJIAL closed 8 months ago

WANJIAL commented 1 year ago

When I entered the following example command: drugex generate -b ${BASE_DIR} -i arl_test_graph.txt -g arl_graph_trans_RL -gpu 0 I encountered the following error:

raise ValueError('Evaluator must be provided to filter molecules by desirability')
ValueError: Evaluator must be provided to filter molecules by desirability
Generating molecules:   0%|                               | 0/1 [00:29<?, ?it/s]

What problem did this encounter?

martin-sicho commented 1 year ago

Hi, I am not that familiar with the CLI code, but maybe @HellevdM can pitch in here?

HellevdM commented 1 year ago

Hi, Thank you for pointing out this problem. There is indeed a mistake, I recently introduced a change in the generate CLI and forgot to update the example. Previously, the environment settings would be read from the metadata of the generator, however, this also overwrote many CLI arguments, which was not intended. Currently, the CLI arguments are used but the metadata is no longer used to read in environment settings. The default is to filter molecules by desirability, but no evaluator is set by default anymore, leading to the error you see.

As this is quite counterintuitive, I will revert this change ASAP so that the metadata is used again to read in environment settings and remove a number of CLI arguments that are not needed anymore. To fix the error temporarily, you can either set a predictor in the CLI arguments (-p models/qsar/A2AR_RandomForestClassifier/A2AR_RandomForestClassifier_meta.json -ta 'A2AR_RandomForestClassifier -sas) or add the --keep_undesired flag to the command. Please don't hesitate to let me know if this does not fix the problem or if you have any further questions.

HellevdM commented 8 months ago

Hi, I'm closing this issue. In the latest version, v3.4.6, the environment settings are now read from the predictor's meta file. Additionally, all command line examples have been updated.

Thank you again for bringing this issue to our attention.