Git Product home page Git Product logo

meeko's Introduction

Meeko: preparation of small molecules for AutoDock

API stability PyPI version fury.io

Meeko reads an RDKit molecule object and writes a PDBQT string (or file) for AutoDock-Vina and AutoDock-GPU. It converts the docking output to RDKit molecules and SD files, without loss of bond orders.

Meeko is developed by the Forli lab at the Center for Computational Structural Biology (CCSB) at Scripps Research.

Usage notes

Meeko does not calculate 3D coordinates or assign protonation states. Input molecules must have explicit hydrogens.

Sampling of macrocycle conformers (paper) is enabled by default.

SDF format strongly preferred over Mol2. See this discussion and RDKit issues 1755 and 917.

API changes in v0.5

Class MoleculePreparation no longer has method write_pdbqt_string(). Instead, MoleculePreparation.prepare() returns a list of MoleculeSetup objects that must be passed, individually, to PDBQTWriterLegacy.write_string().

from meeko import MoleculePreparation
from meeko import PDBQTWriterLegacy

preparator = MoleculePreparation()
mol_setups = preparator.prepare(rdkit_molecule_3D_with_Hs)
for setup in mol_setups:
    pdbqt_string, is_ok, error_msg = PDBQTWriterLegacy.write_string(setup)
    if is_ok:
        print(pdbqt_string, end="")

Argument keep_nonpolar_hydrogens is replaced by merge_these_atom_types, both in the Python interface and for script mk_prepare_ligand.py. The default is merge_these_atom_types=("H",), which merges hydrogens typed "H", keeping the current default behavior. To keep all hydrogens, set merge_these_atom_types to an empty list when initializing MoleculePreparation, or pass no atom types to --merge_these_atom_types from the command line:

mk_prepare_ligand.py -i molecule.sdf --merge_these_atom_types

Dependencies

  • Python (>=3.5)
  • Numpy
  • Scipy
  • RDKit
  • ProDy (optionally, for covalent docking)

Conda or Miniconda can install the dependencies:

conda install -c conda-forge numpy scipy rdkit
pip install prody # optional. pip recommended at http://prody.csb.pitt.edu/downloads/

Installation (from PyPI)

$ pip install meeko

If using conda, pip installs the package in the active environment.

Installation (from source)

You'll get the develop branch, which may be ahead of the latest release.

$ git clone https://github.com/forlilab/Meeko
$ cd Meeko
$ pip install .

Optionally include --editable. Changes in the original package location take effect immediately without the need to run pip install . again.

$ pip install --editable .

Examples using the command line scripts

1. make PDBQT files

AutoDock-GPU and Vina read molecules in the PDBQT format. These can be prepared by Meeko from SD files, or from Mol2 files, but SDF is strongly preferred.

mk_prepare_ligand.py -i molecule.sdf -o molecule.pdbqt
mk_prepare_ligand.py -i multi_mol.sdf --multimol_outdir folder_for_pdbqt_files

2. convert docking results to SDF

AutoDock-GPU and Vina write docking results in the PDBQT format. The DLG output from AutoDock-GPU contains docked poses in PDBQT blocks. Meeko generates RDKit molecules from PDBQT files (or strings) using the SMILES string in the REMARK lines. The REMARK lines also have the mapping of atom indices between SMILES and PDBQT. SD files with docked coordinates are written from RDKit molecules.

mk_export.py molecule.pdbqt -o molecule.sdf
mk_export.py vina_results.pdbqt -o vina_results.sdf
mk_export.py autodock-gpu_results.dlg -o autodock-gpu_results.sdf

Making RDKit molecules from SMILES is safer than guessing bond orders from the coordinates, specially because the PDBQT lacks hydrogens bonded to carbon. As an example, consider the following conversion, in which OpenBabel adds an extra double bond, not because it has a bad algorithm, but because this is a nearly impossible task.

$ obabel -:"C1C=CCO1" -o pdbqt --gen3d | obabel -i pdbqt -o smi
[C]1=[C][C]=[C]O1

Python tutorial

1. making PDBQT strings for Vina or for AutoDock-GPU

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

input_molecule_file = "example/BACE_macrocycle/BACE_4.sdf"

# there is one molecule in this SD file, this loop iterates just once
for mol in Chem.SDMolSupplier(input_molecule_file, removeHs=False):
    preparator = MoleculePreparation()
    mol_setups = preparator.prepare(mol)
    for setup in mol_setups:
        setup.show() # optional
        pdbqt_string = PDBQTWriterLegacy.write_string(setup)

At this point, pdbqt_string can be written to a file for docking with AutoDock-GPU or Vina, or passed directly to Vina within Python using set_ligand_from_string(pdbqt_string). For context, see the docs on using Vina from Python.

2. RDKit molecule from docking results

from meeko import PDBQTMolecule
from meeko import RDKitMolCreate

fn = "autodock-gpu_results.dlg"
pdbqt_mol = PDBQTMolecule.from_file(fn, is_dlg=True, skip_typing=True)
rdkitmol_list = RDKitMolCreate.from_pdbqt_mol(pdbqt_mol)

The length of rdkitmol_list is one if there are no sidechains and only one ligand was docked. If multiple ligands and/or sidechains are docked simultaneously, each will be an individual RDKit molecule in rdkitmol_list. Sidechains are truncated at the C-alpha. Note that docking multiple ligands simultaneously is only available in Vina, and it differs from docking multiple ligands one after the other. Each failed creation of an RDKit molecule for a ligand or sidechain results in a None in rdkitmol_list.

For Vina's output PDBQT files, omit is_dlg=True.

pdbqt_mol = PDBQTMolecule.from_file("vina_results.pdbqt", skip_typing=True)
rdkitmol_list = RDKitMolCreate.from_pdbqt_mol(pdbqt_mol)

When using Vina from Python, the output string can be passed directly. See the docs for context on the v object.

vina_output_string = v.poses()
pdbqt_mol = PDBQTMolecule(vina_output_string, is_dlg=True, skip_typing=True)
rdkitmol_list = RDKitMolCreate.from_pdbqt_mol(pdbqt_mol)

3. Initializing MoleculePreparation from a dictionary (or JSON)

This is useful for saving and loading configuration files with json.

import json
from meeko import MoleculePreparation

mk_config = {"hydrate": True} # any arguments of MoleculePreparation.__init__
print(json.dumps(mk_config), file=open('mk_config.json', 'w'))
with open('mk_config.json') as f:
    mk_config = json.load(f)
preparator = MoleculePreparation.from_config(mk_config)

The command line tool mk_prepare_ligand.py can read the json files using option -c or --config.

Possibly useful configurations of MoleculePreparation

Here we create an instance of MoleculePreparation that attaches pseudo waters to the ligand (see paper on hydrated docking), keeps macrocycles rigid (generally a bad idea), and keeps conjugated bonds and amide bonds rigid. By default, most amides are kept rigid, except for tertiary amides with different substituents on the nitrogen.

preparator = MoleculePreparation(
    hydrate=True,
    rigid_macrocycles=True,
    rigidify_bonds_smarts = ["C=CC=C", "[CX3](=O)[NX3]"],
    rigidify_bonds_indices = [(1, 2), (0, 2)],
)

The same can be done with the command line script. Note that indices of the atoms in the SMARTS are 0-based for the Python API but 1-based for the command line script:

mk_prepare_ligand.py\
    --hydrate\
    --rigid_macrocycles\
    --rigidify_bonds_smarts "C=CC=C"\
    --rigidify_bonds_indices 2 3\
    --rigidify_bonds_smarts "[CX3](=O)[NX3]"\
    --rigidify_bonds_indices 1 3

Docking covalent ligands as flexible sidechains

The input ligand must be the product of the reaction and contain the atoms of the flexible sidechain up to (and including) the C-alpha. For example, if the ligand is an acrylamide (smiles: C=CC(=O)N) reacting with a cysteine (sidechain smiles: CCS), then the input ligand for Meeko must correspond to smiles CCSCCC(=O)N.

Meeko will align the ligand atoms that match the C-alpha and C-beta of the protein sidechain. Options --tether_smarts and --tether_smarts_indices define these atoms. For a cysteine, --tether_smarts "SCC" and --tether_smarts_indices 3 2 would work, although it is safer to define a more spefic SMARTS to avoid matching the ligand more than once. The first index (3 in this example) defines the C-alpha, and the second index defines the C-beta.

For the example in this repository, which is based on PDB entry 7aeh, the following options prepare the covalently bound ligand for tethered docking:

cd example/covalent_docking

mk_prepare_ligand.py\
    -i ligand_including_cys_sidechain.sdf\
    --receptor protein.pdb\
    --rec_residue ":CYS:6"\
    --tether_smarts "NC(=O)C(O)(C)SCC"\
    --tether_smarts_indices 9 8\
    -o prepared.pdbqt

Reactive Docking

1. Prepare protein with waterkit

Follow wk_prepare_receptor.py instructions and run with --pdb. The goal of this step is to perform essential fixes to the protein (such as missing atoms), to add hydrogens, and to follow the Amber naming scheme for atoms and residues, e.g., HIE or HID instead of HIS.

2. Prepare protein pdbqt

Here, wk.pdb was written by waterkit. Here, wk.pdb was written by waterkit. The example below will center a gridbox of specified size on the given reactive residue.

   $ mk_prepare_receptor.py\
    --pdb wk.pdb\
    -o receptor.pdbqt\
    --flexres " :ARG:348"\
    --reactive_flexres " :SER:308"
    --reactive_flexres " :SER:308"\
    --box_center_on_reactive_res\
    --box_size 40 40 40  # x y z (angstroms)

A manual box center can be specified with --box_center. Reactive parameters can also be modified:

  --r_eq_12 R_EQ_12     r_eq for reactive atoms (1-2 interaction)
  --eps_12 EPS_12       epsilon for reactive atoms (1-2 interaction)
  --r_eq_13_scaling R_EQ_13_SCALING
                        r_eq scaling for 1-3 interaction across reactive atoms
  --r_eq_14_scaling R_EQ_14_SCALING
                        r_eq scaling for 1-4 interaction across reactive atoms

Receptor preparation can't handle heteroatoms for the moment. Also nucleic acids, ions, and post-translational modifications (e.g. phosphorilation) are not supported. Only the 20 standard amino acids can be parsed, and it is required to have Amber atom names and hydrogens. No atoms can be missing.

3. Run autogrid

Make affinity maps for the _rigid.pdbqt part of the receptor. Make affinity maps for the _rigid.pdbqt part of the receptor. mk_prepare_receptor.py will prepare the GPF for you.

4. Write ligand PDBQT

mk_prepare_ligand.py -i sufex1.sdf --reactive_smarts "S(=O)(=O)F" --reactive_smarts_idx 1 -o sufex1.pdbqt\

5. Configure AD-GPU for reactive docking

For reactive docking there are two options that need to be passed to AutoDock-GPU: For reactive docking there are an additional option that needs to be passed to AutoDock-GPU: console --import_dpf

The --derivtype option, if needed, was written by mk_prepare_receptor.py to a file suffixed with .derivtype.

The filename to be passed to --import_dpf was written by mk_prepare_receptor.py and it is suffixed with reactive_config.

ADGPU -I *.reactive_config -L sufex1.pdbqt -N sufex1_docked_ -F *_flex.pdbqt -C 1

meeko's People

Contributors

althea-hansel avatar diogomart avatar fabaff avatar gbianco avatar jeeberhardt avatar mattholc avatar nbruciaferri avatar sforli avatar sunhwan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

meeko's Issues

problem about convert .pdbqt to .sdf

Hello, when I try to use Meeko convert .pdbqt file to .sdf file, I can not get the final result.
Can you help me to resolve this problem?

from meeko import PDBQTMolecule

pmol = PDBQTMolecule.from_file(dataset + '/' + ligand + '/' + 'ligand_out/' + a, skip_typing=True, poses_to_read=1)
f = Chem.SDWriter(dataset + '/' + ligand + '/' + 'ligand_out_sdf/' + a.split('.')[0]+'.sdf')
output_rdmol = pmol[0].export_rdkit_mol() 
f.write(output_rdmol)
f.close()

Why doesn't export_rdkit_mol work?

Meeko Conda install not working

Hi,

OS: Linux (Ubuntu 20.04.2)

I was trying to install Meeko via conda in an already created environment (Python 3.7.11) and I get the following error:

$ conda install -c ccsb-scripps meeko
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: | 
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
failed                                                                          

UnsatisfiableError: The following specifications were found to be incompatible with each other:

Output in format: Requested package -> Available versionsThe following specifications were found to be incompatible with your system:

  - feature:/linux-64::__glibc==2.31=0
  - python=3.7 -> libgcc-ng[version='>=7.5.0'] -> __glibc[version='>=2.17']

Your installed version is: 2.31

I try to update my conda and check my channels but

$ conda config --show channels
channels:
  - defaults

I have found several posts (not from vina) complaining about this, but haven’t found a solution yet. I am gonna continue looking out there, but if anybody has faced this issue and has been able to solve it, it would be great if you could explain how you did it! Thank you.

Rdkit kekulize error

Was hoping you could test this molecule for me. I am getting this error from rdkit as Greg describes and the conversion fails. I also get it for MANY other molecules. I don't get issue with prepare_ligand from AD4 obviously cause it doesn't use rdkit. The input molecule is here: https://drive.google.com/file/d/1u4OcKT7b-ULPb09DEeArLb_J7VyzFw_I/view?usp=sharing

[07:14:52] Can't kekulize mol.  Unkekulized atoms: 11 12 13 14 17
[07:14:52] sanitise [07:14:52] *****

