mattragoza / LiGAN

Deep generative models of 3D grids for structure-based drug discovery
GNU General Public License v2.0
225 stars 44 forks source link

How to evaluate the model? #36

Closed Layne-Huang closed 2 years ago

mattragoza commented 2 years ago

You can use the command python3 generate.py config/generate.config to generate molecules for each of the selected test targets that were used for evaluations in our Chemical Science article.

Layne-Huang commented 2 years ago

Thank you very much for your kind reply!

May I ask how to count the evaluation metrics like validity, novelty, and uniqueness?

Thank you again.

Matheo-Chang commented 2 years ago

Excuse me, when I use the command python3 generate.py config/generate.config. It appears a problem as follows: Traceback (most recent call last): File "generate.py", line 48, in main(sys.argv[1:]) File "generate.py", line 41, in main debug=args.debug, File "/da1/home/changhaoyu/liGAN/liGAN/generating.py", line 98, in init **output_kws, File "/da1/home/changhaoyu/liGAN/liGAN/generating.py", line 671, in init self.metrics = pd.DataFrame(columns=columns).set_index(columns) File "/home/changhaoyu/anaconda3/envs/py37/lib/python3.7/site-packages/pandas/core/frame.py", line 392, in init mgr = init_dict(data, index, columns, dtype=dtype) File "/home/changhaoyu/anaconda3/envs/py37/lib/python3.7/site-packages/pandas/core/internals/construction.py", line 196, in init_dict nan_dtype) File "/home/changhaoyu/anaconda3/envs/py37/lib/python3.7/site-packages/pandas/core/dtypes/cast.py", line 1175, in construct_1d_arraylike_from_scalar dtype = dtype.dtype AttributeError: type object 'object' has no attribute 'dtype' How can I solve it?

mattragoza commented 2 years ago

@Layne-Huang I just added a script scripts/valid_novel_unique.py which can be used as follows:

(LiGAN) [mtragoza@dv002 LiGAN]$ python scripts/valid_novel_unique.py -h
usage: valid_novel_unique.py [-h] [--groupby GROUPBY] [-o OUT_FILE] data_root train_file metrics_file

positional arguments:
  data_root
  train_file
  metrics_file

optional arguments:
  -h, --help            show this help message and exit
  --groupby GROUPBY
  -o OUT_FILE, --out_file OUT_FILE
(LiGAN) [mtragoza@dv002 LiGAN]$ python scripts/valid_novel_unique.py data/crossdock2020/ data/it2_tt_0_lowrmsd_valid_mols_test0_1000.types DEMO.gen_metrics
Loading train set molecules
Loading generated molecules
     % valid  % novel  % unique
all
all    100.0    100.0     100.0
mattragoza commented 2 years ago

@Matheo-Chang I moved this to a separate issue #48.