Package: easydock
EasyDock - Python module to automate molecular dockingInstallationpip install easydockor the latest version from githubpip install git+https://github.com/ci-lab-cz/easydock.gitDependenciesfrom condaconda install -c conda-forge python=3.9 numpy=1.20 rdkit scipy dask distributedfrom pypipip install meekoto use multiple servers for docking installparamiko(backend ofdaskif launched from the command line)pip install paramikoInstallation ofvinapip install vinaInstallation ofgnina/sminais described athttps://github.com/gnina/gninaDescriptionFully automatic pipeline for molecular docking.Features:the major scriptrun_docksupports docking withvinaandgnina(gninaalso supportssminaand its custom scoring functions)can be used as a command line utility or imported as a python modulesupports distributed computing usingdasklibrarysupports docking of boron-containing compounds usingvinaandsmina(boron is replaced with carbon before docking and returned back)all outputs are stored in an SQLite databaseinterrupted calculations can be restarted by invoking the same command or by supplying just a single argument - the existing output databaseget_sdf_from_dock_dbis used to extract data from output DBPipeline:input SMILES are converted in 3D by RDKit, if input is 3D structures in SDF their conformations wil be taken as starting without changes.ligands are protonated by chemaxon at pH 7.4 and the most stable tautomers are generated (optional, requires a Chemaxon license)molecules are converted in PDBQT format using Meekodocking withvina/gninaoutput poses are converted in MOL format and stored into output DB along with docking scoresExampleDocking from command lineDocking usingvinatakes input SMILES and a config file. Ligands will not be protonated with Chemaxon, so their supplied charged states will be used. 4 CPU cores will be used (4 molecules will be dock in parallel). When docking will finish an SDF file will be created with top docking poses for each ligand.run_dock -i input.smi -o output.db --program vina --config config.yml --no_protonation -c 4 --sdfExample of config.yml forvinadockingprotein: /path/to/protein.pdbqt
protein_setup: /path/to/grid.txt
exhaustiveness: 8
seed: 0
n_poses: 5
ncpu: 5NOTE: ncpu argument inrun_dockandconfig.ymlhas different meaning. Inrun_dockit means the number of molecules docked in parallel. Inconfig.ymlit means the number of CPUs used for docking of a single molecule. The product of these two values should be equal or a little bit more than the number of CPUs on a computer.The same but usinggninarun_dock -i input.smi -o output.db --program gnina --config config.yml --no_protonation -c 4 --sdfExample of config.yml forgninadockingscript_file: /path/to/gnina_executable
protein: /path/to/protein.pdbqt
protein_setup: /path/to/grid.txt
exhaustiveness: 8
scoring: default
cnn_scoring: rescore
cnn: dense_ensemble
n_poses: 10
addH: False
ncpu: 1
seed: 0To usesminainvokegninaas shown above and make corresponding changes in config.ymlscript_file: /path/to/gnina_executable
protein: /path/to/protein.pdbqt
protein_setup: /path/to/grid.txt
exhaustiveness: 8
scoring: vinardo
cnn_scoring: None
cnn: dense_ensemble
n_poses: 10
addH: False
ncpu: 1
seed: 0Docking using multiple serversTo distribute docking over multiple servers one have to start dask cluster and call the scriptdaskssh--hostfile$PBS_NODEFILE--nworkers15--nthreads1&sleep10run_dock-iinput.smi-ooutput.db--programvina--configconfig.yml--no_protonation--sdf--hostfile$PBS_NODEFILE--dask_report$PBS_NODEFILEis a file containing list of IP addresses of servers. The first one from the list will be used by a dask scheduler, but it will also participate in computations.--nworkersis the number of workers per host. This is the number of molecules which are docked in parallel on a single host.--nthreadscan be any value. The number of CPUs used for docking of a single molecule will be taken fromconfig.yml.--dask_reportargument will create at the end of calculations an html-file with performance report (may be useful to tweak docking parameters).Important setup issue- the limit of open files on every server should be increased to the level at least twice the total number of requested workers (file streams are used for inter-node communication by dask).Data retrieval from the output databaseTo extract data from the database one may use the scriptget_sdf_from_dock_db.Extract top poses with their scores (additional information in DB fields can be extracted only for the top poses):get_sdf_from_dock_db -i output.db -o output.sdf --fields docking_scoreRetrieve second poses for compoundsmol_1andmol_4in SDF format:get_sdf_from_dock_db -i output.db -o output.sdf -d mol_1 mol_4 --poses 2Instead of a list of ids a text file can be supplied as an argument-d.Retrieve top poses for compounds with docking score less then -10:get_sdf_from_dock_db -i output.db -o output.sdf --fields docking_score --add_sql 'docking_score < -10'Docking from PythonDock a list of molecules on a local computer. Importmol_dockfunction from a corresponding submodule.fromeasydock.run_dockimportdockingfromeasydock.vina_dockimportmol_dock# from easydock.gnina_dock import mol_dock  # <- enable gnina dockingfromrdkitimportChemsmiles=['CC(=O)O','NCC(=O)O','NC(C)C(=O)O']mols=[Chem.MolFromSmiles(smi)forsmiinsmiles]# assign names, because this will be an identifier of docking outputs of a moleculeformol,smiinzip(mols,smiles):mol.SetProp('_Name',smi)formol_id,resindocking(mols,dock_func=mol_dock,dock_config='config.yml',ncpu=4):print(mol_id,res)CustomizationTo implement support of a custom docking program one should implement a function likemol_dockwhich will take as input an RDKit mol object (named molecule) and an yml-file with all docking parameters. The function should run a command line script/utility and return back a tuple of a molecule name and a dictionary of parameters and their values which should be stored in DB (parameter names should be exactly the same as corresponding field names in DB). For examples, please look atmol_dockfunctions invina_dockorgnina_dock.Changelog0.2.8conversion of PDBQT to Mol by means of Meeko (improvement)PR19clarify installation instructions0.2.7add an optional UNIQUE constraint on SMILES field in the main table on database creation (currently duplicates are not removed)0.2.6fix compatibility issue with meeko version 0.5.00.2.5fix input argument typeupdate examples and citation0.2.4close pool explicitly to solve issue with multiprocessingreplace subprocess calls with runexplicitly set types of command line arguments which a file paths (solve issue with relative paths)0.2.3improve descriptions of examples on READMEcatch all exceptions in conversion of PDBQT to Molmove DB related functions to a new database.py moduleuse SMILES temporary file to protonate molecules with cxcalcadd functions to get molecules from DB in Python (get_mols, select_from_db)0.2.2fix bug with continuation of calculations after db was transferred to other machinerestrict precedence of command line arguments over arguments restored from DB only to specific ones (output, hostfile, dask_report, ncpu, verbose)0.2.1fix treatment of molecule ids in get_sdf_from_dock_dbchange installation instructions, vina must be installed from sourcesadd argument no_tautomerization to disable tautomerization during protonation(critical) fix conversion of PDBQT to Mol which could not assign bond orders and returned molecules with only single bonds0.2.0the stable version with multiple fixes and updatesdask library was fully integrated and testedAPI was redesigneddocking of boron-containing compounds was implemented (Vina, smina)a function to predict docking runtime was introduced0.1.2(bugfix) docking of macrocycles is rigid (in future may be changed)LicenceBSD-3CitationMinibaeva, G.; Ivanova, A.; Polishchuk, P.,EasyDock: customizable and scalable docking tool.Journal of Cheminformatics2023, 15 (1), 102.https://doi.org/10.1186/s13321-023-00772-2