I created the molecule from the smiles like:

obabel -:"CCCN[C@H]1CCCN(C(=O)c2cnn(CC)c2C)C1" -omol2 --gen3D -O ZINC001000520650.mol2

The structure looks fine in PyMol and matches the structure here: https://zinc15.docking.org/substances/ZINC001000520650/
image

Missing name line in REMARK lines

The name of a molecule is a very important information. But the output file of meeko did not include the name line.

test.sdf: an example of input file with molecular name "test"

test
 OpenBabel06272315433D
4  3  0  0  0  0  0  0  0  0999 V2000
1.0507    0.0872   -0.0485 C   0  0  0  0  0  0  0  0  0  0  0  0
2.2754    0.0872   -0.0485 O   0  0  0  0  0  0  0  0  0  0  0  0
0.4632    0.7434   -0.7103 H   0  0  0  0  0  0  0  0  0  0  0  0
0.4632   -0.5690    0.6133 H   0  0  0  0  0  0  0  0  0  0  0  0
1  2  2  0  0  0  0
1  3  1  0  0  0  0
1  4  1  0  0  0  0
M  END
$$$$

test.pdbqt: the output PDBQT file prepared with meeko command:

mk_prepare_ligand.py -i test.sdf -o test.pdbqt

Here is the output.

REMARK SMILES C=O
REMARK SMILES IDX 1 1 2 2
REMARK H PARENT
REMARK Flexibility Score: inf
ROOT
ATOM      1  C   UNL     1       1.051   0.087  -0.049  1.00  0.00     0.307 C
ATOM      2  O   UNL     1       2.275   0.087  -0.049  1.00  0.00    -0.307 OA
ENDROOT
TORSDOF 0

There is no name line in the REMARK lines. Here is an example with Name line:

REMARK  Name = test
REMARK  0 active torsions:
REMARK  status: ('A' for Active; 'I' for Inactive)
REMARK                            x       y       z     vdW  Elec       q    Type
REMARK                         _______ _______ _______ _____ _____    ______ ____
ROOT
ATOM      1  C   UNL     1       1.051   0.087  -0.049  0.00  0.00    +0.000 C
ATOM      2  O   UNL     1       2.275   0.087  -0.049  0.00  0.00    +0.000 OA
ENDROOT
TORSDOF 0

Changing default configs of the preparator

Hello,
I am trying to prepare a .pdbqt file with Meeko within a jupyter notebook, and I would like to retain the non-polar hydrogens. In this respect, I assume I need to change the default options passed to the MoleculePreparation library within Meeko. However I am not able to get control on the corresponding parameter. My code is:

_from meeko import MoleculePreparation
from rdkit import Chem
from rdkit.Chem import AllChem

smiles= "CCCO"
m = Chem.MolFromSmiles(smiles)
m3d = Chem.AddHs(m)
AllChem.EmbedMolecule(m3d)

preparator = MoleculePreparation()
opts = preparator.get_defaults_dict()
opts["keep_nonpolar_hydrogens"] = True
preparator = MoleculePreparation(opts)
preparator.prepare(m3d)
pdbqt_string = preparator.write_pdbqt_string()
pdbqt_string_ready = pdbqt_string.replace('UNL','MOL')

with open('ligand_file.pdbqt','w') as pdbqt_file:
pdbqt_file.write(pdbqt_string_ready)
_

I can see that the opt dictionary is indeed being modified, but the non-polar Hs are still being removed. Am I passing the opts in the correct form to MoleculePreparation?

Thanks in advance for the support

Expose option to append SMARTS and atom type to default list

Something like the following, which is easier than getting the defaults and passing the full set of parameters to atom_type_smarts.

mk_prep = MoleculePreparation(append_types='[{"SMARTS": "[Oh1][c]", "atype": "OX"}]')

Using JSON makes it easy to do the same from mk_prepare_ligand.py

How to use arg "--add_index_map"?

Hello?
How does '--add_ index_ map' work? I tried to follow the txt file or write the center coordinates directly, but it didn't work

Check that partial charges are real numbers

The Gasteiger partial charge method does not have parameters for all elements, e.g. Selenium, so we can end up with NaN and inf (hacky fix for Selenium: 88d640f). Thus, the PDBQT writer should check that partial charges are real numbers, and there should be an escape option bad_charges_ok that defaults to False but can be set to True for docking with the Vina scoring function, in which charges don't matter.

Meeko -m Unrecognized for Preparing Macrocycles

Hello, I used meeko 0.4.0 to prepared macrocycles compound and run this code.

mk_prepare_ligand.py -i PPD_A.sdf -m -o PPD.pdbqt

But the meeko give error message like this:

mk_prepare_ligand.py: error: unrecognized arguments: -m

Is there any change in the argument?
Thank you.

Warn about deprecation when old API (v0.4) is used in v0.5

For example, MoleculePreparation instances no longer have a setup attribute in v0.5. Instead, a list of MoleculeSetup instances is returned when the prepare() method of MoleculePreparation is called. But we could still have the setup attribute store the first MoleculeSetup instance, and raise a warning when that is accessed.

mk_copy_coords.py template not working

Hi,

I´ve installed meeko 0.3.3 via conda. I´m unable to use the mk_copy_coords.py script as the argument -i is not recognized. Checking the code I can see there is no arg for the template section as it was before. Any chance to restore it?

Thanks,

E77

ATOM 'G' created by mk_prepare_ligand.

Hello,
I'm trying to convert SDF file into pdbqt format using following command:

mk_prepare_ligand.py -I a.sdf -o a.pdbqt --pH 7.4

But my a.pdbqt file contains sometime I don't understand:

ATOM 27 G UNL 1 -0.000 -4.585 0.000 1.00 0.00 0.000 G0

what is this atom G? will this affect further docking?

a.sdf is copied below.


     RDKit          2D

 25 28  0  0  0  0  0  0  0  0999 V2000
   -5.1962  -13.5850    0.0000 Cl  0  0  0  0  0  0  0  0  0  0  0  0
   -3.8971  -12.8350    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -2.5981  -13.5850    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -1.2990  -12.8350    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -1.2990  -11.3350    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -2.5981  -10.5850    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -3.8971  -11.3350    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -2.5981   -9.0850    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -1.2990   -8.3350    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -0.0000   -9.0850    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.0000  -10.5850    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
   -1.2990   -6.8350    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -0.0000   -6.0850    0.0000 N   0  0  0  0  0  0  0  0  0  0  0  0
   -0.0000   -4.5850    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -1.3515   -3.9342    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -1.6852   -2.4718    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
   -0.7500   -1.2990    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.7500   -1.2990    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    1.6852   -2.4718    0.0000 N   0  0  0  0  0  0  0  0  0  0  0  0
    1.3515   -3.9342    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    2.5242   -4.8694    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
    1.5000    0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.7500    1.2990    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -0.7500    1.2990    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -1.5000    0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
  1  2  1  0
  2  3  2  0
  3  4  1  0
  4  5  2  0
  5  6  1  0
  6  7  2  0
  6  8  1  0
  8  9  2  0
  9 10  1  0
 10 11  1  0
  9 12  1  0
 12 13  1  0
 13 14  1  0
 14 15  1  0
 15 16  1  0
 16 17  1  0
 17 18  2  0
 18 19  1  0
 19 20  1  0
 20 21  2  0
 18 22  1  0
 22 23  2  0
 23 24  1  0
 24 25  2  0
  7  2  1  0
 20 14  1  0
 11  5  1  0
 25 17  1  0
M  END

Thanks!

RuntimeError("Molecule not OK, refusing to write PDBQT\n\nLOG:\n%s" % self.log)

I want to transfer an sdf file of a molecule (PubChem CID: 101095070) to a pdbqt file,but mk_prepare_ligand.py did not work.

The sdf file of 101095070, which was transferred to 3D by MOE, is:
101095070
MOE2020 3D

26 24 0 0 1 0 0 0 0 0999 V2000
2.1840 -0.8960 0.1650 S 0 0 0 0 0 0 0 0 0 0 0 0
8.4960 -1.4980 2.1000 Na 0 3 0 0 0 0 0 0 0 0 0 0
1.0770 0.1120 -0.1200 O 0 0 0 0 0 0 0 0 0 0 0 0
2.2500 -1.1240 1.5630 O 0 0 0 0 0 0 0 0 0 0 0 0
2.0560 -2.0330 -0.6730 O 0 0 0 0 0 0 0 0 0 0 0 0
9.4960 0.1660 1.2030 O 0 5 0 0 0 0 0 0 0 0 0 0
7.3940 -0.0910 0.5940 N 0 0 0 0 0 0 0 0 0 0 0 0
5.0350 -0.6660 0.1490 C 0 0 3 0 0 0 0 0 0 0 0 0
3.6890 -0.0560 -0.3090 C 0 0 0 0 0 0 0 0 0 0 0 0
6.1990 0.2900 -0.1580 C 0 0 0 0 0 0 0 0 0 0 0 0
5.2900 -2.0450 -0.4850 C 0 0 0 0 0 0 0 0 0 0 0 0
8.5120 0.5710 0.5040 C 0 0 0 0 0 0 0 0 0 0 0 0
8.6950 1.7460 -0.3510 C 0 0 0 0 0 0 0 0 0 0 0 0
9.8510 2.4350 -0.4280 C 0 0 0 0 0 0 0 0 0 0 0 0
4.9710 -0.7800 1.2340 H 0 0 0 0 0 0 0 0 0 0 0 0
3.7670 0.0780 -1.3780 H 0 0 0 0 0 0 0 0 0 0 0 0
3.7040 0.9620 0.0490 H 0 0 0 0 0 0 0 0 0 0 0 0
5.9400 1.3050 0.1490 H 0 0 0 0 0 0 0 0 0 0 0 0
6.4350 0.2670 -1.2240 H 0 0 0 0 0 0 0 0 0 0 0 0
5.2680 -1.9700 -1.5740 H 0 0 0 0 0 0 0 0 0 0 0 0
4.5320 -2.7600 -0.1620 H 0 0 0 0 0 0 0 0 0 0 0 0
6.2660 -2.4250 -0.1820 H 0 0 0 0 0 0 0 0 0 0 0 0
1.0280 0.6800 0.6580 H 0 0 0 0 0 0 0 0 0 0 0 0
7.8700 2.0570 -0.9320 H 0 0 0 0 0 0 0 0 0 0 0 0
10.7010 2.1520 0.1390 H 0 0 0 0 0 0 0 0 0 0 0 0
9.9680 3.2820 -1.0520 H 0 0 0 0 0 0 0 0 0 0 0 0
1 3 1 0 0 0 0
1 4 2 0 0 0 0
1 5 2 0 0 0 0
1 9 1 0 0 0 0
3 23 1 0 0 0 0
6 12 1 0 0 0 0
7 10 1 0 0 0 0
7 12 2 0 0 0 0
8 9 1 0 0 0 0
8 10 1 0 0 0 0
8 11 1 0 0 0 0
8 15 1 0 0 0 0
9 16 1 0 0 0 0
9 17 1 0 0 0 0
10 18 1 0 0 0 0
10 19 1 0 0 0 0
11 20 1 0 0 0 0
11 21 1 0 0 0 0
11 22 1 0 0 0 0
12 13 1 0 0 0 0
13 14 2 0 0 0 0
13 24 1 0 0 0 0
14 25 1 0 0 0 0
14 26 1 0 0 0 0
M CHG 1 2 1
M CHG 1 6 -1
M END

And the error information was:
_Traceback (most recent call last):
File "/home/ubuntu/miniconda3/envs/vina/bin/mk_prepare_ligand.py", line 171, in
ligand_prepared = preparator.write_pdbqt_string()
File "/home/ubuntu/miniconda3/envs/vina/lib/python3.9/site-packages/meeko/preparation.py", line 213, in write_pdbqt_string
raise RuntimeError("Molecule not OK, refusing to write PDBQT\n\nLOG:\n%s" % self.log)
RuntimeError: Molecule not OK, refusing to write PDBQT

LOG:
atom number 1 has None type, mol name: 101095070_

I noted that the first atom is S, so mk_prepare_ligand.py cannot recognize this atomtype?

pH Specification for mk_prepare_ligand.py as described by AutoDockVina?

Dear Meeko Team,

