diff --git a/LICENCE.txt b/LICENSE.txt similarity index 100% rename from LICENCE.txt rename to LICENSE.txt diff --git a/README.md b/README.md index 3b92530..12bc384 100644 --- a/README.md +++ b/README.md @@ -3,17 +3,17 @@ Uni-GBSA: An Automatic Workflow to Perform MM/GB(PB)SA Calculations for Virtual [[Briefings in Bioinformatics](https://academic.oup.com/bib/advance-article/doi/10.1093/bib/bbad218/7199492)] -## Backgroud +## Background -Calculating the binding free energy of a ligand to a protein receptor is a crucial goal in drug discovery. Molecular mechanics/Generalized-Born (Poisson–Boltzmann) surface area (MM/GB(PB)SA), which balances accuracy and efficiency, is one of the most widely used methods for evaluating ligand binding free energies in virtual screening. Uni-GBSA is an automatic workflow to perform MM/GB(PB)SA calculations. It includes several functions including but not limited to topology preparation, structure optimization, binding free energy calculation, and parameter scanning for MM/GB(PB)SA calculations. It also has a batch mode that allows the evaluation of thousands of molecules against one protein target simultaneously, enabling its application in virtual screening. +Calculating the binding free energy of a ligand to a protein receptor is a crucial goal in drug discovery. Molecular mechanics/Generalized-Born (Poisson-Boltzmann) surface area (MM/GB(PB)SA), which balances accuracy and efficiency, is one of the most widely used methods for evaluating ligand binding free energies in virtual screening. Uni-GBSA is an automatic workflow to perform MM/GB(PB)SA calculations. It includes several functions, including but not limited to topology preparation, structure optimization, binding free energy calculation, and parameter scanning for MM/GB(PB)SA calculations. Additionally, it has a batch mode that allows the evaluation of thousands of molecules against one protein target simultaneously, enabling its application in virtual screening. ## Install -### Install by conda +### Install via Conda To run uni-GBSA, you need to install several third-party softwares including acpype, gmx_MMPBSA, lickit, etc. ```Bash -conda create -n gbsa -c conda-forge acpype openmpi mpi4py gromacs +conda create -n gbsa -c conda-forge acpype openmpi mpi4py gromacs "gmx_mmpbsa>=1.5.6" conda activate gbsa -pip install unigbsa gmx_MMPBSA>=1.5.6 lickit +pip install unigbsa lickit ``` ### Install by docker images @@ -21,15 +21,15 @@ You can also build a docker image using this file or pull from the docker hub `d ```Plaintext FROM continuumio/miniconda3 -# 1. create a enverioment +# 1. create an environment SHELL ["/bin/bash", "-c"] -RUN conda create -n gbsa -c conda-forge acpype openmpi mpi4py gromacs \ +RUN conda create -n gbsa -c conda-forge acpype openmpi mpi4py gromacs "gmx_MMPBSA>=1.5.6" \ && echo 'conda activate gbsa' >> ~/.bashrc \ && rm -rf /opt/conda/pkgs/* # 2. install unigbsa RUN source ~/.bashrc \ -&& pip install unigbsa gmx_MMPBSA>=1.5.6 lickit \ +&& pip install unigbsa lickit \ && rm -rf ~/.cache/* ``` @@ -39,21 +39,21 @@ RUN source ~/.bashrc \ ### Usage ```bash $ unigbsa-pipeline -h -usage: unigbsa-pipeline [-h] -i RECEPTOR [-l LIGAND [LIGAND ...]] [-c CONFIG] [-d LIGDIR] [-f PBSAFILE] [-o OUTFILE] [-nt THREAD] - [--decomp] [--verbose] [-v] +usage: unigbsa-pipeline [-h] -i RECEPTOR [-l LIGAND [LIGAND ...]] [-c CONFIG] [-d LIGDIR] [-f PBSAFILE] [-o OUTFILE] [-validate] [-nt THREADS] [--decomp] [--verbose] [-v] -GBSA Calculation. Version: 0.0.9_dev +MM/GB(PB)SA Calculation. Version: 0.1.6 -options: +optional arguments: -h, --help show this help message and exit - -i RECEPTOR Input protein file with pdb format. + -i RECEPTOR Input protein file in pdb format. -l LIGAND [LIGAND ...] - Ligand files to calculate binding energy. - -c CONFIG Configue file, default: /opt/miniconda3/envs/test/lib/python3.10/site-packages/unigbsa-0.0.9.dev0-py3.10.egg/unigbsa/data/default.ini - -d LIGDIR Floder contains many ligand files. file format: .mol or .sdf + Ligand files to calculate binding energy for. + -c CONFIG Config file, default: /home/jochem/miniforge3/envs/gbsa_test/lib/python3.9/site-packages/unigbsa/data/default.ini + -d LIGDIR Directory containing many ligand files. file format: .mol or .sdf -f PBSAFILE gmx_MMPBSA input file. default=None -o OUTFILE Output file. - -nt THREAD Set number of thread to run this program. + -validate Validate the ligand file. default: False + -nt THREADS Set number of threads to run this program. --decomp Decompose the free energy. default:False --verbose Keep all the files. -v, --version show program's version number and exit @@ -63,17 +63,15 @@ options: ```bash $ unigbsa-pipeline -i example/1ceb/1ceb_protein.pdb -l example/1ceb/1ceb_ligand.sdf -o BindingEnergy.csv -10/08/2022 13:46:09 PM - INFO - Build protein topology. -10/08/2022 13:46:10 PM - INFO - Build ligand topology: 1ceb_ligand -1 molecule converted -10/08/2022 13:46:13 PM - INFO - Running energy minimization: 1ceb_ligand -10/08/2022 13:46:14 PM - INFO - Run the MMPB(GB)SA. -10/08/2022 13:46:18 PM - INFO - Clean the results. +07/07/2024 15:56:01 PM - INFO - Build protein topology. +07/07/2024 15:56:02 PM - INFO - Build ligand topology: 1ceb_ligand +07/07/2024 15:56:03 PM - INFO - Running energy minimization: 1ceb_ligand +07/07/2024 15:56:04 PM - INFO - Run the MMPB(GB)SA. +07/07/2024 15:56:12 PM - INFO - Clean the results. ================================================================================ Results: Energy.csv Dec.csv -Frames mode detal_G(kcal/mole) - 1 gb -20.4421 - +Frames mode delta_G(kcal/mole) + 1 gb -20.1781 ``` ## Other Tools @@ -82,22 +80,22 @@ This packge contains several commands: `unigbsa-scan`, `unigbsa-pipeline`, `unig ### unigbsa-scan >Perform an automatic parameter optimization prior to production MM/GB(PB)SA calculations. ```Bash -usage: unigbsa-scan [-h] [-i RECEPTOR] [-pd PROTDIR] [-l LIGAND [LIGAND ...]] [-ld LIGDIR] -e E -c PARASFILE [-o OUTDIR] - [-nt THREAD] [--verbose] +$ unigbsa-scan -h +usage: unigbsa-scan [-h] [-i RECEPTOR] [-pd PROTDIR] [-l LIGAND [LIGAND ...]] [-ld LIGDIR] -e E -c PARASFILE [-o OUTDIR] [-nt THREADS] [--verbose] -GBSA Calculation. +Perform an automatic parameter optimization prior to production MM/GB(PB)SA calculations. optional arguments: -h, --help show this help message and exit - -i RECEPTOR Input protein file with pdb format. - -pd PROTDIR Floder contains many protein files. file format: .pdb + -i RECEPTOR Input protein file in pdb format. + -pd PROTDIR Directory containing many protein files. file format: .pdb -l LIGAND [LIGAND ...] Ligand files to calculate binding energy. - -ld LIGDIR Floder contains many ligand files. file format: .mol or .sdf + -ld LIGDIR Directory containing many ligand files. file format: .mol or .sdf -e E Experiment data file. -c PARASFILE Parameters to scan -o OUTDIR Output directory. - -nt THREAD Set number of thread to run this program. + -nt THREADS Set number of threads to run this program. --verbose Keep all the files. ``` >Example @@ -105,32 +103,34 @@ optional arguments: unigbsa-scan -i example/scan/protein.pdb -ld example/scan/ -e example/scan/ligands.csv -c example/scan/scan.json -o scan-demo -nt 4 ``` - ### unigbsa-pipeline >A simple, automatic pipeline to perform MM/GB(PB)SA calculations. You only need to provide a protein file (in the PDB format) and ligand files (in the MOL or SDF format). This function will perform an energy minimization then calculate the PBSA/GBSA values for the each input ligand. * If you want perform energy minimization or MD simulation for the complex automatically, use the ``unigbsa-pipeline`` function. ```Bash -usage: unigbsa-pipeline [-h] -i RECEPTOR [-l LIGAND [LIGAND ...]] [-c CONFIG] [-d LIGDIR] [-f PBSAFILE] [-o OUTFILE] [-nt THREAD] [--decomp] [--verbose] +$ unigbsa-pipeline -h +usage: unigbsa-pipeline [-h] -i RECEPTOR [-l LIGAND [LIGAND ...]] [-c CONFIG] [-d LIGDIR] [-f PBSAFILE] [-o OUTFILE] [-validate] [-nt THREADS] [--decomp] [--verbose] [-v] -GBSA Calculation. +MM/GB(PB)SA Calculation. Version: 0.1.6 optional arguments: -h, --help show this help message and exit - -i RECEPTOR Input protein file with pdb format. + -i RECEPTOR Input protein file in pdb format. -l LIGAND [LIGAND ...] - Ligand files to calculate binding energy. - -c CONFIG Configue file, default: default.ini - -d LIGDIR Floder contains many ligand files. file format: .mol or .sdf + Ligand files to calculate binding energy for. + -c CONFIG Config file, default: default.ini + -d LIGDIR Directory containing many ligand files. file format: .mol or .sdf -f PBSAFILE gmx_MMPBSA input file. default=None -o OUTFILE Output file. - -nt THREAD Set number of thread to run this program. + -validate Validate the ligand file. default: False + -nt THREADS Set number of threads to run this program. --decomp Decompose the free energy. default:False --verbose Keep all the files. + -v, --version show program's version number and exit ``` -You can change the parameters for the MM/GB(PB)SA calculations by providing a configue file(`default.ini`). +You can change the parameters for the MM/GB(PB)SA calculations by providing a config file (`default.ini`). ``` ; parameters for simulation [simulation] @@ -185,29 +185,30 @@ exdi = 80.0 >Perform a PBSA/GBSA calculation of a complex from a MD trajectory. Note: you need to prepare a gromacs `index.ndx` file which contains two groups named `RECEPTOR` and `LIGAND`. ```` -unigbsa-traj -h -usage: unigbsa-traj [-h] -i INP -p TOP -ndx NDX [-m {gb,pb,pb+gb,gb+pb}] [-t TRAJ] [-indi INDI] [-dec] [-D] +$ unigbsa-traj -h +usage: unigbsa-traj [-h] -i INP -p TOP -ndx NDX [-m MODE [MODE ...]] [-f MMPBSAFILE] [-t TRAJ] [-nt THREADS] [-D] [-v] -Free energy calcaulated by PBSA method. +Free energy calcaulation by MM/GB(PB)SA method. optional arguments: - -h, --help show this help message and exit - -i INP A pdb file or a tpr file for the trajectory. - -p TOP Gromacs topol file for the system. - -ndx NDX Gromacs index file, must contain recepror and ligand group. - -m {gb,pb,pb+gb,gb+pb} - Method to calculate: gb, pb, pb+gb. default:gb - -t TRAJ A trajectory file contains many structure frames. File format: xtc, pdb, gro... - -indi INDI External dielectric constant. detault: 1.0 - -dec Decompose the energy. default:false - -D DEBUG model, keep all the files. + -h, --help show this help message and exit + -i INP A pdb file or a tpr file for the trajectory. + -p TOP Gromacs topol file for the system. + -ndx NDX Gromacs index file, must contain receptor and ligand group. + -m MODE [MODE ...] MM/GB(PB)SA mode + -f MMPBSAFILE Input MM/GB(PB)SA file + -t TRAJ A trajectory file containing many structure frames. File format: xtc, pdb, gro... + -nt THREADS Set number of threads to run this program. + -D DEBUG model, keep all the files. + -v, --version show program's version number and exit + ```` ### unigbsa-buildtop >Topology preparation for a protein receptor and ligand(s) using gromacs. ```Bash -unigbsa-buildtop -h -usage: unigbsa-buildtop [-h] [-p PROTEIN] [-l LIGAND] [-pf PROTFORCE] [-lf {gaff,gaff2}] [-o OUTDIR] [-c] [-verbose] +$ unigbsa-buildtop -h +usage: unigbsa-buildtop [-h] [-p PROTEIN] [-l LIGAND] [-pf PROTFORCE] [-lf {gaff,gaff2}] [-o OUTDIR] [-c] [-nt THREADS] [-verbose] [-v] Build topology file for input file. @@ -216,16 +217,18 @@ optional arguments: -p PROTEIN Protein file or directory to build topology. -l LIGAND Ligand file or directory to build topology. -pf PROTFORCE Protein forcefield. - -lf {gaff,gaff2} Ligand forcefiled: gaff or gaff2. - -o OUTDIR A output directory. + -lf {gaff,gaff2} Ligand forcefield: gaff or gaff2. + -o OUTDIR The output directory. -c Combine the protein and ligand topology. Suppport for one protein and more ligands. default:True + -nt THREADS Number of threads to run this simulation. -verbose Keep the directory or not. + -v, --version show program's version number and exit ``` ### unigbsa-buildsys >Build a simulation box for a protein-ligand complex. ```bash -unigbsa-buildsys -h -usage: unigbsa-buildsys [-h] -p PROTEIN [-l LIGAND] [-pf PROTFORCE] [-lf {gaff,gaff2}] [-bt BOXTYPE] [-box BOX BOX BOX] [-d D] [-conc CONC] [-o OUTDIR] +$ unigbsa-buildsys -h +usage: unigbsa-buildsys [-h] -p PROTEIN [-l LIGAND] [-pf PROTFORCE] [-lf {gaff,gaff2}] [-bt BOXTYPE] [-box BOX BOX BOX] [-d D] [-conc CONC] [-o OUTDIR] [-nt THREADS] [-v] Build MD simulation for input file. @@ -234,19 +237,22 @@ optional arguments: -p PROTEIN Protein file for the simulation. -l LIGAND Ligand file or directory for the simulation. -pf PROTFORCE Protein forcefield. - -lf {gaff,gaff2} Ligand forcefiled: gaff or gaff2. + -lf {gaff,gaff2} Ligand forcefield: gaff or gaff2. -bt BOXTYPE Simulation box type, default: triclinic -box BOX BOX BOX Simulation box size. -d D Distance between the solute and the box. -conc CONC Specify salt concentration (mol/liter). default=0.15 - -o OUTDIR A output directory. + -o OUTDIR The output directory. + -nt THREADS Number of threads to run this simulation. + -v, --version show program's version number and exit ``` ### unigbsa-md >Run a MD simulation of a protein-ligand complex. ```Bash -unigbsa-md -h -usage: unigbsa-md [-h] -p PROTEIN [-l LIGAND] [-pf PROTFORCE] [-lf {gaff,gaff2}] [-bt BOXTYPE] [-box BOX BOX BOX] [-d D] [-conc CONC] [-o OUTDIR] [-nstep NSTEP] [-nframe NFRAME] [-verbose] +$ unigbsa-md -h +usage: unigbsa-md [-h] -p PROTEIN [-l LIGAND] [-pf PROTFORCE] [-lf {gaff,gaff2}] [-bt BOXTYPE] [-box BOX BOX BOX] [-d D] [-conc CONC] [-o OUTDIR] [-nsteps NSTEP] [-nframe NFRAME] + [-nt THREADS] [-verbose] [-v] Run MD simulation for input file. @@ -255,34 +261,36 @@ optional arguments: -p PROTEIN Protein file for the simulation. -l LIGAND Ligand file or directory for the simulation. -pf PROTFORCE Protein forcefield. - -lf {gaff,gaff2} Ligand forcefiled: gaff or gaff2. + -lf {gaff,gaff2} Ligand forcefield: gaff or gaff2. -bt BOXTYPE Simulation box type, default: triclinic -box BOX BOX BOX Simulation box size. -d D Distance between the solute and the box. -conc CONC Specify salt concentration (mol/liter). default=0.15 - -o OUTDIR A output directory. - -nstep NSTEP Simulation steps. default:2500 - -nframe NFRAME Number of frame to save for the xtc file. default:100 + -o OUTDIR The output directory. + -nsteps NSTEP Simulation steps. default:2500 + -nframe NFRAME Number of frames to save for the xtc file. default:100 + -nt THREADS Number of threads to run this simulation. -verbose Keep all the files in the simulation. + -v, --version show program's version number and exit ``` ### unigbsa-pbc >Process PBC condition for a MD trajectory. ```Bash -unigbsa-pbc -h -usage: unigbsa-pbc [-h] -s TPR -f XTC [-o OUT] [-n NDX] +$ unigbsa-pbc -h +usage: unigbsa-pbc [-h] -s TPR -f XTC [-o OUT] [-n NDX] [-v] -Auto process PBC for gromacs MD trajector. +Auto process PBC for gromacs MD trajectory. optional arguments: - -h, --help show this help message and exit - -s TPR TPR file generated from gromacs or coordinate file. - -f XTC Trajector file to process PBC. - -o OUT Result file after processed PBC. - -n NDX Index file contains the center and output group. + -h, --help show this help message and exit + -s TPR TPR file generated from gromacs or coordinate file. + -f XTC Trajectory file to process PBC. + -o OUT Results file after processed PBC. + -n NDX Index file contains the center and output group. + -v, --version show program's version number and exit ``` - ### More Examples * Perform a MM/GB(PB)SA calculation on a ligand file with a protein receptor with ``unigbsa-pipeline`` @@ -305,7 +313,7 @@ unigbsa-buildtop -p example/2fvy/protein.pdb -pf amber99sb -l example/2fvy/BGC.m * Run a MD simulation with ``unigbsa-md`` -* Process the PBC condition of a MD trjectorywith ``unigbsa-pbc`` +* Process the PBC condition of a MD trajectory with ``unigbsa-pbc`` ## Citation diff --git a/containers/Dockerfile b/containers/Dockerfile index 36e592e..1c674c3 100644 --- a/containers/Dockerfile +++ b/containers/Dockerfile @@ -1,15 +1,13 @@ FROM continuumio/miniconda3 -# 1. create a enverioment +# 1. create an environment SHELL ["/bin/bash", "-c"] -RUN conda create -n gbsa -c conda-forge acpype gromacs openmpi mpi4py \ -&& echo -e 'conda activate gbsa' >> ~/.bashrc \ -&& echo -e 'alias ls="ls --color" \n' >> ~/.bashrc \ +RUN conda create -n gbsa -c conda-forge acpype openmpi mpi4py gromacs "gmx_MMPBSA>=1.5.6" \ +&& echo 'conda activate gbsa' >> ~/.bashrc \ && rm -rf /opt/conda/pkgs/* - -# 2. install Uni-GBSA +# 2. install unigbsa RUN source ~/.bashrc \ -&& pip install unigbsa gmx_MMPBSA>=1.5.6 lickit \ +&& pip install unigbsa lickit \ && rm -rf ~/.cache/* diff --git a/example/2fvy/BGC.mol2 b/example/2fvy/BGC.mol2 index b0a21a1..877b24b 100644 --- a/example/2fvy/BGC.mol2 +++ b/example/2fvy/BGC.mol2 @@ -1,46 +1,56 @@ @MOLECULE -BGC.pdb - 19 19 0 0 0 +***** + 24 24 0 0 0 SMALL GASTEIGER @ATOM - 1 C2 5.7270 -0.3600 18.6130 C.3 310 BGC310 0.1785 - 2 C3 5.9140 -0.0610 20.0890 C.3 310 BGC310 0.1591 - 3 C4 7.4720 -0.0340 20.4130 C.3 310 BGC310 0.1537 - 4 C5 8.1890 0.9590 19.4030 C.3 310 BGC310 0.1198 - 5 C6 9.6750 0.9410 19.5730 C.3 310 BGC310 0.1117 - 6 C1 6.4990 0.6150 17.7400 C.3 310 BGC310 0.2249 - 7 O1 6.3840 0.3520 16.3470 O.3 310 BGC310 -0.1973 - 8 O2 4.3570 -0.3230 18.2440 O.3 310 BGC310 -0.2229 - 9 O3 5.3190 -1.0720 20.9170 O.3 310 BGC310 -0.2253 - 10 O4 7.5320 0.4810 21.7220 O.3 310 BGC310 -0.2255 - 11 O5 7.9390 0.5700 18.0530 O.3 310 BGC310 -0.3380 - 12 O6 10.3750 1.7990 18.5980 O.3 310 BGC310 -0.2320 - 13 H2 6.0670 -1.2620 18.4390 H 310 BGC310 0.0709 - 14 H3 5.5190 0.8110 20.3010 H 310 BGC310 0.0685 - 15 H4 7.8610 -0.9320 20.3650 H 310 BGC310 0.0683 - 16 H5 7.8550 1.8680 19.5480 H 310 BGC310 0.0649 - 17 H61 9.8940 1.2390 20.4690 H 310 BGC310 0.0618 - 18 H62 9.9930 0.0300 19.4770 H 310 BGC310 0.0618 - 19 H1 6.1690 1.5210 17.9150 H 310 BGC310 0.0969 + 1 C 5.7270 -0.3600 18.6130 C.3 1 UNL1 0.1339 + 2 C 5.9140 -0.0610 20.0890 C.3 1 UNL1 0.1141 + 3 C 7.4720 -0.0340 20.4130 C.3 1 UNL1 0.1119 + 4 C 8.1890 0.9590 19.4030 C.3 1 UNL1 0.1130 + 5 C 9.6750 0.9410 19.5730 C.3 1 UNL1 0.0730 + 6 C 6.4990 0.6150 17.7400 C.3 1 UNL1 0.1854 + 7 O 6.3840 0.3520 16.3470 O.3 1 UNL1 -0.3649 + 8 O 4.3570 -0.3230 18.2440 O.3 1 UNL1 -0.3841 + 9 O 5.3190 -1.0720 20.9170 O.3 1 UNL1 -0.3864 + 10 O 7.5320 0.4810 21.7220 O.3 1 UNL1 -0.3865 + 11 O 7.9390 0.5700 18.0530 O.3 1 UNL1 -0.3407 + 12 O 10.3750 1.7990 18.5980 O.3 1 UNL1 -0.3924 + 13 H 6.1189 -1.3749 18.4509 H 1 UNL1 0.0671 + 14 H 5.4318 0.9051 20.2992 H 1 UNL1 0.0648 + 15 H 7.9602 -1.0155 20.3224 H 1 UNL1 0.0647 + 16 H 7.7860 1.9595 19.6187 H 1 UNL1 0.0647 + 17 H 9.9165 1.2926 20.5869 H 1 UNL1 0.0584 + 18 H 10.0138 -0.0922 19.4064 H 1 UNL1 0.0584 + 19 H 6.0548 1.5968 17.9606 H 1 UNL1 0.0935 + 20 H 5.9911 -0.5466 16.2122 H 1 UNL1 0.2126 + 21 H 3.7959 -0.3078 19.0595 H 1 UNL1 0.2101 + 22 H 5.4553 -0.8405 21.8699 H 1 UNL1 0.2100 + 23 H 7.4456 -0.2603 22.3725 H 1 UNL1 0.2100 + 24 H 10.9215 2.4688 19.0805 H 1 UNL1 0.2095 @BOND - 1 7 6 1 - 2 6 19 1 - 3 6 11 1 - 4 6 1 1 - 5 11 4 1 - 6 8 1 1 - 7 13 1 1 - 8 12 5 1 - 9 1 2 1 - 10 4 16 1 - 11 4 5 1 - 12 4 3 1 - 13 18 5 1 - 14 5 17 1 - 15 2 14 1 - 16 2 3 1 - 17 2 9 1 - 18 15 3 1 - 19 3 10 1 + 1 2 1 1 + 2 3 2 1 + 3 4 3 1 + 4 5 4 1 + 5 6 1 1 + 6 7 6 1 + 7 8 1 1 + 8 9 2 1 + 9 10 3 1 + 10 11 6 1 + 11 11 4 1 + 12 12 5 1 + 13 1 13 1 + 14 2 14 1 + 15 3 15 1 + 16 4 16 1 + 17 5 17 1 + 18 5 18 1 + 19 6 19 1 + 20 7 20 1 + 21 8 21 1 + 22 9 22 1 + 23 10 23 1 + 24 12 24 1 diff --git a/unigbsa/CLI.py b/unigbsa/CLI.py index c83eb08..29f886a 100644 --- a/unigbsa/CLI.py +++ b/unigbsa/CLI.py @@ -14,10 +14,10 @@ def PBC_main(): - parser = argparse.ArgumentParser(description='Auto process PBC for gromacs MD trajector.') + parser = argparse.ArgumentParser(description='Auto process PBC for gromacs MD trajectory.') parser.add_argument('-s', dest='tpr', help='TPR file generated from gromacs or coordinate file.', required=True) - parser.add_argument('-f', dest='xtc', help='Trajector file to process PBC.', required=True) - parser.add_argument('-o', dest='out', help='Result file after processed PBC.', default=None) + parser.add_argument('-f', dest='xtc', help='Trajectory file to process PBC.', required=True) + parser.add_argument('-o', dest='out', help='Results file after processed PBC.', default=None) parser.add_argument('-n', dest='ndx', help='Index file contains the center and output group.', default=None) parser.add_argument('-v', '--version', action='version', version="{prog}s ({version})".format(prog="%(prog)", version=__version__)) @@ -35,10 +35,10 @@ def topol_builder(): parser.add_argument('-p', dest='protein', help='Protein file or directory to build topology.', default="") parser.add_argument('-l', dest='ligand', help='Ligand file or directory to build topology.', default="") parser.add_argument('-pf', dest='protforce', help='Protein forcefield.', default='amber03') - parser.add_argument('-lf', dest='ligforce', help='Ligand forcefiled: gaff or gaff2.', default='gaff', choices=['gaff','gaff2']) - parser.add_argument('-o', dest='outdir', help='A output directory.', default='GMXtop') + parser.add_argument('-lf', dest='ligforce', help='Ligand forcefield: gaff or gaff2.', default='gaff', choices=['gaff','gaff2']) + parser.add_argument('-o', dest='outdir', help='The output directory.', default='GMXtop') parser.add_argument('-c', help='Combine the protein and ligand topology. Suppport for one protein and more ligands. default:True', action='store_true', default=True) - parser.add_argument('-nt', dest='thread', help='Number of thread to run this simulation.', default=4) + parser.add_argument('-nt', dest='threads', help='Number of threads to run this simulation.', default=4) parser.add_argument('-verbose', help='Keep the directory or not.', default=False, action='store_true') parser.add_argument('-v', '--version', action='version', version="{prog}s ({version})".format(prog="%(prog)", version=__version__)) @@ -47,7 +47,7 @@ def topol_builder(): proteinForcefield, ligandForcefield = args.protforce, args.ligforce verbose = args.verbose if not protein and not ligand: - print('Not found input file!') + print('Could not find the input file!') proteinfiles, ligandfiles = [], [] if os.path.isdir(protein): @@ -75,23 +75,23 @@ def topol_builder(): ligandName = os.path.split(ligandfile)[-1][:-4] outtop, outcoord, outitp = os.path.join(outdir, ligandName+'.top'), os.path.join(outdir, ligandName+'.pdb'), os.path.join(outdir, ligandName+'.itp') # outcoord parameter is useless - ligtop, liggro = topology.build_lignad(ligandfile, forcefield=ligandForcefield, charge_method='bcc', outtop=outtop, outcoord=outcoord, itpfile=outitp, nt=args.thread) + ligtop, liggro = topology.build_lignad(ligandfile, forcefield=ligandForcefield, charge_method='bcc', outtop=outtop, outcoord=outcoord, itpfile=outitp, nt=args.threads) if cF: comxtop, comxcoord = os.path.join(outdir, "%s_%s.top"%(proteinName, ligandName)), os.path.join(outdir, "%s_%s.pdb"%(proteinName, ligandName)) - topology.build_topol((prottop, protgro), (ligtop, liggro), outtop=comxtop, outpdb=comxcoord, verbose=verbose, nt=args.thread) + topology.build_topol((prottop, protgro), (ligtop, liggro), outtop=comxtop, outpdb=comxcoord, verbose=verbose, nt=args.threads) def simulation_builder(): parser = argparse.ArgumentParser(description='Build MD simulation for input file.') parser.add_argument('-p', dest='protein', help='Protein file for the simulation.', required=True) parser.add_argument('-l', dest='ligand', help='Ligand file or directory for the simulation.', default="") parser.add_argument('-pf', dest='protforce', help='Protein forcefield.', default='amber03') - parser.add_argument('-lf', dest='ligforce', help='Ligand forcefiled: gaff or gaff2.', default='gaff', choices=['gaff','gaff2']) + parser.add_argument('-lf', dest='ligforce', help='Ligand forcefield: gaff or gaff2.', default='gaff', choices=['gaff','gaff2']) parser.add_argument('-bt', dest='boxtype', help='Simulation box type, default: triclinic', default='triclinic') parser.add_argument('-box', help='Simulation box size.', nargs=3, type=float, default=None) parser.add_argument('-d', help='Distance between the solute and the box.', default=0.9, type=float) parser.add_argument('-conc', help='Specify salt concentration (mol/liter). default=0.15', default=0.15, type=float) - parser.add_argument('-o', dest='outdir', help='A output directory.', default=None) - parser.add_argument('-nt', dest='thread', help='Number of thread to run this simulation.', default=4) + parser.add_argument('-o', dest='outdir', help='The output directory.', default=None) + parser.add_argument('-nt', dest='threads', help='Number of threads to run this simulation.', default=4) parser.add_argument('-v', '--version', action='version', version="{prog}s ({version})".format(prog="%(prog)", version=__version__)) args = parser.parse_args() @@ -123,7 +123,7 @@ def simulation_builder(): if len(ligandfiles) == 0: logging.info('No ligand found, build protein only.') - topology.build_topol(receptor, None, outpdb=grofile, outtop=topfile, nt=args.thread) + topology.build_topol(receptor, None, outpdb=grofile, outtop=topfile, nt=args.threads) logging.info('Build simulation for %s'%proteinName) engine = mdrun.GMXEngine() @@ -142,7 +142,7 @@ def simulation_builder(): os.chdir(ligandName) logging.info('Build ligand topology: %s'%ligandName) - topology.build_topol(receptor, ligandfile, outpdb=grofile, outtop=topfile, ligandforce=ligandForcefield, nt=args.thread) + topology.build_topol(receptor, ligandfile, outpdb=grofile, outtop=topfile, ligandforce=ligandForcefield, nt=args.threads) logging.info('Building simulation for: %s'%ligandName) engine = mdrun.GMXEngine() @@ -160,22 +160,22 @@ def simulation_run(): parser.add_argument('-p', dest='protein', help='Protein file for the simulation.', required=True) parser.add_argument('-l', dest='ligand', help='Ligand file or directory for the simulation.', default="") parser.add_argument('-pf', dest='protforce', help='Protein forcefield.', default='amber03') - parser.add_argument('-lf', dest='ligforce', help='Ligand forcefiled: gaff or gaff2.', default='gaff', choices=['gaff','gaff2']) + parser.add_argument('-lf', dest='ligforce', help='Ligand forcefield: gaff or gaff2.', default='gaff', choices=['gaff','gaff2']) parser.add_argument('-bt', dest='boxtype', help='Simulation box type, default: triclinic', default='triclinic') parser.add_argument('-box', help='Simulation box size.', nargs=3, type=float, default=None) parser.add_argument('-d', help='Distance between the solute and the box.', default=0.9, type=float) parser.add_argument('-conc', help='Specify salt concentration (mol/liter). default=0.15', default=0.15, type=float) - parser.add_argument('-o', dest='outdir', help='A output directory.', default=None) + parser.add_argument('-o', dest='outdir', help='The output directory.', default=None) parser.add_argument('-nsteps', dest='nstep', help='Simulation steps. default:2500', default=2500, type=int) - parser.add_argument('-nframe', dest='nframe', help='Number of frame to save for the xtc file. default:100', default=100, type=int) - parser.add_argument('-nt', dest='thread', help='Number of thread to run this simulation.', default=4) + parser.add_argument('-nframe', dest='nframe', help='Number of frames to save for the xtc file. default:100', default=100, type=int) + parser.add_argument('-nt', dest='threads', help='Number of threads to run this simulation.', default=4) parser.add_argument('-verbose', help='Keep all the files in the simulation.', action='store_true', default=False) parser.add_argument('-v', '--version', action='version', version="{prog}s ({version})".format(prog="%(prog)", version=__version__)) args = parser.parse_args() proteinfile, ligand, outdir = args.protein, args.ligand, args.outdir proteinForcefield, ligandForcefield = args.protforce, args.ligforce - boxtype, box, conc, boxsize, nsteps, nframe, nt = args.boxtype, args.box, args.conc, args.d, args.nstep, args.nframe, args.thread + boxtype, box, conc, boxsize, nsteps, nframe, nt = args.boxtype, args.box, args.conc, args.d, args.nstep, args.nframe, args.threads verbose = args.verbose if box: boxsize = box @@ -239,14 +239,14 @@ def simulation_run(): def traj_pipeline(args=None): from unigbsa.gbsa.gbsarun import GBSA - parser = argparse.ArgumentParser(description='Free energy calcaulated by PBSA method.') + parser = argparse.ArgumentParser(description='Free energy calcaulation by MM/GB(PB)SA method.') parser.add_argument('-i', dest='INP', help='A pdb file or a tpr file for the trajectory.', required=True) parser.add_argument('-p', dest='TOP', help='Gromacs topol file for the system.', required=True) - parser.add_argument('-ndx', dest='ndx', help='Gromacs index file, must contain recepror and ligand group.', required=True) - parser.add_argument('-m', dest='mode', help='MMPBSA mode', nargs='+', default=['GB']) - parser.add_argument('-f', dest='mmpbsafile', help='Input mmpbsa file', default=None) - parser.add_argument('-t', dest='TRAJ', help='A trajectory file contains many structure frames. File format: xtc, pdb, gro...', default=None) - parser.add_argument('-nt', dest='thread', help='Set number of thread to run this program.', type=int, default=1) + parser.add_argument('-ndx', dest='ndx', help='Gromacs index file, must contain receptor and ligand group.', required=True) + parser.add_argument('-m', dest='mode', help='MM/GB(PB)SA mode', nargs='+', default=['GB']) + parser.add_argument('-f', dest='mmpbsafile', help='Input MM/GB(PB)SA file', default=None) + parser.add_argument('-t', dest='TRAJ', help='A trajectory file containing many structure frames. File format: xtc, pdb, gro...', default=None) + parser.add_argument('-nt', dest='threads', help='Set number of threads to run this program.', type=int, default=1) parser.add_argument('-D', dest='DEBUG', help='DEBUG model, keep all the files.', default=False, action='store_true') parser.add_argument('-v', '--version', action='version', version="{prog}s ({version})".format(prog="%(prog)", version=__version__)) @@ -255,7 +255,7 @@ def traj_pipeline(args=None): else: args = parser.parse_args(args) #exit(0) - complexFile, topolFile, indexFile, trajFile, debug, mmpbsafile, nt = args.INP, args.TOP, args.ndx, args.TRAJ, args.DEBUG, args.mmpbsafile, args.thread + complexFile, topolFile, indexFile, trajFile, debug, mmpbsafile, nt = args.INP, args.TOP, args.ndx, args.TRAJ, args.DEBUG, args.mmpbsafile, args.threads if trajFile is None: trajFile = complexFile if mmpbsafile: @@ -272,9 +272,9 @@ def traj_pipeline(args=None): def mmpbsa_plot(): from unigbsa.gbsa import plots - parser = argparse.ArgumentParser(description='Analysis and plot results for MMPBSA.') - parser.add_argument('-i', help='MMPBSA result directory. Which contains FINAL_RESULTS_MMPBSA.dat, FINAL_DECOMP_MMPBSA.dat, EO.csv or DEO.csv file.', required=True) - parser.add_argument('-o', help='Figure output directory. default: analysis', default='analysis') + parser = argparse.ArgumentParser(description='Analyze and plot results for MM/GB(PB)SA.') + parser.add_argument('-i', help='MM/GB(PB)SA results directory. Should contain FINAL_RESULTS_MMPBSA.dat, FINAL_DECOMP_MMPBSA.dat, EO.csv or DEO.csv file.', required=True) + parser.add_argument('-o', help='Output directory for the Figures. default: analysis', default='analysis') parser.add_argument('-v', '--version', action='version', version="{prog}s ({version})".format(prog="%(prog)", version=__version__)) @@ -296,7 +296,7 @@ def mmpbsa_plot(): def ligand_check(): - parser = argparse.ArgumentParser(description='Analysis and plot results for MMPBSA.') + parser = argparse.ArgumentParser(description='Validate and check an input ligand') parser.add_argument('-i', help='Ligand file to validate.', required=True) parser.add_argument('-o', help='Ligand file after validate. default: None', default=None) parser.add_argument('-v', '--version', action='version', version="{prog}s ({version})".format(prog="%(prog)", version=__version__)) diff --git a/unigbsa/pipeline.py b/unigbsa/pipeline.py index 12dd60f..429ce08 100644 --- a/unigbsa/pipeline.py +++ b/unigbsa/pipeline.py @@ -32,7 +32,7 @@ def traj_pipeline(complexfile, trajfile, topolfile, indexfile, pbsaParas=None, m debug: if True, will print out all the debug messages. Defaults to False Returns: - detal_G is a dictionary, the key is the mode, the value is a list, the first element is the + delta_G is a dictionary, the key is the mode, the value is a list, the first element is the average value, the second element is the standard deviation. """ @@ -47,11 +47,11 @@ def traj_pipeline(complexfile, trajfile, topolfile, indexfile, pbsaParas=None, m pbsa.input_pdb = os.path.abspath(input_pdb) mmpbsafile = pbsa.set_paras(complexfile=reresfile, trajectoryfile=trajfile, topolfile=topolfile, indexfile=indexfile, pbsaParas=pbsaParas, mmpbsafile=mmpbsafile, nt=nt) pbsa.run(verbose=verbose) - detal_G = pbsa.extract_result() - print("Frames mode detal_G(kcal/mole)") - for i, irow in detal_G.iterrows(): + delta_G = pbsa.extract_result() + print("Frames mode delta_G(kcal/mole)") + for i, irow in delta_G.iterrows(): print('%6d %4s %18.4f '%(irow['Frames'], irow['mode'], irow['TOTAL'])) - return detal_G + return delta_G def base_pipeline(receptorfile, ligandfiles, paras, nt=1, mmpbsafile=None, outfile='BindingEnergy.csv', validate=False, verbose=False): """ @@ -282,21 +282,21 @@ def md_pipeline(receptorfile, ligandfiles, paras, mmpbsafile=None, nt=1, outfile def main(args=None): - parser = argparse.ArgumentParser(description='GBSA Calculation. Version: %s'%__version__) - parser.add_argument('-i', dest='receptor', help='Input protein file with pdb format.', required=True) - parser.add_argument('-l', dest='ligand', help='Ligand files to calculate binding energy.', nargs='+', default=None) - parser.add_argument('-c', dest='config', help='Configue file, default: %s'%DEFAULT_CONFIGURE_FILE, default=DEFAULT_CONFIGURE_FILE) - parser.add_argument('-d', dest='ligdir', help='Floder contains many ligand files. file format: .mol or .sdf', default=None) + parser = argparse.ArgumentParser(description='MM/GB(PB)SA Calculation. Version: %s'%__version__) + parser.add_argument('-i', dest='receptor', help='Input protein file in pdb format.', required=True) + parser.add_argument('-l', dest='ligand', help='Ligand files to calculate binding energy for.', nargs='+', default=None) + parser.add_argument('-c', dest='config', help='Config file, default: %s'%DEFAULT_CONFIGURE_FILE, default=DEFAULT_CONFIGURE_FILE) + parser.add_argument('-d', dest='ligdir', help='Directory containing many ligand files. file format: .mol or .sdf', default=None) parser.add_argument('-f', dest='pbsafile', help='gmx_MMPBSA input file. default=None', default=None) parser.add_argument('-o', dest='outfile', help='Output file.', default='BindingEnergy.csv') parser.add_argument('-validate', help='Validate the ligand file. default: False', action='store_true', default=False) - parser.add_argument('-nt', dest='thread', help='Set number of thread to run this program.', type=int, default=multiprocessing.cpu_count()) + parser.add_argument('-nt', dest='threads', help='Set number of threads to run this program.', type=int, default=multiprocessing.cpu_count()) parser.add_argument('--decomp', help='Decompose the free energy. default:False', action='store_true', default=False) parser.add_argument('--verbose', help='Keep all the files.', action='store_true', default=False) parser.add_argument('-v', '--version', action='version', version="{prog}s ({version})".format(prog="%(prog)", version=__version__)) args = parser.parse_args(args) - receptor, ligands, conf, ligdir, outfile, decomposition, nt, verbose = args.receptor, args.ligand, args.config, args.ligdir, args.outfile, args.decomp, args.thread, args.verbose + receptor, ligands, conf, ligdir, outfile, decomposition, nt, verbose = args.receptor, args.ligand, args.config, args.ligdir, args.outfile, args.decomp, args.threads, args.verbose if ligands is None: ligands = [] @@ -305,10 +305,10 @@ def main(args=None): if fileName.endswith(('mol','sdf')): ligands.append(os.path.join(ligdir, fileName)) if len(ligands)==0: - raise Exception('No ligands file found.') + raise Exception('No ligand files found.') if not os.path.exists(conf): - raise Exception("Not found the configure file! %s"%conf) + raise Exception("Could not find the config file! %s"%conf) mmpbsafile = os.path.abspath(args.pbsafile) if args.pbsafile else args.pbsafile paras = load_configue_file(conf) diff --git a/unigbsa/scanparas/scan.py b/unigbsa/scanparas/scan.py index 1c02ffe..1e842b9 100644 --- a/unigbsa/scanparas/scan.py +++ b/unigbsa/scanparas/scan.py @@ -28,10 +28,10 @@ def reres_gro(infile, outfile): raise Exception('Error convert %s to %s'%(infile, outfile)) return outfile -def thread_split(njob, nt): - thread = max([round(nt/njob), 1]) +def threads_split(njob, nt): + threads = max([round(nt/njob), 1]) nt = njob if njob < nt else nt - return thread, nt + return threads, nt def load_scan_paras(jsonfile: str, scantype='fixed') -> dict: parasdict = {} @@ -190,7 +190,7 @@ def build_topology_walker(arg): return ligandName, outfiles def build_topology_MPI(receptorfiles, ligandfiles, paras, outdir, nt=4): - thread, nworker = thread_split(len(ligandfiles), nt) + threads, nworker = threads_split(len(ligandfiles), nt) with PathManager(outdir) as pm: if isinstance(receptorfiles, str): receptor = build_protein(pm.abspath(receptorfiles, parent=True), forcefield=paras['simulation']['proteinforcefield']) @@ -198,7 +198,7 @@ def build_topology_MPI(receptorfiles, ligandfiles, paras, outdir, nt=4): else: receptors = pm.abspath(receptorfiles, parent=True) ligandfiles = pm.abspath(ligandfiles, parent=True) - args = [ (receptor, ligandfile, paras, thread) for receptor, ligandfile in zip(receptors, ligandfiles) ] + args = [ (receptor, ligandfile, paras, threads) for receptor, ligandfile in zip(receptors, ligandfiles) ] with ProcessPoolExecutor(max_workers=nworker) as pool: outdict = { out[0]:out[1] for out in list(pool.map(build_topology_walker, args)) if out is not None } outparas = copy(paras) @@ -206,7 +206,7 @@ def build_topology_MPI(receptorfiles, ligandfiles, paras, outdir, nt=4): return outparas def structural_optimization_walker(arg): - paras, ligandName, outdir, thread = arg + paras, ligandName, outdir, threads = arg paras = copy(paras) files = paras['files'][ligandName] simParas = paras['simulation'] @@ -220,7 +220,7 @@ def structural_optimization_walker(arg): engine = GMXEngine() if paras['simulation']['mode'] == 'em': GBSAInputfile = 'complex_minim.pdb' - minimgro, outtop = engine.run_to_minim(complexfile, topolfile, boxtype=simParas['boxtype'], boxsize=simParas['boxsize'], conc=simParas['conc'], maxsol=simParas['maxsol'], nt=thread) + minimgro, outtop = engine.run_to_minim(complexfile, topolfile, boxtype=simParas['boxtype'], boxsize=simParas['boxsize'], conc=simParas['conc'], maxsol=simParas['maxsol'], nt=threads) GBSAInputfile = reres_gro(minimgro, 'complex_minim.pdb') files['GBSAinput'] = pm.abspath(GBSAInputfile) files['GBSAtraj'] = pm.abspath(GBSAInputfile) @@ -228,7 +228,7 @@ def structural_optimization_walker(arg): files['topolfile'] = pm.abspath('topol.top') engine.clean(pdbfile=complexfile) elif paras['simulation']['mode'] == 'md': - mdgro, mdxtc, outtop = engine.run_to_md(complexfile, topolfile, boxtype=simParas['boxtype'], boxsize=simParas['boxsize'], conc=simParas['conc'], nsteps=simParas['nsteps'], nframe=simParas['nframe'], eqsteps=simParas['eqsteps'], nt=thread) + mdgro, mdxtc, outtop = engine.run_to_md(complexfile, topolfile, boxtype=simParas['boxtype'], boxsize=simParas['boxsize'], conc=simParas['conc'], nsteps=simParas['nsteps'], nframe=simParas['nframe'], eqsteps=simParas['eqsteps'], nt=threads) GBSAInputfile = reres_gro(mdgro, 'complex_md.pdb') files['GBSAinput'] = pm.abspath(GBSAInputfile) files['GBSAtraj'] = pm.abspath('traj_comx.xtc') @@ -248,8 +248,8 @@ def structural_optimization_walker(arg): def structural_optimization_MPI(paras, outdir=None, nt=4): ligandNames = paras['files'].keys() - thread, nworker = thread_split(len(ligandNames), nt) - args = [ (paras, ligandName, outdir, thread) for ligandName in ligandNames ] + threads, nworker = threads_split(len(ligandNames), nt) + args = [ (paras, ligandName, outdir, threads) for ligandName in ligandNames ] with ProcessPoolExecutor(max_workers=nworker) as pool: outfiles = { out[0]:out[1] for out in list(pool.map(structural_optimization_walker, args)) if out is not None } outparas = copy(paras) @@ -257,7 +257,7 @@ def structural_optimization_MPI(paras, outdir=None, nt=4): return outparas def gbsa_calculation_walker(arg): - paras, ligandName, outdir, thread = arg + paras, ligandName, outdir, threads = arg files = paras['files'][ligandName] complexfile = files['complexfile'] if outdir is None: @@ -265,14 +265,14 @@ def gbsa_calculation_walker(arg): else: ligandir = os.path.join(outdir, ligandName) with PathManager(ligandir) as pm: - deltaG = traj_pipeline(files['GBSAinput'], trajfile=files['GBSAtraj'], topolfile=files['topolfile'], indexfile=files['indexfile'], pbsaParas=paras['GBSA'], mmpbsafile=None, nt=thread, verbose=False) + deltaG = traj_pipeline(files['GBSAinput'], trajfile=files['GBSAtraj'], topolfile=files['topolfile'], indexfile=files['indexfile'], pbsaParas=paras['GBSA'], mmpbsafile=None, nt=threads, verbose=False) deltaG['ligandName'] = ligandName return ligandName, deltaG def gbsa_calculation_MPI(paras, outdir, nt=4): ligandNames = paras['files'].keys() - thread, nworker = thread_split(len(ligandNames), nt) - args = [ (paras, ligandName, outdir, thread) for ligandName in ligandNames ] + threads, nworker = threads_split(len(ligandNames), nt) + args = [ (paras, ligandName, outdir, threads) for ligandName in ligandNames ] with ProcessPoolExecutor(max_workers=nworker) as pool: results = [ out for out in list(pool.map(gbsa_calculation_walker, args)) if out is not None ] df = None @@ -303,6 +303,8 @@ def scan_parameters_v2(receptors, protdir, ligands, ligdir, expdatfile, parasfil ligands = [] if receptors is None: receptors = [] + if not isinstance(receptors, list): + receptors = [receptors] if protdir: for fileName in os.listdir(protdir): if fileName.endswith('.pdb'): @@ -406,27 +408,27 @@ def scan_parameters(receptor, ligands, ligdir, expdatfile, parasfile, verbose, o print('The best para R2 is: %.4f'%R2max[1]) class ParameterScan(object): - thread = 1 + threads = 1 paras = None def __init__(self) -> None: pass def main(): - parser = argparse.ArgumentParser(description='GBSA Calculation.') - parser.add_argument('-i', dest='receptor', help='Input protein file with pdb format.', default=None) - parser.add_argument('-pd', dest='protdir', help='Floder contains many protein files. file format: .pdb', default=None) + parser = argparse.ArgumentParser(description='Perform an automatic parameter optimization prior to production MM/GB(PB)SA calculations.') + parser.add_argument('-i', dest='receptor', help='Input protein file in pdb format.', default=None) + parser.add_argument('-pd', dest='protdir', help='Directory containing many protein files. file format: .pdb', default=None) parser.add_argument('-l', dest='ligand', help='Ligand files to calculate binding energy.', nargs='+', default=None) - parser.add_argument('-ld', dest='ligdir', help='Floder contains many ligand files. file format: .mol or .sdf', default=None) + parser.add_argument('-ld', dest='ligdir', help='Directory containing many ligand files. file format: .mol or .sdf', default=None) parser.add_argument('-e', help='Experiment data file.', required=True) parser.add_argument('-c', dest='parasfile', help='Parameters to scan', required=True) parser.add_argument('-o', dest='outdir', help='Output directory.', default='pbsa.scan') - parser.add_argument('-nt', dest='thread', help='Set number of thread to run this program.', type=int, default=multiprocessing.cpu_count()) + parser.add_argument('-nt', dest='threads', help='Set number of threads to run this program.', type=int, default=multiprocessing.cpu_count()) parser.add_argument('--verbose', help='Keep all the files.', action='store_true', default=False) args = parser.parse_args() - receptor, protdir, ligands, ligdir, expdatfile, parasfile, verbose, outdir, nt = args.receptor, args.protdir, args.ligand, args.ligdir, os.path.abspath(args.e), os.path.abspath(args.parasfile), args.verbose, args.outdir, args.thread + receptor, protdir, ligands, ligdir, expdatfile, parasfile, verbose, outdir, nt = args.receptor, args.protdir, args.ligand, args.ligdir, os.path.abspath(args.e), os.path.abspath(args.parasfile), args.verbose, args.outdir, args.threads # scan_parameters(receptor, ligands, ligdir, expdatfile, parasfile, verbose, outdir, nt) - if isinstance(receptor, str): - receptor = [receptor] * len(ligands) + #if isinstance(receptor, str): + # receptor = [receptor] * len(ligands) scan_parameters_v2(receptor, protdir, ligands, ligdir, expdatfile, parasfile, outdir, nt=nt)