Package: meeko
Meeko: preparation of small molecules for AutoDockMeeko reads an RDKit molecule object and writes a PDBQT string (or file)
forAutoDock-VinaandAutoDock-GPU.
It converts the docking output to RDKit molecules and
SD files, without loss of bond orders.Meeko is developed by theForli labat theCenter for Computational Structural Biology (CCSB)atScripps Research.Usage notesMeeko 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.
Seethis discussionand RDKit issues1755and917.API changes in v0.5ClassMoleculePreparationno longer has methodwrite_pdbqt_string().
Instead,MoleculePreparation.prepare()returns a list ofMoleculeSetupobjects
that must be passed, individually, toPDBQTWriterLegacy.write_string().frommeekoimportMoleculePreparationfrommeekoimportPDBQTWriterLegacypreparator=MoleculePreparation()mol_setups=preparator.prepare(rdkit_molecule_3D_with_Hs)forsetupinmol_setups:pdbqt_string,is_ok,error_msg=PDBQTWriterLegacy.write_string(setup)ifis_ok:print(pdbqt_string,end="")Argumentkeep_nonpolar_hydrogensis replaced bymerge_these_atom_types, both in the Python
interface and for scriptmk_prepare_ligand.py.
The default ismerge_these_atom_types=("H",), which
merges hydrogens typed"H", keeping the current default behavior.
To keep all hydrogens, setmerge_these_atom_typesto an empty
list when initializingMoleculePreparation, or pass no atom types
to--merge_these_atom_typesfrom the command line:mk_prepare_ligand.py-imolecule.sdf--merge_these_atom_typesDependenciesPython (>=3.5)NumpyScipyRDKitProDy (optionally, for covalent docking)Conda or Miniconda can install the dependencies:condainstall-cconda-forgenumpyscipyrdkit
pipinstallprody# optional. pip recommended at http://prody.csb.pitt.edu/downloads/Installation (from PyPI)$pipinstallmeekoIf using conda,pipinstalls the package in the active environment.Installation (from source)You'll get the develop branch, which may be ahead of the latest release.$gitclonehttps://github.com/forlilab/Meeko
$cdMeeko
$pipinstall.Optionally include--editable. Changes in the original package location
take effect immediately without the need to runpip install .again.$pipinstall--editable.Examples using the command line scripts1. make PDBQT filesAutoDock-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.pdbqtmk_prepare_ligand.py -i multi_mol.sdf --multimol_outdir folder_for_pdbqt_files2. convert docking results to SDFAutoDock-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.sdfmk_export.py vina_results.pdbqt -o vina_results.sdfmk_export.py autodock-gpu_results.dlg -o autodock-gpu_results.sdfMaking 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"-opdbqt--gen3d|obabel-ipdbqt-osmi[C]1=[C][C]=[C]O1Python tutorial1. making PDBQT strings for Vina or for AutoDock-GPUfrommeekoimportMoleculePreparationfrommeekoimportPDBQTWriterLegacyfromrdkitimportCheminput_molecule_file="example/BACE_macrocycle/BACE_4.sdf"# there is one molecule in this SD file, this loop iterates just onceformolinChem.SDMolSupplier(input_molecule_file,removeHs=False):preparator=MoleculePreparation()mol_setups=preparator.prepare(mol)forsetupinmol_setups:setup.show()# optionalpdbqt_string=PDBQTWriterLegacy.write_string(setup)At this point,pdbqt_stringcan be written to a file for
docking with AutoDock-GPU or Vina, or passed directly to Vina within Python
usingset_ligand_from_string(pdbqt_string). For context, seethe docs on using Vina from Python.2. RDKit molecule from docking resultsfrommeekoimportPDBQTMoleculefrommeekoimportRDKitMolCreatefn="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 ofrdkitmol_listis 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 inrdkitmol_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 aNoneinrdkitmol_list.For Vina's output PDBQT files, omitis_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.
Seethe docsfor context on thevobject.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.importjsonfrommeekoimportMoleculePreparationmk_config={"hydrate":True}# any arguments of MoleculePreparation.__init__print(json.dumps(mk_config),file=open('mk_config.json','w'))withopen('mk_config.json')asf:mk_config=json.load(f)preparator=MoleculePreparation.from_config(mk_config)The command line toolmk_prepare_ligand.pycan read the json files using
option-cor--config.Possibly useful configurations of MoleculePreparationHere 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 3Docking covalent ligands as flexible sidechainsThe 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 smilesCCSCCC(=O)N.Meeko will align the ligand atoms that match the C-alpha and C-beta of
the protein sidechain. Options--tether_smartsand--tether_smarts_indicesdefine these atoms. For a cysteine,--tether_smarts "SCC"and--tether_smarts_indices 3 2would 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_dockingmk_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.pdbqtReactive Docking1. Prepare protein with waterkitFollowwk_prepare_receptor.pyinstructions 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.,HIEorHIDinstead ofHIS.2. Prepare protein pdbqtHere,wk.pdbwas written by waterkit.
Here,wk.pdbwas written by waterkit. The example below will center a gridbox of specified size on the given reactive residue.$mk_prepare_receptor.py\--pdbwk.pdb\-oreceptor.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_12R_EQ_12r_eqforreactiveatoms(1-2interaction)--eps_12EPS_12epsilonforreactiveatoms(1-2interaction)--r_eq_13_scalingR_EQ_13_SCALINGr_eqscalingfor1-3interactionacrossreactiveatoms--r_eq_14_scalingR_EQ_14_SCALINGr_eqscalingfor1-4interactionacrossreactiveatomsReceptor 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 autogridMake affinity maps for the_rigid.pdbqtpart of the receptor.
Make affinity maps for the_rigid.pdbqtpart of the receptor.mk_prepare_receptor.pywill prepare the GPF for you.4. Write ligand PDBQTmk_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 dockingFor 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_dpfThe--derivtypeoption, if needed, was written bymk_prepare_receptor.pyto a file suffixed with.derivtype.The filename to be passed to--import_dpfwas written bymk_prepare_receptor.pyand it is suffixed withreactive_config.ADGPU-I*.reactive_config-Lsufex1.pdbqt-Nsufex1_docked_-F*_flex.pdbqt-C1