Meeko is featured in the AutoDockVina documentation (https://autodock-vina.readthedocs.io/_/downloads/en/latest/pdf/) and in their tutorial, utilizes the following code:

mk_prepare_ligand.py -i 1iep_ligand.sdf -o 1iep_ligand.pdbqt --pH 7.4

However, I get an unrecognized arugment error for --ph 7.4

Looking through the github via ctrl+f, I don't see a mention of pH.

Has this argument been replaced with a different argument?

Thank you

PDB reading problem

Dear authors,
I tried to read with RDKit pdbqt file generated by the latest dev version of Meeko, but I get an error about 27 atom of H
which as I understand is because it is shifted 1 position to the left in the columns. Also Meeko for some reason wrote SER residue name instead of UNK for some atoms in this generated pdbqt file.
Files:
error_H.mol.txt
error_H.pdbqt.txt
Code:

>> import rdkit
>> rdkit.__version__
'2021.03.5'
>> from rdkit import Chem
>> mol = Chem.MolFromMolFile('error_H.mol.txt', removeHs=False)
>> mol
<rdkit.Chem.rdchem.Mol object at 0x7fa1206d74e0>
>> from openbabel import openbabel as ob
>> from meeko import MoleculePreparation
>> from meeko import obutils
>> mol_ob = obutils.load_molecule_from_string(Chem.MolToMolBlock(mol), molecule_format='MOL')
>> preparator = MoleculePreparation(merge_hydrogens=True, macrocycle=False, hydrate=False, amide_rigid=True)
>> preparator.prepare(mol_ob)
>> pdbqt_string = preparator.write_pdbqt_string()
>> mol_pdbqt = Chem.MolFromPDBBlock('\n'.join([i[:66] for i in pdbqt_string.split('\n')]))
[15:53:42] Cannot determine element for PDB atom #27

Could you help with it please?

Phosphate group - warning O.co2 with non C.2 or S.o2 neighbor.

Hi,

EDIT: issue is resolved, I should have used sdf (mol) format instead of mol2. Sorry to waste your time.

Initial problem:

I am trying to convert NADP from mol2 to pdbqt,

mk_prepare_ligand.py -i NADP.mol2 -o NADP.pdbqt

however I get the warning:

[16:15:43] NADP: warning - O.co2 with non C.2 or S.o2 neighbor.

I guess this is related to the phosphate groups:

rdkit/rdkit#3246
rdkit/rdkit#1806

I would be grateful for any suggestion on how to proceed?

All the best,

Milan

NADP.mol2:

@<TRIPOS>MOLECULE
NADP
 73 77 0 0 0
SMALL
GASTEIGER

@<TRIPOS>ATOM
      1 P           0.0400    5.3860   -0.1340 P.3     1  NADP    0.2182
      2 O           1.2730    6.0120    0.3750 O.co2   1  NADP   -0.4371
      3 O           0.1690    4.7430   -1.4530 O.2     1  NADP   -0.5170
      4 O          -1.2060    6.3690   -0.1190 O.3     1  NADP   -0.3246
      5 C          -1.5090    7.1140    1.0330 C.3     1  NADP    0.0836
      6 C          -2.7900    7.8730    0.7340 C.3     1  NADP    0.1133
      7 O          -3.3120    8.4770    1.9020 O.3     1  NADP   -0.3456
      8 C          -2.5710    9.0030   -0.2830 C.3     1  NADP    0.1141
      9 O          -3.7390    9.1680   -1.0600 O.3     1  NADP   -0.3864
     10 C          -2.4030   10.2360    0.5640 C.3     1  NADP    0.1351
     11 O          -2.7420   11.4140   -0.1630 O.3     1  NADP   -0.3569
     12 C          -3.3620    9.8900    1.7120 C.3     1  NADP    0.1672
     13 N          -3.0200   10.5350    2.9890 N.ar    1  NADP   -0.2855
     14 C          -1.8160   10.5150    3.6750 C.ar    1  NADP    0.1004
     15 N          -1.9900   11.2070    4.8310 N.ar    1  NADP   -0.2306
     16 C          -3.2750   11.6530    4.8680 C.ar    1  NADP    0.1473
     17 C          -3.9810   12.4160    5.7900 C.ar    1  NADP    0.1472
     18 N          -3.3700   12.8560    6.8790 N.pl3   1  NADP   -0.3413
     19 N          -5.3080   12.7170    5.5540 N.ar    1  NADP   -0.2188
     20 C          -5.9440   12.2720    4.4020 C.ar    1  NADP    0.1205
     21 N          -5.2290   11.5080    3.4860 N.ar    1  NADP   -0.2159
     22 C          -3.9300   11.2200    3.7240 C.ar    1  NADP    0.1674
     23 O          -0.3830    4.2530    1.0070 O.3     1  NADP   -0.2703
     24 P          -0.3840    2.6060    0.9830 P.3     1  NADP    0.2182
     25 O          -1.4650    2.1370    0.0490 O.2     1  NADP   -0.5170
     26 O           1.0140    2.1800    0.8190 O.co2   1  NADP   -0.4371
     27 O          -1.1360    2.2570    2.3560 O.3     1  NADP   -0.3246
     28 C          -0.5580    2.3320    3.5900 C.3     1  NADP    0.0836
     29 C          -0.6770    0.9790    4.2760 C.3     1  NADP    0.1133
     30 O          -0.3830   -0.1230    3.4040 O.3     1  NADP   -0.3457
     31 C           0.4050    1.0580    5.3350 C.3     1  NADP    0.1135
     32 O          -0.0020    0.4350    6.5150 O.3     1  NADP   -0.3864
     33 C           1.5440    0.3870    4.6150 C.3     1  NADP    0.1285
     34 O           2.5410    0.0130    5.5290 O.3     1  NADP   -0.3847
     35 C           0.7980   -0.7360    3.8850 C.3     1  NADP    0.1640
     36 N           1.6470   -1.4190    2.8760 N.ar    1  NADP   -0.3248
     37 C           2.1810   -0.7490    1.7980 C.ar    1  NADP    0.0192
     38 C           3.0200   -1.4270    0.9020 C.ar    1  NADP    0.0527
     39 C           3.4390   -0.7740   -0.3900 C.2     1  NADP    0.2429
     40 O           4.3480   -1.4520   -1.2280 O.2     1  NADP   -0.2704
     41 N           2.9240    0.4280   -0.6980 N.am    1  NADP   -0.3253
     42 C           3.3020   -2.7750    1.1090 C.ar    1  NADP   -0.0469
     43 C           2.7610   -3.4290    2.2120 C.ar    1  NADP   -0.0447
     44 C           1.9460   -2.7390    3.0900 C.ar    1  NADP    0.0071
     45 P          -2.2410   12.8770    0.3360 P.3     1  NADP   -0.0144
     46 O          -0.7700   12.8060    0.6190 O.co2   1  NADP   -0.5770
     47 O          -3.0440   13.2720    1.5500 O.co2   1  NADP   -0.5770
     48 O          -2.5540   13.8830   -0.7480 O.2     1  NADP   -0.6377
     49 H          -0.7158    7.7989    1.2490 H       1  NADP    0.0591
     50 H          -1.6275    6.4770    1.8845 H       1  NADP    0.0591
     51 H          -3.4674    7.1453    0.3384 H       1  NADP    0.0647
     52 H          -1.7438    8.8099   -0.9336 H       1  NADP    0.0648
     53 H          -4.4936    9.3435   -0.4763 H       1  NADP    0.2100
     54 H          -1.4101   10.4581    0.8953 H       1  NADP    0.0671
     55 H          -4.3328   10.2454    1.4360 H       1  NADP    0.0867
     56 H          -0.9449   10.0573    3.3640 H       1  NADP    0.1030
     57 H          -2.4236   12.6346    7.0359 H       1  NADP    0.1438
     58 H          -3.8620   13.4046    7.5319 H       1  NADP    0.1438
     59 H          -6.9341   12.5053    4.2282 H       1  NADP    0.1048
     60 H          -1.0569    3.0760    4.1752 H       1  NADP    0.0591
     61 H           0.4738    2.5972    3.4903 H       1  NADP    0.0591
     62 H          -1.6702    0.8059    4.6344 H       1  NADP    0.0647
     63 H           0.6631    2.0380    5.6784 H       1  NADP    0.0647
     64 H          -0.2652   -0.4789    6.3240 H       1  NADP    0.2100
     65 H           2.1093    0.9740    3.9216 H       1  NADP    0.0665
     66 H           2.1506   -0.5366    6.2264 H       1  NADP    0.2101
     67 H           0.5375   -1.5584    4.5180 H       1  NADP    0.0865
     68 H           1.9644    0.2491    1.6499 H       1  NADP    0.0817
     69 H           3.1828    0.8742   -1.5366 H       1  NADP    0.1453
     70 H           2.2878    0.8626   -0.0851 H       1  NADP    0.1453
     71 H           3.9085   -3.2859    0.4485 H       1  NADP    0.0626
     72 H           2.9678   -4.4270    2.3741 H       1  NADP    0.0632
     73 H           1.5588   -3.2231    3.9151 H       1  NADP    0.0810
@<TRIPOS>BOND
     1     3     1    2
     2    40    39    2
     3     9     8    1
     4    48    45    2
     5    41    39   am
     6    39    38    1
     7     8    10    1
     8     8     6    1
     9    11    45    1
    10    11    10    1
    11     1     4    1
    12     1     2    1
    13     1    23    1
    14     4     5    1
    15    25    24    2
    16    45    46    1
    17    45    47    1
    18    10    12    1
    19     6     5    1
    20     6     7    1
    21    26    24    1
    22    38    42   ar
    23    38    37   ar
    24    24    23    1
    25    24    27    1
    26    42    43   ar
    27    12     7    1
    28    12    13    1
    29    37    36   ar
    30    43    44   ar
    31    27    28    1
    32    36    44   ar
    33    36    35    1
    34    13    14   ar
    35    13    22   ar
    36    30    35    1
    37    30    29    1
    38    21    22   ar
    39    21    20   ar
    40    28    29    1
    41    14    15   ar
    42    22    16   ar
    43    35    33    1
    44    29    31    1
    45    20    19   ar
    46    33    31    1
    47    33    34    1
    48    15    16   ar
    49    16    17   ar
    50    31    32    1
    51    19    17   ar
    52    17    18    1
    53     5    49    1
    54     5    50    1
    55     6    51    1
    56     8    52    1
    57     9    53    1
    58    10    54    1
    59    12    55    1
    60    14    56    1
    61    18    57    1
    62    18    58    1
    63    20    59    1
    64    28    60    1
    65    28    61    1
    66    29    62    1
    67    31    63    1
    68    32    64    1
    69    33    65    1
    70    34    66    1
    71    35    67    1
    72    37    68    1
    73    41    69    1
    74    41    70    1
    75    42    71    1
    76    43    72    1
    77    44    73    1


About parameters of pseudoatoms CGn and Gn for further Autogrid4

Hello,

Recently I read the paper on chemrxiv (https://doi.org/10.26434/chemrxiv-2022-txdt0). It's an amazing work so I also want to try Autodock-GPU for my peptide systems. But, after the .gpf file was generated, when I use autogrid4 to generate the map.fld file, I met this error:

ERROR:  unknown ligand atom type G0
add parameters for it to the parameter library first!

I think this happened because no parameters of pseudoatoms CGn and Gn in parameter library of Autogrid. Therefore, may I ask about where could I get the parameters for these pseudoatoms CGn and Gn?

Thanks,
Song

.sdf of only clusters leads

Hi,

After working for so long with AD4/AD-GPU, i appreciate the possibility Meeko brings of transforming the dreadful .dlg files into .sdf
However, it is pretty much a dead end if the clustering information is not exported as well in some way...

A more appealing alternative would be to retrieve the sdf of only clusters leads, together with full energetic terms, cluster population and docking run number.

Hope it inspires you...

E77

retaining unique atom names in the .pdbqt file

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)
pdb_file = Chem.MolToPDBBlock(m3d)

in this case pdb_file 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_string_ready)

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

Molecule not OK, refusing to write PDBQT

I used meeko 0.4.0 with Python 3.8 on Windows to prepare ligand. I encountered an error:

 File "C:\Python38\lib\site-packages\meeko\preparation.py", line 215, in write_pdbqt_file
    w.write(self.write_pdbqt_string(add_index_map, remove_smiles))
  File "C:\Python38\lib\site-packages\meeko\preparation.py", line 205, in write_pdbqt_string
    raise RuntimeError("Molecule not OK, refusing to write PDBQT\n\nLOG:\n%s" % self.log)
RuntimeError: Molecule not OK, refusing to write PDBQT

LOG:
molecule has implicit hydrogens

However, the meeko 0.3.0 works well. I have attached the test data ligand1.pdb.txt

--pH argument not working anymore?

Hello,
I was recently following the new AutoDock Vina's examples at https://autodock-vina.readthedocs.io/en/latest/docking_basic.html and under the Ligand preparation section, they've used the mk_prepare_ligand.py as
$ mk_prepare_ligand.py -i 1iep_ligand.sdf -o 1iep_ligand.pdbqt --pH 7.4

However, when I tried the same I was prompted with the following error:
mk_prepare_ligand.py: error: unrecognized arguments: --pH 7.4

Is there something I'm missing or is this feature no more?

Thanks :)

ATOM syntax incorrect: "CG0" is not a valid AutoDock type

1. step to reproduce the error

vina --config dock.conf --receptor 1ajv_rec.pdbqt --ligand 1ajv_lig.pdbqt --out 1ajv_lig_out.pdbqt
#################################################################
# If you used AutoDock Vina in your work, please cite:          #
#                                                               #
# O. Trott, A. J. Olson,                                        #
# AutoDock Vina: improving the speed and accuracy of docking    #
# with a new scoring function, efficient optimization and       #
# multithreading, Journal of Computational Chemistry 31 (2010)  #
# 455-461                                                       #
#                                                               #
# DOI 10.1002/jcc.21334                                         #
#                                                               #
# Please see http://vina.scripps.edu for more information.      #
#################################################################
Detected 56 CPUs
WARNING: at low exhaustiveness, it may be impossible to utilize all CPUs
Reading input ...
Parse error on line 16 in file "1ajv_lig.pdbqt": ATOM syntax incorrect: "CG0" is not a valid AutoDock type. Note that AutoDock atom types are case-sensitive.

2. prepare ligand file

mk_prepare_ligand.py -i 1ajv_lig.sdf -o 1ajv_lig.pdbqt

3. the ligand file: lajv_lig.pdbqt

