AlgoMole / MolCRAFT

Implementation for ICML 2024 paper "MolCRAFT: Structure-Based Drug Design in Continuous Parameter Space"
Other
42 stars 4 forks source link

ReconLossMonitor is missing #3

Closed orgw closed 2 weeks ago

orgw commented 2 weeks ago

Hi, thanks for the code there are some issues for custom sampling code

  1. ReconLossMonitor seems to be missing.

  2. in default.yaml file should evaluation.ckpt_path be gone?

  3. line 267

    ckpts = glob.glob(os.path.join(cfg.accounting.checkpoint_dir, "complete"))

    best_ckpt = sorted(ckpts, key=lambda x: float(x.split("complete")[-1][:4]))[-1]

    this part returns nothing. so i changed to

    best_ckpt = "./checkpoints/last.ckpt"

  4. i removed reconlossmonitor and added val_freq in validationcallback... which was missing

        ValidationCallback(
            dataset=None,  # TODO: implement CrossDockGen & NewBenchmark
            atom_decoder=cfg.data.atom_decoder,
            atom_enc_mode=cfg.data.transform.ligand_atom_mode,
            atom_type_one_hot=False,
            single_bond=True,
            docking_config=cfg.evaluation.docking_config,
            val_freq=cfg.train.val_freq
    
        ),

Ithink sample_for_pocket needs to be fixed. for now i have the code running for a custom pdb, but currently getting poor generation results (lump of carbons)

for instance

23

C 0.214115143 0.108409405 -0.195690155 C 0.164110184 0.011476040 -0.109651566 C -0.065099716 -0.295134068 0.425556183 C -0.078313828 -0.167198658 -0.108057022 C 0.245813370 0.086417675 0.078857422 C -0.083972931 -0.184248447 -0.108453751 C 0.105867386 -0.115490913 -0.246013641 C -0.304323196 0.060392380 -0.351005554 C -0.148864746 0.097482204 -0.210437775 C -0.166894913 -0.051809311 0.183494568 C 0.111021042 -0.283643246 0.065307617 C -0.020961761 0.546407700 0.008531570 C -0.415521622 0.005795002 0.217208862 C 0.058902740 0.184230328 0.041841507 F 0.240030289 0.252028465 0.078256607 C -0.057777405 0.076941013 0.189619064 C -0.015632629 -0.138627529 0.075656891 C 0.228384018 -0.030953407 -0.202360153 C 0.009338379 -0.243238449 0.273071289 C -0.079238892 0.061812878 -0.072874069 C 0.250213623 -0.128890038 0.031322479 C -0.223791122 0.022377014 -0.035171509 C 0.032581329 0.125474930 -0.029033661

Atomu2014 commented 2 weeks ago

Hi,

  1. ReconLoss has been merged into ValidationCallback. code has been updated.

  2. In updated code, evaluation.ckpt_path is preserved. This is to specify checkpoint path for sampling in train_bfn.py.

  3. I think you are referring sample_for_pocket.py? This script will be updated with a interactable web app demo. Here is a temporaty link https://123ea23041908fc59d.gradio.live/, please try and see is there any other issues. Note that, you should click "generate" before visualize generated molecules.

  4. For now, you can use train_bfn.py as in https://github.com/AlgoMole/MolCRAFT/issues/1#issuecomment-2196554900, which has been tested and works well.

Thanks, yanru

orgw commented 2 weeks ago

Thanks for the feedback. i got it working for custom pdbs. Great work on your project, congratulations

Atomu2014 commented 2 weeks ago

Thanks for the feedback. i got it working for custom pdbs. Great work on your project, congratulations

Hi, sample_for_pocket_v2.py and app.py have been updated. Follow the instructions in README to see how to sample and host our demo locally.

Thanks, Yanru