coleygroup / molpal

active learning for accelerated high-throughput virtual screening
MIT License
159 stars 36 forks source link

[QUESTION]: Recommended paramaters for molecule screen #29

Closed finlayiainmaclean closed 2 years ago

finlayiainmaclean commented 2 years ago

What are you trying to do? Hi, thanks for your work with molpal and pyscreener! I wish to perform a screen over the 13M clean drug-like molecules in ZINC12, I was wondering if you could recommend the optimum parameters to use? For a library this size, should I use the cluster flag? I'm looking to get the top 100k hits, what k, window and delta should I set? Please see the config printout from my current setup. The abstract of the paper says "we can identify 94.8% or 89.3% of the top-50 000 ligands in a 100M member library after testing only 2.4% ", so I set the budget to 2% of my library size (260,000). I would also like the top hits to include molecules from multiple local maxima, and not just all the hits from the global maximum, which parameters encourage exploration over exploitation?

Thanks for your time!

MolPAL will be run with the following arguments:
  batch_sizes: [100]
  budget: 260000
  cache: False
  checkpoint_file: None
  chkpt_freq: 0
  cluster: False
  config: None
  cxsmiles: False
  ddp: False
  delimiter: ,
  delta: 0.01
  epsilon: 0.0
  fingerprint: pair
  fps: libraries/zinc_13m.h5
  init_size: 100
  invalid_idxs: []
  k: 100000
  length: 2048
  libraries: ['libraries/zinc_13m.txt']
  max_depth: 8
  max_iters: 10000
  metric: greedy
  min_samples_leaf: 1
  minimize: True
  model: rf
  model_seed: None
  n_estimators: 100
  ncpu: 1
  objective: docking
  objective_config: config/murd.ini
  output_dir: zinc_13m
  pool: eager
  precision: 32
  previous_scores: None
  radius: 2
  retrain_from_scratch: True
  scores_csvs: None
  seed: None
  smiles_col: 0
  test_batch_size: None
  title_line: True
  verbose: 0
  window_size: 10
  write_final: True
  write_intermediate: True
davidegraff commented 2 years ago

Hi @finlayiainmaclean,

Thanks for the question. k, window, and delta are all parameters that control the dynamic stopping criterion. Namely, if the difference between the average of the current top-k molecules does not exceed the rolling average of the top-k molecules from the window most recent iterations by at least some fraction delta, then MolPAL should stop exploration. Alternatively, if you would like to guarantee stopping by the time you've explored 2M molecules, then you can also set a maximum exploration budget, either as a fraction between 0-1 (2/13 in this case) or as an absolute number of molecules (2M, also in this case). For most of my use-cases, I usually set window to be sufficiently large so that I guarantee that I explore for the set amount of max-iterations or fully exhaust my budget. I.e., if window=10 but max-iter=5 then you can't determine a rolling average with which to trigger early stopping.

For your use case I might do the following:

k=100000
budget=0.02
window=10

You'll also need to decide how you would like to acquire molecules, i.e., init-size and --batch-size. We generally did a 1+5 split, where we acquired 1/6 of our total budget in our initialization batch and in each exploration batch. Practically this will look like --init-size=0.0033 --batch=size=0.0033 to get you to that. You could also spend less of your budget on initialization and put that towards exploration (e.g., --init-size=0.0025 --batch-size=0.0025.) In our cases this usually led to a higher enrichment factor ("sample efficiency",) but at the cost of more time spent on model (re)training and inference. I'd also generally recommend you use the --model mpn --conf-method mve --metric ucb as these were a generally robust hyperparameter set (c.f., figures 2/4 from the paper).

The last thing I'll say is that while we got great results on our test datasets from the paper, those are no guarantee of future quality. Every optimization is different, so you might find that your sample efficiencies are lower (or possibly higher) than those we showed in the paper. Hopefully, this was helpful, but let me know if you have any more questions!