REMARK SMILES O=S1(=O)N(Cc2ccccc2)C(COc2ccccc2)C(O)C(O)C(COc2ccccc2)N1Cc1ccccc1
REMARK SMILES IDX 2 1 1 2 3 3 34 4 25 5 26 7 27 8 28 9 29 10 33 11 30 12 32 13
REMARK SMILES IDX 31 14 35 15 36 16 37 17 41 18 38 19 40 20 39 21 4 22 12 23
REMARK SMILES IDX 21 24 23 25 24 27 22 29 13 31 14 32 15 33 16 34 20 35 17 36
REMARK SMILES IDX 19 37 18 38 5 39 6 40 7 41 11 42 8 43 10 44 9 45
REMARK H PARENT 24 28 22 30
REMARK Flexibility Score: 80.00
ROOT
ATOM      1  S   UNL     1      11.752  21.994   6.409  1.00  0.00     0.283 S
ATOM      2  O   UNL     1      11.195  20.919   5.621  1.00  0.00    -0.195 OA
ATOM      3  O   UNL     1      11.563  21.966   7.821  1.00  0.00    -0.195 OA
ENDROOT
BRANCH   1   4
ATOM      4  N   UNL     1      11.288  23.491   5.863  1.00  0.00    -0.175 NA
BRANCH   4   5
ATOM      5  C   UNL     1      11.470  24.031   4.534  1.00  0.00     0.143 CG0
ATOM      6  G   UNL     1      12.964  24.314   4.550  1.00  0.00     0.000 G0
BRANCH   5   7
ATOM      7  C   UNL     1      10.812  23.139   3.466  1.00  0.00     0.252 C
BRANCH   7   8
ATOM      8  O   UNL     1       9.388  23.235   3.713  1.00  0.00    -0.492 OA
BRANCH   8   9
ATOM      9  C   UNL     1       8.638  24.096   2.999  1.00  0.00     0.119 A
ATOM     10  C   UNL     1       9.186  25.297   2.506  1.00  0.00     0.046 A
ATOM     11  C   UNL     1       7.299  23.816   2.745  1.00  0.00     0.046 A
ATOM     12  C   UNL     1       8.412  26.203   1.767  1.00  0.00     0.004 A
ATOM     13  C   UNL     1       6.507  24.722   2.007  1.00  0.00     0.004 A
ATOM     14  C   UNL     1       7.065  25.914   1.516  1.00  0.00     0.000 A
ENDBRANCH   8   9
ENDBRANCH   7   8
ENDBRANCH   5   7
ENDBRANCH   4   5
BRANCH   4  15
ATOM     15  C   UNL     1      10.097  23.950   6.436  1.00  0.00     0.139 C
BRANCH  15  16
ATOM     16  C   UNL     1       9.759  25.135   7.273  1.00  0.00    -0.033 A
ATOM     17  C   UNL     1       8.526  25.784   7.141  1.00  0.00     0.005 A
ATOM     18  C   UNL     1      10.716  25.613   8.206  1.00  0.00     0.005 A
ATOM     19  C   UNL     1       8.230  26.897   7.929  1.00  0.00     0.000 A
ATOM     20  C   UNL     1      10.431  26.739   9.009  1.00  0.00     0.000 A
ATOM     21  C   UNL     1       9.185  27.378   8.869  1.00  0.00     0.000 A
ENDBRANCH  15  16
ENDBRANCH   4  15
ENDBRANCH   1   4
BRANCH   1  22
ATOM     22  N   UNL     1      13.339  22.051   6.143  1.00  0.00    -0.175 NA
BRANCH  22  23
ATOM     23  C   UNL     1      13.718  21.882   4.715  1.00  0.00     0.143 C
BRANCH  23  24
ATOM     24  C   UNL     1      13.866  23.222   4.019  1.00  0.00     0.166 C
BRANCH  24  25
ATOM     25  C   UNL     1      12.964  24.314   4.550  1.00  0.00     0.166 CG0
ATOM     26  G   UNL     1      11.470  24.031   4.534  1.00  0.00     0.000 G0
BRANCH  25  27
ATOM     27  O   UNL     1      13.282  25.492   3.848  1.00  0.00    -0.389 OA
ATOM     28  H   UNL     1      12.723  26.215   4.162  1.00  0.00     0.211 HD
ENDBRANCH  25  27
ENDBRANCH  24  25
BRANCH  24  29
ATOM     29  O   UNL     1      15.185  23.696   4.171  1.00  0.00    -0.389 OA
ATOM     30  H   UNL     1      15.274  24.550   3.726  1.00  0.00     0.211 HD
ENDBRANCH  24  29
ENDBRANCH  23  24
BRANCH  23  31
ATOM     31  C   UNL     1      14.980  21.017   4.548  1.00  0.00     0.252 C
BRANCH  31  32
ATOM     32  O   UNL     1      14.762  20.021   3.521  1.00  0.00    -0.492 OA
BRANCH  32  33
ATOM     33  C   UNL     1      15.758  19.150   3.211  1.00  0.00     0.119 A
ATOM     34  C   UNL     1      16.685  18.752   4.198  1.00  0.00     0.046 A
ATOM     35  C   UNL     1      15.866  18.632   1.912  1.00  0.00     0.046 A
ATOM     36  C   UNL     1      17.711  17.848   3.882  1.00  0.00     0.004 A
ATOM     37  C   UNL     1      16.880  17.726   1.585  1.00  0.00     0.004 A
ATOM     38  C   UNL     1      17.804  17.334   2.569  1.00  0.00     0.000 A
ENDBRANCH  32  33
ENDBRANCH  31  32
ENDBRANCH  23  31
ENDBRANCH  22  23
BRANCH  22  39
ATOM     39  C   UNL     1      14.199  22.696   7.160  1.00  0.00     0.139 C
BRANCH  39  40
ATOM     40  C   UNL     1      15.185  21.856   7.925  1.00  0.00    -0.033 A
ATOM     41  C   UNL     1      14.748  20.969   8.940  1.00  0.00     0.005 A
ATOM     42  C   UNL     1      16.558  21.938   7.631  1.00  0.00     0.005 A
ATOM     43  C   UNL     1      15.687  20.170   9.651  1.00  0.00     0.000 A
ATOM     44  C   UNL     1      17.495  21.147   8.336  1.00  0.00     0.000 A
ATOM     45  C   UNL     1      17.061  20.260   9.346  1.00  0.00     0.000 A
ENDBRANCH  39  40
ENDBRANCH  22  39
ENDBRANCH   1  22
TORSDOF 12

4. lajv_lig.sdf

1ajv_ligand
  xed2sdf_05210316543D
75 79  0  0  1  0  0  0  0  0999 V2000
11.2880   23.4910    5.8630 N   0  0  0  0  0  0  0  0  0  0  0  0
11.7520   21.9940    6.4090 S   0  0  0  0  0  0  0  0  0  0  0  0
13.3390   22.0510    6.1430 N   0  0  0  0  0  0  0  0  0  0  0  0
13.7180   21.8820    4.7150 C   0  0  0  0  0  0  0  0  0  0  0  0
13.8660   23.2220    4.0190 C   0  0  0  0  0  0  0  0  0  0  0  0
12.9640   24.3140    4.5500 C   0  0  0  0  0  0  0  0  0  0  0  0
11.4700   24.0310    4.5340 C   0  0  0  0  0  0  0  0  0  0  0  0
10.0970   23.9500    6.4360 C   0  0  0  0  0  0  0  0  0  0  0  0
9.7590   25.1350    7.2730 C   0  0  0  0  0  0  0  0  0  0  0  0
8.5260   25.7840    7.1410 C   0  0  0  0  0  0  0  0  0  0  0  0
8.2300   26.8970    7.9290 C   0  0  0  0  0  0  0  0  0  0  0  0
9.1850   27.3780    8.8690 C   0  0  0  0  0  0  0  0  0  0  0  0
10.4310   26.7390    9.0090 C   0  0  0  0  0  0  0  0  0  0  0  0
10.7160   25.6130    8.2060 C   0  0  0  0  0  0  0  0  0  0  0  0
11.1950   20.9190    5.6210 O   0  0  0  0  0  0  0  0  0  0  0  0
14.7620   20.0210    3.5210 O   0  0  0  0  0  0  0  0  0  0  0  0
15.7580   19.1500    3.2110 C   0  0  0  0  0  0  0  0  0  0  0  0
16.6850   18.7520    4.1980 C   0  0  0  0  0  0  0  0  0  0  0  0
17.7110   17.8480    3.8820 C   0  0  0  0  0  0  0  0  0  0  0  0
17.8039   17.3340    2.5690 C   0  0  0  0  0  0  0  0  0  0  0  0
16.8800   17.7260    1.5850 C   0  0  0  0  0  0  0  0  0  0  0  0
15.8660   18.6320    1.9120 C   0  0  0  0  0  0  0  0  0  0  0  0
14.1990   22.6960    7.1600 C   0  0  0  0  0  0  0  0  0  0  0  0
15.1850   21.8560    7.9250 C   0  0  0  0  0  0  0  0  0  0  0  0
14.7480   20.9690    8.9400 C   0  0  0  0  0  0  0  0  0  0  0  0
15.6870   20.1700    9.6510 C   0  0  0  0  0  0  0  0  0  0  0  0
17.0610   20.2600    9.3460 C   0  0  0  0  0  0  0  0  0  0  0  0
17.4950   21.1470    8.3360 C   0  0  0  0  0  0  0  0  0  0  0  0
16.5580   21.9380    7.6310 C   0  0  0  0  0  0  0  0  0  0  0  0
15.1850   23.6960    4.1710 O   0  0  0  0  0  0  0  0  0  0  0  0
13.2820   25.4920    3.8480 O   0  0  0  0  0  0  0  0  0  0  0  0
10.8120   23.1390    3.4660 C   0  0  0  0  0  0  0  0  0  0  0  0
9.3880   23.2350    3.7130 O   0  0  0  0  0  0  0  0  0  0  0  0
8.6380   24.0960    2.9990 C   0  0  0  0  0  0  0  0  0  0  0  0
9.1860   25.2970    2.5060 C   0  0  0  0  0  0  0  0  0  0  0  0
8.4120   26.2030    1.7670 C   0  0  0  0  0  0  0  0  0  0  0  0
7.0650   25.9140    1.5160 C   0  0  0  0  0  0  0  0  0  0  0  0
6.5070   24.7220    2.0070 C   0  0  0  0  0  0  0  0  0  0  0  0
7.2990   23.8160    2.7450 C   0  0  0  0  0  0  0  0  0  0  0  0
11.5630   21.9660    7.8210 O   0  0  0  0  0  0  0  0  0  0  0  0
14.9800   21.0170    4.5480 C   0  0  0  0  0  0  0  0  0  0  0  0
12.9690   21.3250    4.2150 H   0  0  0  0  0  0  0  0  0  0  0  0
13.6400   23.1120    2.9900 H   0  0  0  0  0  0  0  0  0  0  0  0
13.2090   24.5140    5.5610 H   0  0  0  0  0  0  0  0  0  0  0  0
10.8730   24.8980    4.4210 H   0  0  0  0  0  0  0  0  0  0  0  0
9.3850   24.1320    5.6730 H   0  0  0  0  0  0  0  0  0  0  0  0
9.7210   23.2180    7.1020 H   0  0  0  0  0  0  0  0  0  0  0  0
7.8020   25.4250    6.4290 H   0  0  0  0  0  0  0  0  0  0  0  0
7.2790   27.3920    7.8260 H   0  0  0  0  0  0  0  0  0  0  0  0
8.9560   28.2360    9.4780 H   0  0  0  0  0  0  0  0  0  0  0  0
11.1500   27.1100    9.7200 H   0  0  0  0  0  0  0  0  0  0  0  0
11.6660   25.1160    8.3050 H   0  0  0  0  0  0  0  0  0  0  0  0
16.6070   19.1420    5.1990 H   0  0  0  0  0  0  0  0  0  0  0  0
18.4190   17.5520    4.6370 H   0  0  0  0  0  0  0  0  0  0  0  0
18.5860   16.6380    2.3170 H   0  0  0  0  0  0  0  0  0  0  0  0
16.9560   17.3290    0.5870 H   0  0  0  0  0  0  0  0  0  0  0  0
15.1630   18.9310    1.1530 H   0  0  0  0  0  0  0  0  0  0  0  0
14.7910   23.4440    6.6990 H   0  0  0  0  0  0  0  0  0  0  0  0
13.5920   23.1370    7.9070 H   0  0  0  0  0  0  0  0  0  0  0  0
13.7000   20.8970    9.1770 H   0  0  0  0  0  0  0  0  0  0  0  0
15.3480   19.4980   10.4210 H   0  0  0  0  0  0  0  0  0  0  0  0
17.7720   19.6540    9.8820 H   0  0  0  0  0  0  0  0  0  0  0  0
18.5430   21.2230    8.1000 H   0  0  0  0  0  0  0  0  0  0  0  0
16.9050   22.6080    6.8620 H   0  0  0  0  0  0  0  0  0  0  0  0
15.2740   24.5500    3.7260 H   0  0  0  0  0  0  0  0  0  0  0  0
12.7230   26.2150    4.1620 H   0  0  0  0  0  0  0  0  0  0  0  0
11.0640   23.4980    2.5020 H   0  0  0  0  0  0  0  0  0  0  0  0
11.1590   22.1440    3.5740 H   0  0  0  0  0  0  0  0  0  0  0  0
10.2190   25.5350    2.6940 H   0  0  0  0  0  0  0  0  0  0  0  0
8.8540   27.1130    1.3970 H   0  0  0  0  0  0  0  0  0  0  0  0
6.4630   26.6040    0.9490 H   0  0  0  0  0  0  0  0  0  0  0  0
5.4710   24.4960    1.8210 H   0  0  0  0  0  0  0  0  0  0  0  0
6.8610   22.9030    3.1120 H   0  0  0  0  0  0  0  0  0  0  0  0
15.7960   21.6330    4.2700 H   0  0  0  0  0  0  0  0  0  0  0  0
15.2000   20.5320    5.4640 H   0  0  0  0  0  0  0  0  0  0  0  0
1  2  1  0
2  3  1  0
3  4  1  0
4 42  1  0
4  5  1  0
5 43  1  0
5  6  1  0
6 44  1  0
1  7  1  0
6  7  1  0
7 45  1  0
1  8  1  0
8 46  1  0
8 47  1  0
8  9  1  0
9 10  2  0
10 48  1  0
10 11  1  0
11 49  1  0
11 12  2  0
12 50  1  0
12 13  1  0
13 51  1  0
9 14  1  0
13 14  2  0
14 52  1  0
2 15  2  0
16 17  1  0
17 18  2  0
18 53  1  0
18 19  1  0
19 54  1  0
19 20  2  0
20 55  1  0
20 21  1  0
21 56  1  0
17 22  1  0
21 22  2  0
22 57  1  0
3 23  1  0
23 58  1  0
23 59  1  0
23 24  1  0
24 25  2  0
25 60  1  0
25 26  1  0
26 61  1  0
26 27  2  0
27 62  1  0
27 28  1  0
28 63  1  0
24 29  1  0
28 29  2  0
29 64  1  0
5 30  1  0
30 65  1  0
6 31  1  0
31 66  1  0
7 32  1  0
32 67  1  0
32 68  1  0
32 33  1  0
33 34  1  0
34 35  2  0
35 69  1  0
35 36  1  0
36 70  1  0
36 37  2  0
37 71  1  0
37 38  1  0
38 72  1  0
34 39  1  0
38 39  2  0
39 73  1  0
2 40  2  0
4 41  1  0
16 41  1  0
41 74  1  0
41 75  1  0
M  END
$$$$

