forlilab / Meeko

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

retaining unique atom names in the .pdbqt file #47

Open alfredoq opened 1 year ago

alfredoq commented 1 year ago

hello,

when preparing a .pdbqt file I noticed that the unique atom name generated by RDKit are removed. An example below:

from rdkit import Chem from rdkit.Chem import AllChem

_smiles = "CCCCO" m = Chem.MolFromSmiles(smiles) m3d = Chem.AddHs(m)
AllChem.EmbedMolecule(m3d) pdbfile = Chem.MolToPDBBlock(m3d)

in this case _pdbfile contains:

HETATM 1 C1 UNL 1 -1.515 0.808 0.093 1.00 0.00 C
HETATM 2 C2 UNL 1 -0.734 -0.344 0.622 1.00 0.00 C
HETATM 3 C3 UNL 1 0.290 -0.899 -0.311 1.00 0.00 C
HETATM 4 C4 UNL 1 1.341 0.103 -0.717 1.00 0.00 C
HETATM 5 O1 UNL 1 2.046 0.592 0.381 1.00 0.00 O
HETATM 6 H1 UNL 1 -2.495 0.475 -0.327 1.00 0.00 H
HETATM 7 H2 UNL 1 -1.772 1.505 0.929 1.00 0.00 H
HETATM 8 H3 UNL 1 -1.014 1.393 -0.690 1.00 0.00 H
HETATM 9 H4 UNL 1 -1.445 -1.161 0.864 1.00 0.00 H
HETATM 10 H5 UNL 1 -0.203 -0.023 1.548 1.00 0.00 H
HETATM 11 H6 UNL 1 0.838 -1.695 0.263 1.00 0.00 H
HETATM 12 H7 UNL 1 -0.134 -1.413 -1.197 1.00 0.00 H
HETATM 13 H8 UNL 1 2.046 -0.435 -1.397 1.00 0.00 H
HETATM 14 H9 UNL 1 0.948 0.957 -1.266 1.00 0.00 H
HETATM 15 H10 UNL 1 1.801 0.136 1.204 1.00 0.00 H

with atoms having unique names. However after processing this RDKit molecule to get the corresponding .pdbqt file:

_preparator = MoleculePreparation() preparator.prepare(m3d) pdbqt_string = preparator.write_pdbqt_string() pdbqt_string_ready = pdbqt_string.replace('UNL','MOL')
ligand_file = '/home/fredy/Desktop/test.pdbqt'
with open(ligand_file,'w') as pdbqt_file: pdbqt_file.write(pdbqt_stringready)

I get:

REMARK SMILES CCCCO REMARK SMILES IDX 3 1 2 2 1 3 4 4 5 5 REMARK H PARENT 5 6 REMARK Flexibility Score: inf ROOT ATOM 1 C MOL 1 0.290 -0.899 -0.311 1.00 0.00 0.028 C ENDROOT BRANCH 1 2 ATOM 2 C MOL 1 -0.734 -0.344 0.622 1.00 0.00 -0.001 C ATOM 3 C MOL 1 -1.515 0.808 0.093 1.00 0.00 0.004 C ENDBRANCH 1 2 BRANCH 1 4 ATOM 4 C MOL 1 1.341 0.103 -0.717 1.00 0.00 0.156 C BRANCH 4 5 ATOM 5 O MOL 1 2.046 0.592 0.381 1.00 0.00 -0.396 OA ATOM 6 H MOL 1 1.801 0.136 1.204 1.00 0.00 0.210 HD ENDBRANCH 4 5 ENDBRANCH 1 4 TORSDOF 3

I revised preparator options looking for some keyword to retain unique atom names, however I was not able to find this feature. Is it possible to retain unique atom names in the .pdbqt file?

Thanks in advance for the support,

best