Valdes-Tresanco-MS / gmx_MMPBSA

gmx_MMPBSA is a new tool based on AMBER's MMPBSA.py aiming to perform end-state free energy calculations with GROMACS files.
https://valdes-tresanco-ms.github.io/gmx_MMPBSA/
GNU General Public License v3.0
226 stars 66 forks source link

[Question]: gmx_MMPBSA failed while parsing results to output files #293

Closed wangshuai-simulation closed 2 years ago

wangshuai-simulation commented 2 years ago

I got an error while running gmx_MMPBSA. The outputs are shown bellow.

[INFO   ] Starting gmx_MMPBSA v1.5.6
[INFO   ] Command-line
  mpirun -np 2 gmx_MMPBSA MPI -O -i mmpbsa.in -ct ../Traj-treat/ghb-c20-md0-1-pbcnojump-nosolv80-100ns-noCA-fit.xtc -cs ../Traj-treat/mdnoDPOSRESnosolvnoCA.tpr -cp ../../topol-for-gmxmmpbsa.top -ci index.ndx -cg 13 1 -cr md0-2nosolv-noCA-chain.pdb -eo FINAL_RESULTS_MMPBSA.csv

[INFO   ] Checking mmpbsa.in input file...
[INFO   ] Checking mmpbsa.in input file...Done.
[INFO   ] Checking external programs...
[INFO   ] cpptraj found! Using /home/tea_yiming/anaconda3/envs/gmxMMPBSA/bin/cpptraj
[INFO   ] tleap found! Using /home/tea_yiming/anaconda3/envs/gmxMMPBSA/bin/tleap
[INFO   ] parmchk2 found! Using /home/tea_yiming/anaconda3/envs/gmxMMPBSA/bin/parmchk2
[INFO   ] sander found! Using /home/tea_yiming/anaconda3/envs/gmxMMPBSA/bin/sander
[INFO   ] Using GROMACS version > 5.x.x!
[INFO   ] gmx found! Using /home/tea_yiming/wangshuai/gromacs-2018.3/2018.3-cuda-node/bin/gmx
[INFO   ] Checking external programs...Done.
[INFO   ] Building AMBER topologies from GROMACS files...
[INFO   ] Get PDB files from GROMACS structures files...
[INFO   ] Making gmx_MMPBSA index for complex...
[INFO   ] Normal Complex: Saving group 13_1 in _GMXMMPBSA_COM_index.ndx file as _GMXMMPBSA_COM.pdb
[INFO   ] No receptor structure file was defined. Using ST approach...
[INFO   ] Using receptor structure from complex to generate AMBER topology
[INFO   ] Normal Receptor: Saving group 13 in _GMXMMPBSA_COM_index.ndx file as _GMXMMPBSA_REC.pdb
[INFO   ] No ligand structure file was defined. Using ST approach...
[INFO   ] Using ligand structure from complex to generate AMBER topology
[INFO   ] Normal Ligand: Saving group 1 in _GMXMMPBSA_COM_index.ndx file as _GMXMMPBSA_LIG.pdb
[INFO   ] Checking the structures consistency...
[INFO   ] Assigning chain ID to structures files according to the reference structure...
[INFO   ]
[INFO   ] Using topology conversion. Setting radiopt = 0...
[INFO   ] Building Normal Complex Amber topology...
/home/tea_yiming/.local/lib/python3.9/site-packages/ParmEd-3.4.3-py3.9-linux-x86_64.egg/parmed/gromacs/gromacstop.py:1022: GromacsWarning: 10786 1-4 pairs were missing from the [ pairs ] section and were set to zero; make sure you know what you're doing!
  warnings.warn('%i 1-4 pairs were missing from the [ pairs ] '
[INFO   ] Detected Amber/OPLS force field topology format...
[WARNING] 23720 invalid DIHEDRAL_PERIODICITY = 0 found in Complex topology... Setting DIHEDRAL_PERIODICITY = 1
[INFO   ] Assigning PBRadii mbondi2 to Complex...
[INFO   ] Writing Normal Complex AMBER topology...
[INFO   ] No Receptor topology file was defined. Using ST approach...
[INFO   ] Building AMBER Receptor topology from Complex...
[INFO   ] Assigning PBRadii mbondi2 to Receptor...
[INFO   ] Writing Normal Receptor AMBER topology...
[INFO   ] No Ligand topology file was defined. Using ST approach...
[INFO   ] Building AMBER Ligand topology from Complex...
[INFO   ] Assigning PBRadii mbondi2 to Ligand...
[INFO   ] Writing Normal Ligand AMBER topology...
[INFO   ] User-selected residues for decomposition analysis...
[INFO   ] Selected 132 residues:
L::THR:92   L::GLN:93   L::LYS:94   L::ILE:95   L::ALA:96   L::PHE:97   L::SER:98   L::ALA:99   L::THR:100  L::ARG:101
...
[INFO   ] Cleaning normal complex trajectories...
[INFO   ] Building AMBER topologies from GROMACS files... Done.
[INFO   ] Loading and checking parameter files for compatibility...
[INFO   ] Preparing trajectories for simulation...
[INFO   ] 10 frames were processed by cpptraj for use in calculation.
[INFO   ] Running calculations on normal system...
[INFO   ] Beginning PB calculations with /home/tea_yiming/anaconda3/envs/gmxMMPBSA/bin/sander
[INFO   ]   calculating complex contribution...
[INFO   ]   calculating receptor contribution...
[INFO   ]   calculating ligand contribution...
[INFO   ] Parsing results to output files...
 File "/home/tea_yiming/anaconda3/envs/gmxMMPBSA/bin/gmx_MMPBSA", line 8, in <module>
    sys.exit(gmxmmpbsa())
  File "/home/tea_yiming/anaconda3/envs/gmxMMPBSA/lib/python3.9/site-packages/GMXMMPBSA/app.py", line 112, in gmxmmpbsa
    app.parse_output_files()
  File "/home/tea_yiming/anaconda3/envs/gmxMMPBSA/lib/python3.9/site-packages/GMXMMPBSA/main.py", line 1097, in parse_output_files
    self._get_decomp()
  File "/home/tea_yiming/anaconda3/envs/gmxMMPBSA/lib/python3.9/site-packages/GMXMMPBSA/main.py", line 1208, in _get_decomp
    self.calc_types.decomp_normal[key]['receptor'].parse_from_file(self.pre + basename[i] % 'receptor',
  File "/home/tea_yiming/anaconda3/envs/gmxMMPBSA/lib/python3.9/site-packages/GMXMMPBSA/amber_outputs.py", line 1214, in parse_from_file
    self._read()
  File "/home/tea_yiming/anaconda3/envs/gmxMMPBSA/lib/python3.9/site-packages/GMXMMPBSA/amber_outputs.py", line 1242, in _read
    self._get_decomp_energies(output_file)
  File "/home/tea_yiming/anaconda3/envs/gmxMMPBSA/lib/python3.9/site-packages/GMXMMPBSA/amber_outputs.py", line 1252, in _get_decomp_energies
    resnum = self.resl[int(line[4:10])].string
KeyError: 1
Error occurred on rank 0.
Exiting. All files have been retained.
application called MPI_Abort(MPI_COMM_WORLD, 1) - process 0

The command used was : mpirun -np 2 gmx_MMPBSA MPI -O -i mmpbsa.in -ct ../Traj-treat/ghb-c20-md0-1-pbcnojump-nosolv80-100ns-noCA-fit.xtc -cs ../Traj-treat/mdnoDPOSRESnosolvnoCA.tpr -cp ../../topol-for-gmxmmpbsa.top -ci index.ndx -cg 13 1 -cr md0-2nosolv-noCA-chain.pdb -eo FINAL_RESULTS_MMPBSA.csv >& gmxmmpbsa.log


Appreciate if anyone can give me some tips or help me to solve this problem !
marioernestovaldes commented 2 years ago

Could you please send us the output files to see if we can reproduce de error

wangshuai-simulation commented 2 years ago

mdout.tar.gz prmtop.tar.gz other.tar.gz Here are all my output files except the trajectory, the log file and input file are in other.tar.gz. Thanks for your help !

Valdes-Tresanco-MS commented 2 years ago

The problem is that you only defined ligand residues (protein in this case) in the print_res variable. This variable requires at least one residue of the receptor and ligand respectively. I just fixed this bug two days ago. Please define at least one residue for both receptor and ligand and do the calculation again. If you update from GitHub, this configuration should throw an error.

python -m pip install git+https://github.com/Valdes-Tresanco-MS/gmx_MMPBSA.git -U

Probably using our selection method (within 6) will give you good results. Note that selecting so many residues (132 in this case) may slow down the calculation and make further analysis more difficult. Using 6A as cutoff selects 11 residues and using 8A selects 22. In both cases the residues of the interface are covered.

Let me know if works for you Mario S.

wangshuai-simulation commented 2 years ago

Thanks. However, when i updated gmx_MMPBSA it failed with error shown bellow : (gmxMMPBSA) [tea_yiming@node03 gmx_MMPBSA]$ python -m pip install git+https://github.com/Valdes-Tresanco-MS/gmx_MMPBSA.git -U Collecting git+https://github.com/Valdes-Tresanco-MS/gmx_MMPBSA.git Cloning https://github.com/Valdes-Tresanco-MS/gmx_MMPBSA.git to /tmp/pip-req-build-pzd6u_vq Running command git clone --filter=blob:none --quiet https://github.com/Valdes-Tresanco-MS/gmx_MMPBSA.git /tmp/pip-req-build-pzd6u_vq fatal: unable to access 'https://github.com/Valdes-Tresanco-MS/gmx_MMPBSA.git/': Empty reply from server error: subprocess-exited-with-error × git clone --filter=blob:none --quiet https://github.com/Valdes-Tresanco-MS/gmx_MMPBSA.git /tmp/pip-req-build-pzd6u_vq did not run successfully. │ exit code: 128 ╰─> See above for output. note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error × git clone --filter=blob:none --quiet https://github.com/Valdes-Tresanco-MS/gmx_MMPBSA.git /tmp/pip-req-build-pzd6u_vq did not run successfully. │ exit code: 128 ╰─> See above for output. note: This error originates from a subprocess, and is likely not a problem with pip.


I don't know why i can't access 'https://github.com/Valdes-Tresanco-MS/gmx_MMPBSA.git/'.
I tried to run ' git config --global http.version HTTP/1.1' to solve the problem, but it don't work.
I can run 'python -m pip install gmx_MMPBSA -U' successfully, but all the results are 'Requirement already satisfied:'.
Please help me. 
Valdes-Tresanco-MS commented 2 years ago

Using this command line I have no problem. Maybe your Internet provider limits your access to GitHub this way. In principle your error is related to the way you defined the print_res variable, you don't necessarily have to update. We will release v1.5.7 in a few days.

wangshuai-simulation commented 2 years ago

Thanks. Here is another problem. When i run gmx_MMPBSA with mpirun, especially the core number more than 2, it produced a CalcError.

`[INFO ] Starting gmx_MMPBSA v1.5.6 [INFO ] Command-line mpirun -np 10 gmx_MMPBSA MPI -O -i mmpbsa.in -ct ../Traj-treat/ghb-c20-md0-1-pbcnojump-nosolv80-100ns-noCA-fit.xtc -cs ../Traj-treat/mdnoDPOSRESnosolvnoCA.tpr -cp ../../topol-for-gmxmmpbsa.top -ci index.ndx -cg 13 1 -cr md0-2nosolv-noCA-chain.pdb -eo FINAL_RESULTS_MMPBSA.csv

[INFO ] Checking mmpbsa.in input file... [INFO ] Checking mmpbsa.in input file...Done. [INFO ] Checking external programs... [INFO ] cpptraj found! Using /home/tea_yiming/anaconda3/envs/gmxMMPBSA/bin/cpptraj [INFO ] tleap found! Using /home/tea_yiming/anaconda3/envs/gmxMMPBSA/bin/tleap [INFO ] parmchk2 found! Using /home/tea_yiming/anaconda3/envs/gmxMMPBSA/bin/parmchk2 [INFO ] sander found! Using /home/tea_yiming/anaconda3/envs/gmxMMPBSA/bin/sander [INFO ] Using GROMACS version > 5.x.x! [INFO ] gmx found! Using /home/tea_yiming/wangshuai/gromacs-2018.3/2018.3-cuda-node/bin/gmx [INFO ] Checking external programs...Done. [INFO ] Building AMBER topologies from GROMACS files... [INFO ] Get PDB files from GROMACS structures files... [INFO ] Making gmx_MMPBSA index for complex... [INFO ] Normal Complex: Saving group 13_1 in _GMXMMPBSA_COM_index.ndx file as _GMXMMPBSA_COM.pdb [INFO ] No receptor structure file was defined. Using ST approach... [INFO ] Using receptor structure from complex to generate AMBER topology [INFO ] Normal Receptor: Saving group 13 in _GMXMMPBSA_COM_index.ndx file as _GMXMMPBSA_REC.pdb [INFO ] No ligand structure file was defined. Using ST approach... [INFO ] Using ligand structure from complex to generate AMBER topology [INFO ] Normal Ligand: Saving group 1 in _GMXMMPBSA_COM_index.ndx file as _GMXMMPBSA_LIG.pdb [INFO ] Checking the structures consistency... [INFO ] Assigning chain ID to structures files according to the reference structure... [INFO ] [INFO ] Using topology conversion. Setting radiopt = 0... [INFO ] Building Normal Complex Amber topology... /home/tea_yiming/.local/lib/python3.9/site-packages/ParmEd-3.4.3-py3.9-linux-x86_64.egg/parmed/gromacs/gromacstop.py:1022: GromacsWarning: 10786 1-4 pairs were missing from the [ pairs ] section and were set to zero; make sure you know what you're doing! warnings.warn('%i 1-4 pairs were missing from the [ pairs ] ' [INFO ] Detected Amber/OPLS force field topology format... [WARNING] 23720 invalid DIHEDRAL_PERIODICITY = 0 found in Complex topology... Setting DIHEDRAL_PERIODICITY = 1 [INFO ] Assigning PBRadii mbondi2 to Complex... [INFO ] Writing Normal Complex AMBER topology... [INFO ] No Receptor topology file was defined. Using ST approach... [INFO ] Building AMBER Receptor topology from Complex... [INFO ] Assigning PBRadii mbondi2 to Receptor... [INFO ] Writing Normal Receptor AMBER topology... [INFO ] No Ligand topology file was defined. Using ST approach... [INFO ] Building AMBER Ligand topology from Complex... [INFO ] Assigning PBRadii mbondi2 to Ligand... [INFO ] Writing Normal Ligand AMBER topology... [INFO ] Selecting residues by distance (6 Å) between receptor and ligand for decomposition analysis... [INFO ] Selected 13 residues: L::ARG:108 L::ARG:109 L::ASP:110 L::GLN:111 L::MET:158 L::ARG:161 L::GLU:162 L::ARG:163 L::ALA:164 L::LYS:166 L::GLN:198 L::ASP:201 R::GRA:225 [INFO ] Cleaning normal complex trajectories... [INFO ] Building AMBER topologies from GROMACS files... Done. [INFO ] Loading and checking parameter files for compatibility... [INFO ] Preparing trajectories for simulation... [INFO ] 10 frames were processed by cpptraj for use in calculation. [INFO ] Running calculations on normal system... [INFO ] Beginning PB calculations with /home/tea_yiming/anaconda3/envs/gmxMMPBSA/bin/sander [INFO ] calculating complex contribution... [ERROR ] CalcError /home/tea_yiming/anaconda3/envs/gmxMMPBSA/bin/sander failed with prmtop COM.prmtop! If you are using sander and PB calculation, check the .mdout files to get the sander error. Check the gmx_MMPBSA.log file to report the problem. File "/home/tea_yiming/anaconda3/envs/gmxMMPBSA/bin/gmx_MMPBSA", line 8, in sys.exit(gmxmmpbsa()) File "/home/tea_yiming/anaconda3/envs/gmxMMPBSA/lib/python3.9/site-packages/GMXMMPBSA/app.py", line 104, in gmxmmpbsa app.run_mmpbsa() File "/home/tea_yiming/anaconda3/envs/gmxMMPBSA/lib/python3.9/site-packages/GMXMMPBSA/main.py", line 202, in run_mmpbsa self.calc_list.run(rank, self.stdout) File "/home/tea_yiming/anaconda3/envs/gmxMMPBSA/lib/python3.9/site-packages/GMXMMPBSA/calculation.py", line 85, in run calc.run(rank, stdout=stdout, stderr=stderr) File "/home/tea_yiming/anaconda3/envs/gmxMMPBSA/lib/python3.9/site-packages/GMXMMPBSA/calculation.py", line 479, in run GMXMMPBSA_ERROR('%s failed with prmtop %s!\n\t' % (self.program, self.prmtop) + File "/home/tea_yiming/anaconda3/envs/gmxMMPBSA/lib/python3.9/site-packages/GMXMMPBSA/exceptions.py", line 169, in init raise exc(msg + '\nCheck the gmx_MMPBSA.log file to report the problem.') CalcError: /home/tea_yiming/anaconda3/envs/gmxMMPBSA/bin/sander failed with prmtop COM.prmtop! If you are using sander and PB calculation, check the .mdout files to get the sander error Check the gmx_MMPBSA.log file to report the problem. Error occurred on rank 1. Exiting. All files have been retained. application called MPI_Abort(MPI_COMM_WORLD, 1) - process 1 `

I think it may be related to the problem of mpirun version just as answered in [https://bytemeta.vip/repo/Valdes-Tresanco-MS/gmx_MMPBSA/issues/252]. Here are the details of mpirun curently used : (gmxMMPBSA) [tea_yiming@node03 gmx_MMPBSA]$ mpirun --version|sed -n 1,2p HYDRA build details: Version: 4.0.2 I followed the document of gmx_MMPBSA to install mpi4py. conda install -c conda-forge mpi4py=3.1.3 ambertools=21.12 compilers -y -q I am not sure whether i need to update mpirun. All the output files are in files.tar.gz files.tar.gz

Valdes-Tresanco-MS commented 2 years ago

I don't think it is a problem with the mpi, otherwise, the error would be of a different type. According to my tests, it seems to be running out of RAM. If I set fillratio=2, sander terminates correctly. However, even if it terminates correctly, you will probably get a new error, because the internal energy of your receptor is undefined (represented as "****"). I am not sure if the decomposition scheme is able to compute this molecule correctly.

Valdes-Tresanco-MS commented 2 years ago

Closing due to inactivity. Reopen if necessary