compatibility with AutoDock

Hello,

Is Meeko compatible with AutoDock (4 or 4.2), on top of its compatibility with AutoDock-Vina and AutoDock-GPU?

Thanks!
Yoav

IndexError: End of sequence hit

Hello!

I tried to prepare one molecule (rdkit mol generated from SMILES) following instructions from readme.md but I got an error.

Code:

from meeko import MoleculePreparation
from rdkit import Chem
preparator = MoleculePreparation(hydrate=True)
smile = 'COc1ccccc1C(C)NS(=O)(=O)NC(=O)OCc1ccccc1'
mol = Chem.MolFromSmiles(smile)
preparator.prepare(mol)

Traceback:

---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
Input In [7], in <cell line: 1>()
----> 1 preparator.prepare(mol)

File ~/anaconda3/envs/my-rdkit-env/lib/python3.9/site-packages/meeko/preparation.py:94, in MoleculePreparation.prepare(self, mol, is_protein_sidechain)
     92     raise TypeError("Molecule is not an instance of supported types: %s" % type(mol))
     93 setup_class = self._classes_setup[mol_type]
---> 94 setup = setup_class(mol, is_protein_sidechain)
     95 self.setup = setup
     96 # 1.  assign atom types (including HB types, vectors and stuff)
     97 # DISABLED TODO self.atom_typer.set_parm(mol)

File ~/anaconda3/envs/my-rdkit-env/lib/python3.9/site-packages/meeko/setup.py:109, in MoleculeSetup.__init__(self, mol, flexible_amides, is_protein_sidechain, assign_charges, template)
    107 self.is_protein_sidechain = False
    108 if template is None:
--> 109     self.process_mol(flexible_amides, is_protein_sidechain, assign_charges)
    110 else:
    111     if not isinstance(template, MoleculeSetup):

File ~/anaconda3/envs/my-rdkit-env/lib/python3.9/site-packages/meeko/setup.py:118, in MoleculeSetup.process_mol(self, flexible_amides, is_protein_sidechain, assign_charges)
    116 self.atom_true_count = self.get_num_mol_atoms()
    117 self.name = self.get_mol_name()
--> 118 self.init_atom(assign_charges)
    119 self.perceive_rings()
    120 self.init_bond(flexible_amides)

File ~/anaconda3/envs/my-rdkit-env/lib/python3.9/site-packages/meeko/setup.py:600, in RDKitMoleculeSetup.init_atom(self, assign_charges)
    598 """ initialize the atom table information """
    599 # extract the coordinates
--> 600 c = self.mol.GetConformers()[0]
    601 coords = c.GetPositions()
    602 # extract/generate charges

IndexError: End of sequence hit

Could please someone explain me how to deal with this error? Why did I get it?

PDBQT tree error (rigid amidine)

  • I believe this to be a bug with Meeko resulting from OpenBabel issue #2433. I report it here because Meeko has the same error.

Environment Information

Operating system and version: Centos 7.4

Expected Behavior

Example 1. C1(NC2=NC(C3=CN=CC=C3)=CC=N2)=CC=CC=C1

As for example 1 molecule, obabel give a PDBQT file with 2 rotatable bond instead of 3. The correct one looks like as following:

REMARK  Name = EX1
REMARK  3 active torsions:
REMARK  status: ('A' for Active; 'I' for Inactive)
REMARK    1  A    between atoms: _1  and  _2
REMARK    2  A    between atoms: _2  and  _3
REMARK    3  A    between atoms: _5  and  _6
ROOT
ATOM      1  C1  UNL     1       3.354   0.587   0.763  0.00  0.00     0.041 A
ATOM     15  C11 UNL     1       4.730   0.740   0.977  0.00  0.00    -0.039 A
ATOM     16  C12 UNL     1       5.237   1.885   1.596  0.00  0.00    -0.060 A
ATOM     17  C13 UNL     1       4.371   2.898   1.998  0.00  0.00    -0.062 A
ATOM     18  C14 UNL     1       3.003   2.773   1.764  0.00  0.00    -0.060 A
ATOM     19  C15 UNL     1       2.501   1.632   1.133  0.00  0.00    -0.039 A
ENDROOT
BRANCH 1 2
ATOM      2  N1  UNL     1       2.812  -0.545   0.129  0.00  0.00    -0.324 N
ATOM     20  H1  UNL     1       2.532  -0.383  -0.830  0.00  0.00     0.170 HD
BRANCH 2 3
ATOM      3  C2  UNL     1       3.296  -1.851   0.224  0.00  0.00     0.227 A
ATOM      4  N2  UNL     1       3.942  -2.233   1.334  0.00  0.00    -0.213 NA
ATOM      5  C3  UNL     1       4.393  -3.501   1.427  0.00  0.00     0.077 A
ATOM     12  C9  UNL     1       4.180  -4.407   0.410  0.00  0.00    -0.017 A
ATOM     13  C10 UNL     1       3.504  -3.933  -0.691  0.00  0.00     0.033 A
ATOM     14  N4  UNL     1       3.060  -2.669  -0.809  0.00  0.00    -0.221 NA
BRANCH 5 6
ATOM      6  C4  UNL     1       5.110  -3.815   2.675  0.00  0.00     0.019 A
ATOM      7  C5  UNL     1       6.100  -4.795   2.757  0.00  0.00     0.036 A
ATOM      8  N3  UNL     1       6.792  -5.119   3.879  0.00  0.00    -0.264 NA
ATOM      9  C6  UNL     1       6.496  -4.421   4.994  0.00  0.00     0.027 A
ATOM     10  C7  UNL     1       5.546  -3.417   5.038  0.00  0.00    -0.043 A
ATOM     11  C8  UNL     1       4.853  -3.116   3.866  0.00  0.00    -0.050 A
ENDBRANCH 5 6
ENDBRANCH 2 3
ENDBRANCH 1 2
TORSDOF 3

Actual Behavior

The torsions in PDBQT file did not include bond C_2-N_3. This will result in docking failure. Let me show you an redocking failure: openbabel_2433

Steps to Reproduce

(base) [gkxiao@master demo]$ cat ex1.smi
C1(NC2=NC(C3=CN=CC=C3)=CC=N2)=CC=CC=C1 EX01
(base) [gkxiao@master demo]$ obabel -ismi ex1.smi -opdbqt --gen3d --best
REMARK  Name = EX01
REMARK  2 active torsions:
REMARK  status: ('A' for Active; 'I' for Inactive)
REMARK    1  A    between atoms: C_1  and  N_2
REMARK    2  A    between atoms: C_5  and  C_6
REMARK                            x       y       z     vdW  Elec       q    Type
REMARK                         _______ _______ _______ _____ _____    ______ ____
ROOT
ATOM      1  N   UNL     1       2.812  -0.545   0.128  0.00  0.00    +0.000 N
ATOM      2  C   UNL     1       3.296  -1.851   0.224  0.00  0.00    +0.000 A
ATOM      3  N   UNL     1       3.942  -2.233   1.334  0.00  0.00    +0.000 NA
ATOM      4  C   UNL     1       4.393  -3.501   1.427  0.00  0.00    +0.000 A
ATOM      5  C   UNL     1       4.180  -4.407   0.410  0.00  0.00    +0.000 A
ATOM      6  C   UNL     1       3.504  -3.932  -0.691  0.00  0.00    +0.000 A
ATOM      7  N   UNL     1       3.060  -2.669  -0.809  0.00  0.00    +0.000 NA
ATOM      8  H   UNL     1       2.532  -0.383  -0.830  0.00  0.00    +0.000 HD
ENDROOT
BRANCH   1   9
ATOM      9  C   UNL     1       3.354   0.587   0.763  0.00  0.00    +0.000 A
ATOM     10  C   UNL     1       4.730   0.740   0.977  0.00  0.00    +0.000 A
ATOM     11  C   UNL     1       5.237   1.885   1.596  0.00  0.00    +0.000 A
ATOM     12  C   UNL     1       4.371   2.898   1.998  0.00  0.00    +0.000 A
ATOM     13  C   UNL     1       3.003   2.773   1.765  0.00  0.00    +0.000 A
ATOM     14  C   UNL     1       2.501   1.632   1.133  0.00  0.00    +0.000 A
ENDBRANCH   1   9
BRANCH   4  15
ATOM     15  C   UNL     1       5.110  -3.815   2.675  0.00  0.00    +0.000 A
ATOM     16  C   UNL     1       6.100  -4.795   2.757  0.00  0.00    +0.000 A
ATOM     17  N   UNL     1       6.791  -5.119   3.879  0.00  0.00    +0.000 NA
ATOM     18  C   UNL     1       6.496  -4.421   4.994  0.00  0.00    +0.000 A
ATOM     19  C   UNL     1       5.546  -3.417   5.038  0.00  0.00    +0.000 A
ATOM     20  C   UNL     1       4.853  -3.116   3.867  0.00  0.00    +0.000 A
ENDBRANCH   4  15
TORSDOF 2

Converting list of DLG files to SDF: AttributeError

Hi, I'm trying to use Meeko from python to convert a list of .dlg files to a single sdf file.

def read_pdbqt(name):
    if (name.endswith(".dlg")):
        pdbqt = PDBQTMolecule.from_file(f"docking/{name}", is_dlg=True, skip_typing=True)
        mname = name.replace("protein_", "")
        m = RDKitMolCreate.from_pdbqt_mol(pdbqt)[0]
#        m.SetProp("_Name", mname)
        return m

mols = [read_pdbqt(dlg) for dlg in os.listdir(f"docking")]

RDkit returns an error at the above commented "m.SetProp()" line:
AttributeError: 'NoneType' object has no attribute 'SetProp'

Does RDKitMolCreate.from_pdbqt_mol return a list of regular RDkit molecular object, or is there a need to convert those and how?
Reading the Meeko code, it seems that the molecule was generate using Chem.MolFromSmiles() and should therefore have a SetProp attribute.
Thanks,
Pierre

mk_export.py Runtime error

Hi!
I tried to convert dlg, the result file of AutoDock-GPU, to sdf by using mk_export.py. At this time, the following error was output.

스크린샷, 2023-08-08 14-34-49

Looking at DLG and PDBQT, I found that there are 4 hydrogen atoms.
스크린샷, 2023-08-08 14-36-07

Is this problem caused by rdkit not recognizing hydrogen properly? or is there another reason?

Thanks!

Quick question with mk_copy_coord.py

Hi there,

I really enjoyed meeko for its compatibility with the ad4-gpu docking result. However, when I installed the most recent version of meeko, I saw that putting in the original sdf file to facilitate the result conversion is not recommended. Can I know why that is the case?

The reason for me to ask about it is that I am trying to build a docking workflow that involves first converting sdf to pdbqt using meeko and then convert it back sdf once docking is complete. To give you more context, I have encountered some bond order issues with pdbqt file before, and that's why I would like to put in a reference sdf file for its final conversion from dlg to sdf to just make sure that I am recovering all the correct bond orders.

Thank you for your time,
Oliver

mk_prepare_ligand.py should return a non-0 exit code if it failed to create the output

Running mk_prepare_ligand.py on some unsupported ligands like [Sr+2] fails. This is fine, however the script returns a success exit code (0) which makes it difficult to detect the failure.

echo "
     RDKit          3D

  1  0  0  0  0  0  0  0  0  0999 V2000
    0.0000    0.0000    0.0000 Sr  0  0  0  0  0 15  0  0  0  0  0  0
M  CHG  1   1   2
M  END
$$$$
" > test.sdf
mk_prepare_ligand.py -i test.sdf -o test.pdbqt

The script fails and prints the following output:

[16:04:31] Warning: molecule is tagged as 3D, but all Z coords are zero
[16:04:31] ERROR: Problems encountered parsing data fields
[16:04:31] ERROR: moving to the beginning of the next molecule
atom number 0 has None type, mol name: 

