Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep partial charges from mol2 ligand file #224

Closed
tcaceresm opened this issue Nov 5, 2024 · 3 comments
Closed

Keep partial charges from mol2 ligand file #224

tcaceresm opened this issue Nov 5, 2024 · 3 comments
Assignees

Comments

@tcaceresm
Copy link

Hi!
I converted a mol2 file (with partial charges) to pdbqt file using meeko. It works, but partial charges are different than mol2 file. When I use openbabel to perform the file convertion, the partial charges of pdbqt are exactly the same than mol2 (with exception of C-H bonds, as expected).
Am I missing some option to keep partial charges from initial file in meeko?
Thanks!

@diogomart
Copy link
Contributor

Hello,
We don't have this feature at the moment. But it's possible we will implement it in the future. You can always use the Python API to get the partial charges from the RDKit molecule and copy them to the Atom instances in meeko's MoleculeSetup. If all you need is to keep the charges on the non-polar hydrogens, you can run mk_prepare_ligand with option --merge_these_atom_types and don't pass any values to this option, then hydrogens are not merged.

@rwxayheee
Copy link
Contributor

Hi @tcaceresm
We have just implemented some way to take existing partial charges for ligand preparation, which includes MOL2 files. This feature is now available in the develop branch.

Sample input file:
212163792.mol2.txt

Example usage 1 (with command-line script)

mk_prepare_ligand.py -i 212163792.mol2 --charge_model read

Example usage 2 (In Python)

from meeko import MoleculePreparation
from meeko import PDBQTWriterLegacy
from rdkit import Chem

input_filename = "212163792.mol2"
output_filename = "212163792.pdbqt"
mol = Chem.MolFromMol2File(input_filename, removeHs=False)
mk_prep = MoleculePreparation(charge_model="read", charge_atom_prop="_TriposPartialCharge")
molsetup_list = mk_prep(mol)
molsetup = molsetup_list[0]
pdbqt_string = PDBQTWriterLegacy.write_string(molsetup)

with open(output_filename, "w") as f:
    f.write(pdbqt_string[0])

Please give it a try and let us know what you think ^^ feel free to comment or re-open this issue if we can be of further assistance

@tcaceresm
Copy link
Author

@rwxayheee hi!
I tested it with a couple of molecules and it works well!
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants