forlilab / Meeko

Interfacing RDKit and AutoDock
GNU Lesser General Public License v2.1
169 stars 41 forks source link

Preserving original charges when converting MOL2 to PDBQT #98

Closed vwcruzeiro closed 2 months ago

vwcruzeiro commented 2 months ago

Dear Development Team,

I am currently working with a ligand in MOL2 format and utilizing the mk_prepare_ligand.py script to convert it into PDBQT format. I have encountered an issue where the script does not retain the original charges specified within the MOL2 file; instead, it assigns new charges during the conversion process.

Would it be possible to modify the script or use a parameter that instructs it to preserve the original charges from the MOL2 file? Your assistance in resolving this matter would be greatly appreciated.

Thank you for your support and dedication.

diogomart commented 2 months ago

That should be possible, we'll look into it as this sounds particularly useful. However, meeko relies on RDKit, and RDKit doesn't like all flavors of MOL2. Would you be comfortable carrying the charges using SDF? I thinkt RDKit and OpenFF developers agreed on a spec that uses atom or molecule properties. Asking because not supporting MOL2 at all has crossed my mind.

rwxayheee commented 2 months ago

Hi @vwcruzeiro This seems to be a known issue with RDKit according to the Usage Notes in README. You can still process a ligand from MOL2 format but will need to manually assign the formal charge. In addition to the posts mentioned, this discussion might be helpful with an example by the RDKit dev. After you assign the formal charges you should be able to generate the PDBQT following the guidance from here for your rdkit_molecule_3D_with_Hs

diogomart commented 2 months ago

Added in 926f409637f6c6d61e97578656907ce44666e45e, use --charge_model from_mol2. You'll need to clone the repo and install locally.

vwcruzeiro commented 2 months ago

@diogomart , I cannot thank you enough for including this functionality so quickly! I tested it and it seems to be working.