However it returns a status code of 0 which makes it difficult to detect that something failed:

echo $?
0

It would be very nice if mk_prepare_ligand.py could return a non-0 exit code to indicate a failure occurred.

NotImplementedError in OBMoleculeSetup.get_equivalent_atoms()

Dear authors,
I tried to convert molecule from smiles to pdbqt format, but the new version of Meeko returns error (old version worked correctly) -
File "site-packages/meeko/setup.py", line 698, in get_equivalent_atoms
raise NotImplementedError
NotImplementedError
version of the packages:
numpy 1.20.3
scipy 1.6.2
rdkit 2021.03.5
meeko 0.3.0
code:

smi = 'O=C(C)Oc1ccccc1C(=O)O'

mol = Chem.MolFromSmiles(smi)
mol = Chem.AddHs(mol, addCoords=True)
params = AllChem.ETKDGv3()
params.useRandomCoords = False
params.randomSeed = 120
AllChem.EmbedMolecule(mol, params)
AllChem.UFFOptimizeMolecule(mol, maxIters=100)
molecule_sdf = Chem.MolToMolBlock(mol)

mol = obutils.load_molecule_from_string(molecule_sdf, molecule_format='SDF')

mol.AddHydrogens()
charge_model = ob.OBChargeModel.FindType("Gasteiger")
charge_model.ComputeCharges(mol)

preparator = MoleculePreparation(keep_nonpolar_hydrogens=False,
                                 hydrate=False, flexible_amides=False,
                                 rigid_macrocycles=False, min_ring_size=7, max_ring_size=33,
                                 rigidify_bonds_smarts=[], rigidify_bonds_indices=[],
                                 double_bond_penalty=50, atom_type_smarts={},
                                 is_protein_sidechain=False, add_index_map=False,
                                 stop_at_defaults=False, remove_smiles=False)
preparator.prepare(mol)

Could you help me please?
Thank you!

`PDBQTMolecule` from `.pdbqt` error: 'numpy.ndarray' object has no attribute 'append'

Hello,

I tried to parse .pdbqt file using meeko but got an error:

from meeko import PDBQTMolecule
pdbqt_mol = PDBQTMolecule.from_file(my_pdbqt_path), is_dlg=False, skip_typing=True)
File /nix/store/pd3h7x3zskxlj161kqhihah3r735i17h-python3-3.10.5-env/lib/python3.10/site-packages/meeko/molecule_pdbqt.py:315, in PDBQTMolecule.from_file(cls, pdbqt_filename, name, poses_to_read, energy_range, is_dlg, skip_typing)
    313 with open(pdbqt_filename) as f:
    314     pdbqt_string = f.read()
--> 315 instance = cls(pdbqt_string, name, poses_to_read, energy_range, is_dlg, skip_typing) 
    316 instance._pdbqt_filename = pdbqt_filename
    317 return instance

File /nix/store/pd3h7x3zskxlj161kqhihah3r735i17h-python3-3.10.5-env/lib/python3.10/site-packages/meeko/molecule_pdbqt.py:287, in PDBQTMolecule.__init__(self, pdbqt_string, name, poses_to_read, energy_range, is_dlg, skip_typing)
    285 poses_to_read = poses_to_read if poses_to_read is not None else -1
    286 energy_range = energy_range if energy_range is not None else -1
--> 287 results = _read_ligand_pdbqt_file(pdbqt_string, poses_to_read, energy_range, is_dlg, skip_typing)
    288 self._atoms, self._positions, self._atom_annotations, self._pose_data = results
    290 if self._atoms.shape[0] == 0:

File /nix/store/pd3h7x3zskxlj161kqhihah3r735i17h-python3-3.10.5-env/lib/python3.10/site-packages/meeko/molecule_pdbqt.py:120, in _read_ligand_pdbqt_file(pdbqt_string, poses_to_read, energy_range, is_dlg, skip_typing)
    117         i += 1
    119 # Once it is done, we can return to a normal life... and add existing atoms
--> 120 tmp_atoms.append((i, serial, name, resid, resname, chainid, xyz, partial_charges, atom_type))
    121 tmp_positions.append(xyz)
    122 tmp_actives.append(i)

AttributeError: 'numpy.ndarray' object has no attribute 'append'

Here's the PDBQT file for your reference:
https://gist.github.com/linminhtoo/5949437ae066fdd136709971dcc36220
The ligand was prepared using meeko before docking to Vina-GPU.

Do you know what's the issue?
Thank you!
Min Htoo

exec ./mk_export.py file.dlg -o result.sdf got error print("Option -o/--output_filename incompatible with multiple input files", file=sys.stderr)

Hi there,

thanks for all the developers !
when i followed the tutorials from there tutorials, everything is ok until i reach the step 10 mk_copy_coords.py ligand.dlg -o ligand_docked.sdf.

i know that i should run mk_export.py instead of mk_copy_coords.py, but after i run ./mk_export.py file.dlg -o result.sdf , i got an error like this

File "./mk_export.py", line 58
print("Option -o/--output_filename incompatible with multiple input files", file=sys.stderr)

and i have no idea what's wrong and how to handle it.

any suggestions?

Cannot read ions with PDBQTMolecule

I can't read PDBQT files of ions (Mg, Na, Ca, Zn, etc). Trying to read such a PDBQT fails with a TypeError.

Here is a minimal example:

pdbqt_str = """REMARK SMILES [Mg+2]
REMARK SMILES IDX 1 1
REMARK H PARENT
REMARK Flexibility Score: inf
ROOT
ATOM      1  Mg  UNL     1       0.000   0.000   0.000  1.00  0.00     2.000 Mg
ENDROOT
TORSDOF 0"""

from meeko import PDBQTMolecule
PDBQTMolecule(pdbqt_str)

Gives me the following error message:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/xavier/venv/lib/python3.9/site-packages/meeko/molecule_pdbqt.py", line 338, in __init__
    self._bonds = _identify_bonds(self._atom_annotations['ligand'], mol_atoms['xyz'], mol_atoms['atom_type'])
  File "/home/xavier/venv/lib/python3.9/site-packages/meeko/molecule_pdbqt.py", line 292, in _identify_bonds
    optimal_distances = [bond_allowance_factor * (r_cov + covalent_radius[autodock4_atom_types_elements[atom_types[i]]]) for i in indices[1:]]
TypeError: 'int' object is not subscriptable

This is with Meeko 0.4 and Python 3.9.5 (installed with pip into a virtual environment). PDBQT file was created with the mk_prepare_ligand.py script (converted from RDKit SDF).

As a workaround, setting skip_typing=True allows the molecule to be read:

PDBQTMolecule(pdbqt_str, skip_typing=True)
# <Molecule named None containing 1 poses of 1 atoms>

test/rdkitmol_from_docking_test.py fails with meeko==0.5.0

description

I have not checked the cause yet, but the following tests fail with meeko==0.5.0.

================================================================================= short test summary info ==================================================================================
FAILED test/rdkitmol_from_docking_test.py::test_asn_phe - assert 2 == 0
FAILED test/rdkitmol_from_docking_test.py::test_22_flexres - assert 22 == 0
FAILED test/rdkitmol_from_docking_test.py::test_phe_badphe - assert 5 == 1
FAILED test/rdkitmol_from_docking_test.py::test_arg_his - assert 2 == 0
FAILED test/rdkitmol_from_docking_test.py::test_small_04 - OSError: File error: Bad input file /Meeko/test/rdkitmol_from_docking_data/small-04.sdf
========================================================================= 5 failed, 27 passed, 1 warning in 3.20s ==========================================================================
full log
=================================================================================== test session starts ====================================================================================
platform linux -- Python 3.10.11, pytest-7.4.0, pluggy-1.2.0
rootdir: /Meeko
collected 32 items                                                                                                                                                                         

test/cyclopentane_rigid_test.py .                                                                                                                                                    [  3%]
test/macrocycle_test.py ..                                                                                                                                                           [  9%]
test/merge_custom_types_test.py ..                                                                                                                                                   [ 15%]
test/rdkitmol_from_docking_test.py FFFF...................F                                                                                                                          [ 90%]
test/ring_detection_test.py .                                                                                                                                                        [ 93%]
test/skip_bad_mols_test.py ..                                                                                                                                                        [100%]

========================================================================================= FAILURES =========================================================================================
_______________________________________________________________________________________ test_asn_phe _______________________________________________________________________________________

    def test_asn_phe():
        fpath = datadir / "macrocycle-water-asn-phe.pdbqt"
>       check_rdkit_bond_lengths(fpath, nr_expected_none=0, is_dlg=False, skip_typing=True)

test/rdkitmol_from_docking_test.py:49: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
test/rdkitmol_from_docking_test.py:20: in check_rdkit_bond_lengths
    return run_from_pdbqtmol(pdbqtmol, nr_expected_none)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

pdbqtmol = <Molecule named macrocycle-water-asn-phe containing 5 poses of 44 atoms>, nr_expected_none = 0

    def run_from_pdbqtmol(pdbqtmol, nr_expected_none=0):
        mols = RDKitMolCreate.from_pdbqt_mol(pdbqtmol)
>       assert(mols.count(None) == nr_expected_none)
E       assert 2 == 0
E        +  where 2 = <built-in method count of list object at 0x7f240c2d0540>(None)
E        +    where <built-in method count of list object at 0x7f240c2d0540> = [<rdkit.Chem.rdchem.Mol object at 0x7f240e398a50>, <rdkit.Chem.rdchem.Mol object at 0x7f240e398eb0>, None, None].count

test/rdkitmol_from_docking_test.py:24: AssertionError
_____________________________________________________________________________________ test_22_flexres ______________________________________________________________________________________

    def test_22_flexres():
        fpath = datadir / "22-flexres.pdbqt"
>       check_rdkit_bond_lengths(fpath, nr_expected_none=0, is_dlg=False, skip_typing=True)

test/rdkitmol_from_docking_test.py:53: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
test/rdkitmol_from_docking_test.py:20: in check_rdkit_bond_lengths
    return run_from_pdbqtmol(pdbqtmol, nr_expected_none)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

pdbqtmol = <Molecule named 22-flexres containing 3 poses of 158 atoms>, nr_expected_none = 0

    def run_from_pdbqtmol(pdbqtmol, nr_expected_none=0):
        mols = RDKitMolCreate.from_pdbqt_mol(pdbqtmol)
>       assert(mols.count(None) == nr_expected_none)
E       assert 22 == 0
E        +  where 22 = <built-in method count of list object at 0x7f240e24a800>(None)
E        +    where <built-in method count of list object at 0x7f240e24a800> = [<rdkit.Chem.rdchem.Mol object at 0x7f240cfcf1b0>, None, None, None, None, None, ...].count

test/rdkitmol_from_docking_test.py:24: AssertionError
_____________________________________________________________________________________ test_phe_badphe ______________________________________________________________________________________

    def test_phe_badphe():
        fpath = datadir / "arg_gln_asn_phe_badphe.pdbqt"
>       check_rdkit_bond_lengths(fpath, nr_expected_none=1, is_dlg=False, skip_typing=True)

test/rdkitmol_from_docking_test.py:57: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
test/rdkitmol_from_docking_test.py:20: in check_rdkit_bond_lengths
    return run_from_pdbqtmol(pdbqtmol, nr_expected_none)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

pdbqtmol = <Molecule named arg_gln_asn_phe_badphe containing 5 poses of 53 atoms>, nr_expected_none = 1

    def run_from_pdbqtmol(pdbqtmol, nr_expected_none=0):
        mols = RDKitMolCreate.from_pdbqt_mol(pdbqtmol)
>       assert(mols.count(None) == nr_expected_none)
E       assert 5 == 1
E        +  where 5 = <built-in method count of list object at 0x7f240c2d52c0>(None)
E        +    where <built-in method count of list object at 0x7f240c2d52c0> = [<rdkit.Chem.rdchem.Mol object at 0x7f240cfcfa70>, None, None, None, None, None].count

test/rdkitmol_from_docking_test.py:24: AssertionError
_______________________________________________________________________________________ test_arg_his _______________________________________________________________________________________

    def test_arg_his():
        fpath = datadir / "arg_his.pdbqt"
>       check_rdkit_bond_lengths(fpath, nr_expected_none=0, is_dlg=False, skip_typing=True)

test/rdkitmol_from_docking_test.py:61: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
test/rdkitmol_from_docking_test.py:20: in check_rdkit_bond_lengths
    return run_from_pdbqtmol(pdbqtmol, nr_expected_none)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

pdbqtmol = <Molecule named arg_his containing 9 poses of 43 atoms>, nr_expected_none = 0

    def run_from_pdbqtmol(pdbqtmol, nr_expected_none=0):
        mols = RDKitMolCreate.from_pdbqt_mol(pdbqtmol)
>       assert(mols.count(None) == nr_expected_none)
E       assert 2 == 0
E        +  where 2 = <built-in method count of list object at 0x7f240c2d7ac0>(None)
E        +    where <built-in method count of list object at 0x7f240c2d7ac0> = [<rdkit.Chem.rdchem.Mol object at 0x7f240e398820>, None, None].count

test/rdkitmol_from_docking_test.py:24: AssertionError
______________________________________________________________________________________ test_small_04 _______________________________________________________________________________________

>   def test_small_04(): run("small-04.sdf", wet=True)

test/rdkitmol_from_docking_test.py:104: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

sdfname = 'small-04.sdf', wet = True

    def run(sdfname, wet=False):
        fpath = datadir / sdfname
