guanjq / targetdiff

The official implementation of 3D Equivariant Diffusion for Target-Aware Molecule Generation and Affinity Prediction (ICLR 2023)
219 stars 34 forks source link

Affinity prediction via a complex structure? #1

Closed HeJunhong1107 closed 1 year ago

HeJunhong1107 commented 1 year ago

thanks for the share of this amazing work, and I wanna know that is there a way to predict the affinity via a complex structure?

guanjq commented 1 year ago

Hi,

Thank you for your interest in this work! Sure, I will clean up the binding affinity prediction related code and model checkpoints in the next few weeks. I will get back to you as soon as I'm done. Sorry for the long wait.

SaiKeshav commented 1 year ago

Hello, thank you for your work! Is there any update regarding the same? It would be of great help.

guanjq commented 1 year ago

Hi, sorry for the late response. I have updated the binding affinity prediction code just now. You can check Binding Affinity Prediction -- Inference part to predict affinity via a complex structure.

shreshthtuli commented 1 year ago

Hi. Thanks, but I am facing this issue when I run the inference model:

RuntimeError: Error(s) in loading state_dict for PropPredNet:
    size mismatch for ligand_atom_emb.weight: copying a param with shape torch.Size([256, 30]) from checkpoint, the shape in current model is torch.Size([256, 31]).

Any idea how to resolve this?

guanjq commented 1 year ago

It should be the rdkit version problem. In the expected rdkit version (2022.03), there are 8 hybridization types in total: names = { 'OTHER': 7, 'S': 1, 'SP': 2, 'SP2': 3, 'SP3': 4, 'SP3D': 5, 'SP3D2': 6, 'UNSPECIFIED': 0, }, but in the newer rdkit (like 2022.09), there is one more 'SP2D' type, which increases the number of atom features by 1. To solve this problem, you can either reinstall the rdkit with the older version or remap the hybridization types by absorbing 'SP2D' into 'SP2'.

shreshthtuli commented 1 year ago

Thanks! Downgrading rdkit fixed the issue!

Dornavineeth commented 1 year ago

Hi @guanjq , I am not able to replicate the results by re-training the EGNN model . However While using the pre-trained model I am able to replicate the results of RMSE: 1.316, MAE: 1.031, R^2 score: 0.633, Pearson: 0.797, Spearman: 0.782, mean/std: 6.412/1.621.

I tried to keep the all the hyper-parameters and datasets(/data/pdbbind_v2016/pocket_10_refined) by referring to the config found in the checkpoint shared and followed the readme to prepare the pockets and splits

My current results on the test set shared are RMSE: 3.082, MAE: 2.412, R^2 score: -1.014, Pearson: 0.513, Spearman: 0.562, mean/std: 7.769/3.195

Any Idea what might me going wrong in re-training?