pablo-arantes / making-it-rain

Cloud-based molecular simulations for everyone
MIT License
377 stars 97 forks source link

ff.Minimize(maxIts=1000) does not work for the Protein_Ligand script #78

Closed totocotonio1 closed 10 months ago

totocotonio1 commented 11 months ago

Dear colleague

I would like to thank you for these helpful codes

bellow is the issue I got when I was running Protein_Ligand script

Please send me a solution

regards


Invariant Violation bad direction in linearSearch Violation occurred on line 240 in file /home/conda/feedstock_root/build_artifacts/rdkit_1687227557666/work/Code/Numerics/Optimizer/BFGSOpt.h Failed Expression: status >= 0



RuntimeError Traceback (most recent call last) in <cell line: 71>() 82 if (a.GetAtomicNum() > 1): 83 ff.MMFFAddPositionConstraint(a.GetIdx(), 0, 1.e4) ---> 84 ff.Minimize(maxIts=1000) 85 print(ff.CalcEnergy()) 86 charge_mol = Chem.rdPartialCharges.ComputeGasteigerCharges(hmol)

RuntimeError: Invariant Violation bad direction in linearSearch Violation occurred on line 240 in file Code/Numerics/Optimizer/BFGSOpt.h Failed Expression: status >= 0 RDKIT: 2023.03.2 BOOST: 1_78

pablo-arantes commented 10 months ago

HI @totocotonio1 ,

Sorry for my delay. Seems to me, you have an issue in the PDB file of your ligand. Can you please double-check your input files? I suggest comparing with our input example files (https://github.com/pablo-arantes/making-it-rain/tree/main/PROTEIN_LIGAND).

If the error persists, maybe the protonation could be the problem. Our notebook uses RDkit to add the hydrogens in the small molecules. It works well for aliphatic chains or aromatic rings, but when you submit a more complex molecule as a ligand, you can have issue in the Add_ligand_hydrogens step. If you have a complex molecule as a ligand, my suggestions are to submit the molecule already with the hydrogens in the right protonation state and then select no on Add_ligand_hydrogens option in the first cell.

I hope it helps.

Thank you.

Best,

Pablo

totocotonio1 commented 10 months ago

Hi @pablo-arantes

Thank you for your help,

I will try your suggestions then giving you a feedback

Thanks a lot for these magnificent codes

Best,

Rafik