>       for mol in Chem.SDMolSupplier(str(fpath), removeHs=False):
E       OSError: File error: Bad input file /Meeko/test/rdkitmol_from_docking_data/small-04.sdf

test/rdkitmol_from_docking_test.py:72: OSError
===================================================================================== warnings summary =====================================================================================
test/macrocycle_test.py::test_all
  /usr/local/lib/python3.10/site-packages/meeko/molsetup.py:532: UserWarning: RDKit molecule not labeled as 3D. This warning won't show again.
    warnings.warn("RDKit molecule not labeled as 3D. This warning won't show again.")

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================================================================================= short test summary info ==================================================================================
FAILED test/rdkitmol_from_docking_test.py::test_asn_phe - assert 2 == 0
FAILED test/rdkitmol_from_docking_test.py::test_22_flexres - assert 22 == 0
FAILED test/rdkitmol_from_docking_test.py::test_phe_badphe - assert 5 == 1
FAILED test/rdkitmol_from_docking_test.py::test_arg_his - assert 2 == 0
FAILED test/rdkitmol_from_docking_test.py::test_small_04 - OSError: File error: Bad input file /Meeko/test/rdkitmol_from_docking_data/small-04.sdf
========================================================================= 5 failed, 27 passed, 1 warning in 3.20s ==========================================================================

steps to reproduce

  1. docker run --rm -it python:3.10-slim bash
  2. apt update && apt install -y git
  3. git clone https://github.com/forlilab/Meeko.git
  4. cd Meeko
  5. git checkout refs/tags/v0.5.0
  6. pip install meeko==0.5.0
  7. pip install rdkit scipy pandas pytest
  8. pytest

AssertionError when transfer mol2 file to pdbqt file

Hi,

Recently when I tried to transfer mol2 file to pdbqt file, I met with this error. Could you please help me about this? It seems that meeko could not get the SMILES from the structure. (The structure has a ring inside)

Thanks in advance.

Traceback (most recent call last):
  File "/home/song/anaconda3/envs/my-rdkit-env/bin/mk_prepare_ligand.py", line 292, in <module>
    pdbqt_string = preparator.write_pdbqt_string()
  File "/home/song/anaconda3/envs/my-rdkit-env/lib/python3.9/site-packages/meeko/preparation.py", line 198, in write_pdbqt_string
    return self._writer.write_string(self.setup, add_index_map, remove_smiles)
  File "/home/song/anaconda3/envs/my-rdkit-env/lib/python3.9/site-packages/meeko/writer.py", line 144, in write_string
    smiles, order = self.setup.get_smiles_and_order()
  File "/home/song/anaconda3/envs/my-rdkit-env/lib/python3.9/site-packages/meeko/molsetup.py", line 572, in get_smiles_and_order
    assert(len(parents) == 1)
AssertionError

Bug while using --verbose

(reactive_prep) [ahansel@nodea0114 ca_scaffold1]$ mk_prepare_ligand.py -i reacted_carboxylic_acids_scaffold1.sdf --multimol_outdir . --reactive_smarts "O=CN(N)c" --reactive_smarts_idx 2 -v
Traceback (most recent call last):
  File "/gpfs/home/ahansel/miniconda3/envs/reactive_prep/bin/mk_prepare_ligand.py", line 7, in <module>
    exec(compile(f.read(), __file__, 'exec'))
  File "/gpfs/home/ahansel/programs/Meeko/scripts/mk_prepare_ligand.py", line 366, in <module>
    if args.verbose: preparator.show_setup()
AttributeError: 'MoleculePreparation' object has no attribute 'show_setup'

AttributeError: 'PDBQTMolecule' object has no attribute 'export_rdkit_mol'

When I read in the results from Vina I get this error???

pdbqt_mol = PDBQTMolecule.from_file("/Users/brian/test/lab9/KRAS_pocket/Cpd1_scaffold/ZINC000000293947/results2/out.pdbqt", 
                                    skip_typing=True)

for pose in pdbqt_mol:
    print(pose.pose_id)
    rdkit_mol = pose.export_rdkit_mol()  
Traceback (most recent call last):

  Input In [23] in <cell line: 1>
    rdkit_mol = pose.export_rdkit_mol()

AttributeError: 'PDBQTMolecule' object has no attribute 'export_rdkit_mol'

mk_prepare_ligand.py can change the total charge of the processed molecule.

Hi,
I have downloaded some molecules from ZINC20 in mol2 format.
I then have used mk_prepare_ligand.py to convert the molecules to the pdbqt format.
For an high percentage of them mk_prepare_ligand.py takes in input a molecule with total charge
of -2 ( I have checked with openbabel GetTotalCharge() ) and return a pdbqt converted ligand with
a TOT CHARGE of +/.-0.00 as reported using the -v option.

Why these different values of total charge of the same molecule with different formats?

This different values of total charge of the ligands can have effects on the docking results?

For example for ZINC000001644610.mol2 openbabel evaluate a total charge equal -2 whereas
mk_prepare_ligand.py returns the following output when the previous molecule is processed:

Processing ./ZINC000001644610.mol2 file
Molecule setup

==============[ ATOMS ]===================================================
idx | coords | charge |ign| atype | connections
-----+----------------------------+--------+---+----------+--------------- . . .
0 | 0.002 -0.004 0.002 | -0.258 | 0 | OA | [1]
1 | -0.014 1.214 0.009 | 0.062 | 0 | N | [0, 2, 3]
2 | 1.032 1.837 0.002 | -0.258 | 0 | OA | [1]
3 | -1.306 1.936 0.019 | 0.271 | 0 | A | [1, 29, 4]
4 | -1.322 3.320 0.021 | 0.020 | 0 | A | [3, 5, 30]
5 | -2.522 4.006 0.030 | -0.006 | 0 | A | [4, 6, 31]
6 | -3.719 3.311 0.038 | 0.204 | 0 | A | [5, 7, 8]
7 | -4.899 3.984 0.048 | -0.288 | 0 | OA | [6]
8 | -3.709 1.909 0.036 | 0.117 | 0 | A | [6, 9, 29]
9 | -4.885 1.212 0.043 | -0.252 | 0 | NA | [8, 10]
10 | -5.000 0.135 0.768 | 0.035 | 0 | C | [9, 11, 32]
11 | -6.266 -0.614 0.776 | -0.007 | 0 | A | [10, 28, 12]
12 | -7.345 -0.173 0.001 | -0.053 | 0 | A | [11, 13, 33]
13 | -8.520 -0.869 0.008 | -0.053 | 0 | A | [12, 14, 34]
14 | -8.645 -2.023 0.791 | -0.007 | 0 | A | [13, 15, 27]
15 | -9.911 -2.772 0.799 | 0.035 | 0 | C | [14, 16, 35]
16 | -10.028 -3.847 1.527 | -0.252 | 0 | NA | [15, 17]
17 | -11.204 -4.543 1.535 | 0.117 | 0 | A | [16, 25, 18]
18 | -11.919 -4.727 0.349 | 0.046 | 0 | A | [17, 19, 36]
19 | -13.105 -5.431 0.364 | 0.271 | 0 | A | [18, 20, 23]
20 | -13.862 -5.626 -0.893 | 0.062 | 0 | N | [19, 21, 22]
21 | -13.436 -5.167 -1.938 | -0.258 | 0 | OA | [20]
22 | -14.910 -6.247 -0.883 | -0.258 | 0 | OA | [20]
23 | -13.591 -5.955 1.550 | 0.020 | 0 | A | [19, 24, 37]
24 | -12.893 -5.778 2.730 | -0.006 | 0 | A | [23, 25, 38]
25 | -11.698 -5.080 2.732 | 0.204 | 0 | A | [17, 24, 26]
26 | -11.011 -4.907 3.892 | -0.288 | 0 | OA | [25]
27 | -7.566 -2.465 1.565 | -0.053 | 0 | A | [14, 28, 39]
28 | -6.389 -1.771 1.554 | -0.053 | 0 | A | [11, 27, 40]
29 | -2.490 1.228 0.021 | 0.046 | 0 | A | [3, 8, 41]
30 | -0.391 3.868 0.015 | 0.070 | 0 | H | [4]
31 | -2.526 5.086 0.032 | 0.067 | 0 | H | [5]
32 | -4.166 -0.207 1.363 | 0.085 | 0 | H | [10]
33 | -7.248 0.717 -0.603 | 0.063 | 0 | H | [12]
34 | -9.353 -0.529 -0.589 | 0.063 | 0 | H | [13]
35 | -10.744 -2.432 0.201 | 0.085 | 0 | H | [15]
36 | -11.543 -4.320 -0.577 | 0.072 | 0 | H | [18]
37 | -14.521 -6.504 1.552 | 0.070 | 0 | H | [23]
38 | -13.279 -6.190 3.651 | 0.067 | 0 | H | [24]
39 | -7.662 -3.355 2.168 | 0.063 | 0 | H | [27]
40 | -5.557 -2.112 2.152 | 0.063 | 0 | H | [28]
41 | -2.474 0.148 0.018 | 0.072 | 0 | H | [29]
-----+----------------------------+--------+---+----------+--------------- . . .
TOT CHARGE: 0.000

Thanks.

Saverio

PS: I have posted this problem on [email protected] but I guess that this place is more appropriated an the question
is made more clear.
Sorry if this way is an error.

ZINC000001644610.pdbqt.txt
ZINC000001644610.mol2.txt

`nan` for charges on input molecule

For this sdf file generated from smiles I am getting nan for most of the charges but not all of them. Obviously autogrid and thus autodock won't work with this.

mk_prepare_ligand.py -i 1807026463.sdf -o 1807026463.pdbqt

example from pdbqt

REMARK SMILES O=C(CNC[P@TB4](=O)(O)O)NC[C@@H]1CCN(C(=O)c2ccc3[nH]ccc3n2)[C@H]1c1cccnc1
REMARK SMILES IDX 1 1 2 2 10 3 3 5 4 6 5 8 6 9 7 10 8 11 9 13 11 15 12 16
REMARK SMILES IDX 13 17 27 18 14 19 15 20 28 21 29 22 33 23 30 24 32 25 31 26
REMARK SMILES IDX 16 27 17 28 18 29 19 30 26 31 20 32 25 33 21 34 24 35 22 36
REMARK SMILES IDX 23 37
REMARK H PARENT 10 4 4 7 8 12 9 14 22 38
REMARK Flexibility Score: inf
ROOT
ATOM      1  O   UNL     1       2.575   1.154   2.196  1.00  0.00       nan OA
ATOM      2  C   UNL     1       3.632   1.590   1.747  1.00  0.00       nan C
ATOM      3  N   UNL     1       4.596   0.793   1.165  1.00  0.00       nan N
ATOM      4  H   UNL     1       5.384   1.250   0.723  1.00  0.00       nan HD
ENDROOT
BRANCH   2   5
ATOM      5  C   UNL     1       3.976   3.092   1.785  1.00  0.00       nan C
BRANCH   5   6
ATOM      6  N   UNL     1       3.546   3.754   0.536  1.00  0.00       nan NA
ATOM      7  H   UNL     1       2.546   3.568   0.409  1.00  0.00       nan HD
BRANCH   6   8
ATOM      8  C   UNL     1       3.771   5.223   0.624  1.00  0.00       nan C
BRANCH   8   9
ATOM      9  P   UNL     1       3.147   6.038  -0.891  1.00  0.00       nan P
ATOM     10  O   UNL     1       4.266   7.081  -0.831  1.00  0.00       nan OA

sdf

OpenBabel12062207433D

 58 61  0  0  1  0  0  0  0  0999 V2000
    2.5751    1.1544    2.1960 O   0  0  0  0  0  0  0  0  0  0  0  0
    3.6318    1.5902    1.7471 C   0  0  0  0  0  0  0  0  0  0  0  0
    3.9763    3.0916    1.7851 C   0  0  0  0  0  0  0  0  0  0  0  0
    3.5465    3.7542    0.5362 N   0  0  0  0  0  0  0  0  0  0  0  0
    3.7707    5.2230    0.6240 C   0  0  0  0  0  0  0  0  0  0  0  0
    3.1473    6.0381   -0.8912 P   0  0  0  0  0  0  0  0  0  0  0  0
    4.2662    7.0806   -0.8312 O   0  0  0  0  0  0  0  0  0  0  0  0
    3.6874    4.8215   -1.8525 O   0  0  0  0  0  0  0  0  0  0  0  0
    2.5581    6.8087   -2.3237 O   0  0  0  0  0  0  0  0  0  0  0  0
    4.5958    0.7933    1.1653 N   0  0  0  0  0  0  0  0  0  0  0  0
    4.4941   -0.6608    1.0781 C   0  0  0  0  0  0  0  0  0  0  0  0
    5.0611   -1.3693    2.3230 C   0  0  2  0  0  0  0  0  0  0  0  0
    6.5407   -1.0345    2.5503 C   0  0  0  0  0  0  0  0  0  0  0  0
    7.2719   -2.0827    1.7396 C   0  0  0  0  0  0  0  0  0  0  0  0
    6.4714   -3.2785    1.9294 N   0  0  0  0  0  0  0  0  0  0  0  0
    6.9033   -4.5926    1.7216 C   0  0  0  0  0  0  0  0  0  0  0  0
    6.1854   -5.5705    1.9295 O   0  0  0  0  0  0  0  0  0  0  0  0
    8.3140   -4.8378    1.2571 C   0  0  0  0  0  0  0  0  0  0  0  0
    8.9925   -5.9648    1.7139 C   0  0  0  0  0  0  0  0  0  0  0  0
   10.3084   -6.1863    1.3071 C   0  0  0  0  0  0  0  0  0  0  0  0
   10.8431   -5.2252    0.4401 C   0  0  0  0  0  0  0  0  0  0  0  0
   12.0762   -5.1030   -0.1450 N   0  0  0  0  0  0  0  0  0  0  0  0
   12.1307   -3.9764   -0.9203 C   0  0  0  0  0  0  0  0  0  0  0  0
   10.8981   -3.3557   -0.8405 C   0  0  0  0  0  0  0  0  0  0  0  0
   10.0932   -4.1371    0.0117 C   0  0  0  0  0  0  0  0  0  0  0  0
    8.8170   -3.9212    0.3969 N   0  0  0  0  0  0  0  0  0  0  0  0
    5.0632   -2.9259    2.1736 C   0  0  1  0  0  0  0  0  0  0  0  0
    4.4391   -3.5962    3.3766 C   0  0  0  0  0  0  0  0  0  0  0  0
    5.1487   -3.9177    4.5376 C   0  0  0  0  0  0  0  0  0  0  0  0
    4.5011   -4.5534    5.5938 C   0  0  0  0  0  0  0  0  0  0  0  0
    3.1506   -4.8304    5.4666 C   0  0  0  0  0  0  0  0  0  0  0  0
    2.4213   -4.5197    4.3757 N   0  0  0  0  0  0  0  0  0  0  0  0
    3.0825   -3.9207    3.3580 C   0  0  0  0  0  0  0  0  0  0  0  0
    5.0573    3.2046    1.9266 H   0  0  0  0  0  0  0  0  0  0  0  0
    3.4735    3.5243    2.6581 H   0  0  0  0  0  0  0  0  0  0  0  0
    2.5465    3.5676    0.4094 H   0  0  0  0  0  0  0  0  0  0  0  0
    4.8497    5.3894    0.7251 H   0  0  0  0  0  0  0  0  0  0  0  0
    3.2608    5.6595    1.4890 H   0  0  0  0  0  0  0  0  0  0  0  0
    4.4609    4.3583   -1.4764 H   0  0  0  0  0  0  0  0  0  0  0  0
    3.2911    7.4042   -2.5826 H   0  0  0  0  0  0  0  0  0  0  0  0
    5.3838    1.2495    0.7228 H   0  0  0  0  0  0  0  0  0  0  0  0
    5.0336   -0.9584    0.1730 H   0  0  0  0  0  0  0  0  0  0  0  0
    3.4406   -0.9323    0.9455 H   0  0  0  0  0  0  0  0  0  0  0  0
    4.4784   -1.0402    3.1932 H   0  0  0  0  0  0  0  0  0  0  0  0
    6.7854   -1.1633    3.6114 H   0  0  0  0  0  0  0  0  0  0  0  0
    6.8312   -0.0190    2.2640 H   0  0  0  0  0  0  0  0  0  0  0  0
    8.3026   -2.2082    2.0801 H   0  0  0  0  0  0  0  0  0  0  0  0
    7.2580   -1.8355    0.6723 H   0  0  0  0  0  0  0  0  0  0  0  0
    8.5057   -6.6693    2.3902 H   0  0  0  0  0  0  0  0  0  0  0  0
   10.8784   -7.0479    1.6417 H   0  0  0  0  0  0  0  0  0  0  0  0
   12.8494   -5.7551   -0.0190 H   0  0  0  0  0  0  0  0  0  0  0  0
   13.0246   -3.7064   -1.4653 H   0  0  0  0  0  0  0  0  0  0  0  0
   10.6041   -2.4430   -1.3353 H   0  0  0  0  0  0  0  0  0  0  0  0
    4.5151   -3.2370    1.2749 H   0  0  0  0  0  0  0  0  0  0  0  0
    6.2113   -3.7067    4.6121 H   0  0  0  0  0  0  0  0  0  0  0  0
    5.0405   -4.8363    6.4900 H   0  0  0  0  0  0  0  0  0  0  0  0
    2.6036   -5.3278    6.2620 H   0  0  0  0  0  0  0  0  0  0  0  0
    2.4629   -3.7077    2.4902 H   0  0  0  0  0  0  0  0  0  0  0  0
  1  2  2  0  0  0  0
  2  3  1  0  0  0  0
  2 10  1  0  0  0  0
  3  4  1  0  0  0  0
  3 34  1  0  0  0  0
  3 35  1  0  0  0  0
  4  5  1  0  0  0  0
  4 36  1  0  0  0  0
  5  6  1  0  0  0  0
  5 37  1  0  0  0  0
  5 38  1  0  0  0  0
  6  7  2  0  0  0  0
  6  8  1  0  0  0  0
  6  9  1  0  0  0  0
  8 39  1  0  0  0  0
  9 40  1  0  0  0  0
 10 11  1  0  0  0  0
 10 41  1  0  0  0  0
 11 12  1  0  0  0  0
 11 42  1  0  0  0  0
 11 43  1  0  0  0  0
 12 13  1  0  0  0  0
 12 27  1  0  0  0  0
 12 44  1  1  0  0  0
 13 14  1  0  0  0  0
 13 45  1  0  0  0  0
 13 46  1  0  0  0  0
 14 15  1  0  0  0  0
 14 47  1  0  0  0  0
 14 48  1  0  0  0  0
 15 16  1  0  0  0  0
 15 27  1  0  0  0  0
 16 17  2  0  0  0  0
 16 18  1  0  0  0  0
 18 19  1  0  0  0  0
 18 26  2  0  0  0  0
 19 20  2  0  0  0  0
 19 49  1  0  0  0  0
 20 21  1  0  0  0  0
 20 50  1  0  0  0  0
 21 22  1  0  0  0  0
 21 25  2  0  0  0  0
 22 23  1  0  0  0  0
 22 51  1  0  0  0  0
 23 24  2  0  0  0  0
 23 52  1  0  0  0  0
 24 25  1  0  0  0  0
 24 53  1  0  0  0  0
 25 26  1  0  0  0  0
 27 28  1  0  0  0  0
 27 54  1  6  0  0  0
 28 29  1  0  0  0  0
 28 33  2  0  0  0  0
 29 30  2  0  0  0  0
 29 55  1  0  0  0  0
 30 31  1  0  0  0  0
 30 56  1  0  0  0  0
 31 32  2  0  0  0  0
 31 57  1  0  0  0  0
 32 33  1  0  0  0  0
 33 58  1  0  0  0  0
M  END
$$$$

Problem about prepared ligand hydrogen

Hello,

I have a problem about mk_prepare_ligand.py.

I use mk_prepare_ligand.py -i ligand.sdf -o ligand.pdbqt to prepare ligand. However, when I open ligand.pdbqt by pymol. I find that it could use h_add to add hydrogen for the pdbqt file.

I don't know why it happens. So, I have 2 questions:

  1. Is this because I didn't add keep_nonpolar_hydrogens=True?
  2. Does it affect the outcome of docking?

Meeko doesn't handle rings correctly

Hello, when I tried to use Meeko to convert IMP.sdf to pdbqt format for input vina docking, I found that Meeko could not complete the ring conversion correctly. I would appreciate it if you could help me!

right_sdf
right format
wrong_pdbqt
wrong format

Below is the sdf file of imp

Unnamed
  Chem3D Core 17.111032222593D

 36 38  0  0  0  0  0  0  0  0999 V2000
    4.0718    1.9877    0.2177 P   0  0  0  0  0  0  0  0  0  0  0  0
    0.6910   -0.4213    1.3087 O   0  0  0  0  0  0  0  0  0  0  0  0
   -1.1639   -2.4556   -0.9179 O   0  0  0  0  0  0  0  0  0  0  0  0
    0.8139   -3.3170    0.5050 O   0  0  0  0  0  0  0  0  0  0  0  0
    3.1542    0.8157    0.7939 O   0  0  0  0  0  0  0  0  0  0  0  0
    5.4029    1.5379   -0.5815 O   0  0  0  0  0  0  0  0  0  0  0  0
    3.3955    2.9083   -0.9286 O   0  0  0  0  0  0  0  0  0  0  0  0
   -4.7849    3.0442   -0.1740 O   0  0  0  0  0  0  0  0  0  0  0  0
    4.5449    2.9491    1.2463 O   0  0  0  0  0  0  0  0  0  0  0  0
   -1.4154    0.4007    0.4349 N   0  0  0  0  0  0  0  0  0  0  0  0
   -2.0003    2.3267   -0.0122 N   0  0  0  0  0  0  0  0  0  0  0  0
   -3.4928   -0.6114    0.6783 N   0  0  0  0  0  0  0  0  0  0  0  0
   -5.1522    0.9009    0.3242 N   0  0  0  0  0  0  0  0  0  0  0  0
   -0.1975   -1.4875   -0.5944 C   0  0  0  0  0  0  0  0  0  0  0  0
    1.1076   -2.1535   -0.2311 C   0  0  0  0  0  0  0  0  0  0  0  0
   -0.5364   -0.7498    0.6887 C   0  0  0  0  0  0  0  0  0  0  0  0
    1.7369   -1.1093    0.6744 C   0  0  0  0  0  0  0  0  0  0  0  0
    2.5990   -0.1168   -0.1013 C   0  0  0  0  0  0  0  0  0  0  0  0
   -2.6786    0.3297    0.4563 C   0  0  0  0  0  0  0  0  0  0  0  0
   -1.0054    1.5650    0.1609 C   0  0  0  0  0  0  0  0  0  0  0  0
   -3.0265    1.6000    0.1602 C   0  0  0  0  0  0  0  0  0  0  0  0
   -4.3332    1.9552    0.0789 C   0  0  0  0  0  0  0  0  0  0  0  0
   -4.7263   -0.3414    0.6141 C   0  0  0  0  0  0  0  0  0  0  0  0
   -0.0771   -0.7933   -1.4560 H   0  0  0  0  0  0  0  0  0  0  0  0
    1.7281   -2.4498   -1.1033 H   0  0  0  0  0  0  0  0  0  0  0  0
   -1.0577   -1.4435    1.3926 H   0  0  0  0  0  0  0  0  0  0  0  0
    2.3685   -1.5955    1.4560 H   0  0  0  0  0  0  0  0  0  0  0  0
    1.9849    0.4151   -0.8640 H   0  0  0  0  0  0  0  0  0  0  0  0
    3.4231   -0.6625   -0.6186 H   0  0  0  0  0  0  0  0  0  0  0  0
   -1.0477   -3.2057   -0.3268 H   0  0  0  0  0  0  0  0  0  0  0  0
    1.6173   -3.7902    0.7268 H   0  0  0  0  0  0  0  0  0  0  0  0
    0.0480    1.8538    0.0825 H   0  0  0  0  0  0  0  0  0  0  0  0
   -5.4706   -1.1293    0.7990 H   0  0  0  0  0  0  0  0  0  0  0  0
   -6.1503    1.0246    0.2951 H   0  0  0  0  0  0  0  0  0  0  0  0
    6.1503    1.9001   -0.1371 H   0  0  0  0  0  0  0  0  0  0  0  0
    3.3333    3.7902   -0.6039 H   0  0  0  0  0  0  0  0  0  0  0  0
  1  5  1  0      
  1  6  1  0      
  1  7  1  0      
  1  9  2  0      
  2 16  1  0      
  2 17  1  0      
  3 14  1  0      
  3 30  1  0      
  4 15  1  0      
  4 31  1  0      
  5 18  1  0      
  6 35  1  0      
  7 36  1  0      
  8 22  2  0      
 10 16  1  0      
 10 19  1  0      
 10 20  1  0      
 11 20  2  0      
 11 21  1  0      
 12 19  1  0      
 12 23  2  0      
 13 22  1  0      
 13 23  1  0      
 13 34  1  0      
 14 15  1  0      
 14 16  1  0      
 14 24  1  0      
 15 17  1  0      
 15 25  1  0      
 16 26  1  0      
 17 18  1  0      
 17 27  1  0      
 18 28  1  0      
 18 29  1  0      
 19 21  2  0      
 20 32  1  0      
 21 22  1  0      
 23 33  1  0      
M  END


$$$$

Problem with pdb format

Dear authors,
Thank you for the Meeko package!
I use rdkit to parse pdbqt files, but your output pdbqt files cannot be read. I found that it happens because of atoms of C(C10 and the next) starts at column 13 (instead of 14):
PDB format in the https://www.wwpdb.org/documentation/file-format-content/format33/sect9.html:
"Alignment of one-letter atom name such as C starts at column 14, while two-letter atom name such as FE starts at column 13."
And problem causes "Cl" (rdkit requires "CL"), there is nothing about case in the site but all examples have upper case.
Example of the file:
CHEMBL482567.pdbqt.txt
CHEMBL482567_correct.pdbqt.txt
Could you fix it please?

Perhaps an API change in RDKit

I encountered a problem when using meeko with RDKit 2021.09.4. In this version of RDKit, the API to get residue number has been named as GetResidueNumber(), while in line 46 of meeko/utils/rdkitutils.py used GetResidueNum() instead, which caused an AttributeError.

AttributeError: 'AtomPDBResidueInfo' object has no attribute 'GetResidueNum'

Maybe you can fix this problem in the next update.

write_pdbqt_string error for large molecules (protein)

For class RDKitMoleculeSetup in molsetup.py:

def find_pattern(self, smarts):
    p = Chem.MolFromSmarts(smarts)
    return self.mol.GetSubstructMatches(p)

mol.GetSubstructMatches has a default parameter maxMatches=1000. For mol with more than 1000 same element, e.g. C, excess atoms will not be setup.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.