gmx_MMPBSA icon indicating copy to clipboard operation
gmx_MMPBSA copied to clipboard

[Bug-gmx_MMPBSA]: Error Parsing results to output files

Open kolmorgan opened this issue 2 years ago • 23 comments

Bug summary

Failed to parse results to output files

Terminal output

"[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   ] 5 frames were processed by cpptraj for use in calculation.
[INFO   ] Running calculations on normal system...
[INFO   ] Beginning PB calculations with /home/wsr/amber20/bin/sander
[INFO   ]   calculating complex contribution...
[INFO   ]   calculating receptor contribution...
[INFO   ]   calculating ligand contribution..."
"INFO   ] Parsing results to output files...
  File "/home/wsr/anaconda3/bin/gmx_MMPBSA", line 8, in <module>
    sys.exit(gmxmmpbsa())
  File "/home/wsr/anaconda3/lib/python3.8/site-packages/GMXMMPBSA/app.py", line 112, in gmxmmpbsa
    app.parse_output_files()
  File "/home/wsr/anaconda3/lib/python3.8/site-packages/GMXMMPBSA/main.py", line 1121, in parse_output_files
    self._get_decomp()
  File "/home/wsr/anaconda3/lib/python3.8/site-packages/GMXMMPBSA/main.py", line 1153, in _get_decomp
    self.calc_types.decomp_normal[key]['complex'].parse_from_file(self.pre + basename[i] % 'complex',
  File "/home/wsr/anaconda3/lib/python3.8/site-packages/GMXMMPBSA/amber_outputs.py", line 1148, in parse_from_file
    self._fill_composite_terms()
  File "/home/wsr/anaconda3/lib/python3.8/site-packages/GMXMMPBSA/amber_outputs.py", line 1248, in _fill_composite_terms
    tot = tot + self[term][res][e]
  File "/home/wsr/anaconda3/lib/python3.8/site-packages/GMXMMPBSA/utils.py", line 98, in __add__
    return EnergyVector(np.add(self, other), comp_std)
ValueError: operands could not be broadcast together with shapes (5,) (10,) 
Exiting. All files have been retained."

gmx_MMPBSA.log

gmx_MMPBSA.log

Operating system

ubuntu20.04

gmx_MMPBSA Version

v1.5.2

Python version

python3.8

Installation

pip

kolmorgan avatar May 14 '22 01:05 kolmorgan

I have not been able to reproduce this error. Can you check that the *.mdout files are complete?

Valdes-Tresanco-MS avatar May 14 '22 02:05 Valdes-Tresanco-MS

Yes, they are complete. Also, I have tried to install gmx_MMPBSA on another computer using "python -m pip install gmx_MMPBSA" or "amber.python -m pip install git+https://github.com/Valdes-Tresanco-MS/[email protected] amber.python -m pip install gmx_MMPBSA " And there seems no problem installing it. But when I try to calculate the protein-ligand binding free energy and do the decomposition, it returns the same error as before and the python version was python3.9. Here's my mmpbsa.in file

&general startframe=1, endframe=2,interval=1 PBRadii=7 , temperature=310.15 / &pb istrng=0.15, exdi=80, indi=4.0, inp=2, cavity_surften=0.0378, cavity_offset=-0.5692, fillratio=4, scale=2.0, linit=1000, prbrad=1.4, radiopt=0, / &decomp

idecomp=2, dec_verbose=3, csv_format=0, / I have also calculated the energy using mm/pbsa in Ambertools20, and it worked well.

&general startframe=1, endframe=200, strip_mask=":WAT,SOD,CLA" / &pb istrng=0.15, exdi=80, indi=4.0, inp=1, cavity_surften=0.0378, cavity_offset=-0.5692, fillratio=4, scale=2.0, linit=1000, prbrad=1.4, radiopt=0, / &decomp idecomp=2, dec_verbose=3, csv_format=0, / So it confused me and I don't know how to solve it.

kolmorgan avatar May 16 '22 02:05 kolmorgan

Can you send me your files (the ones you used to run the calculation) to try to reproduce this error? My email is [email protected]

Valdes-Tresanco-MS avatar May 16 '22 02:05 Valdes-Tresanco-MS

Of course, I have just sent the files to your email. Thanks.

kolmorgan avatar May 16 '22 03:05 kolmorgan

The email you sent me contains only one pdb file. Please, send me these files

  • mmpbsa.in
  • step3_inputpbsa.pdb
  • index.ndx
  • 1000-1999stride5.trr
  • topol.top + itps

Valdes-Tresanco-MS avatar May 16 '22 04:05 Valdes-Tresanco-MS

Sorry for the delay. Finally and after a lot of work, we have improved considerably the performance of gmx_MMPBSA_ana. In this PR we fixed some small problems and improved a lot the reading of the output files. The tests I did indicate that the issue is fixed. I attach this issue to the PR, so when we do the merge, you will be notified when the issue is closed and you can test if it works for you.

A few notes about your system. Since it is quite large, you should consider as ligand one of the two compounds and likewise consider as receptor only molecules that interact with it. This is mainly because these methods tend to overestimate the energy, the residue selection is twofold and would consume less computational resources.

Valdes-Tresanco-MS avatar Jun 09 '22 00:06 Valdes-Tresanco-MS

Really appreciated!

kolmorgan avatar Jun 09 '22 02:06 kolmorgan

Hi, I have a new problem related to this one. Given that maybe they are the same type and don't have much influence but cost a little more computing resources, I did not open a new issue. So the problem is that after updating to the latest version, most of my systems worked fine except for one. The trajectory I used was also created by VMD with 500 frames and the stride was set to 2, which is 250 frames to calculate, but it still failed when parsing results to output files, even when I used "gmx_MMPBSA --rewrite-output". But when I used 500 frames with stride set to 1 and set the interval to 2 in the mmpbsa.in file, it worked out fine in the end. I don't know why this happened, maybe it's still related to the problem above. I will send you the relative files if you need, thanks.

kolmorgan avatar Aug 25 '22 01:08 kolmorgan

Please, send me the files to check them

Valdes-Tresanco-MS avatar Aug 25 '22 01:08 Valdes-Tresanco-MS

I have sent you the files through my Gmail account, given the sizes of the files. Please tell me if there are any other files you will need, thanks.

kolmorgan avatar Aug 25 '22 03:08 kolmorgan

I have not received any mail or files yet

Valdes-Tresanco-MS avatar Aug 25 '22 19:08 Valdes-Tresanco-MS

file.tar.bz2 https://drive.google.com/file/d/1cgHAMVOY8Oj-YP30MnPcOz2ua5YXrWb4/view?usp=drive_web #228(email from @.***) Given that my files are too large, I will use this account to send you the files, Please tell me if any of them are missing. Thanks for help

kolmorgan avatar Aug 26 '22 01:08 kolmorgan

Hi, I have used new frames of the same trajectory (2000 frames with stride=10) in this system, and it also worked fine. And I don't know why it failed before, but I got a new problem here. After I used the nohup mpirun -np 2 gmx_MMPBSA MPI -O -i mmpbsa.in -cs step3_input.pdb -ci index.ndx -cg 1 13 -ct 3duplicatelast200ns.trr -cp topol.top &, and the calculation was ended normally. The decomposition file I got was different from the file created by gmx_MMPBSA --rewrite-output in the same directory, and I don't know why. Some values are different, and the apparent part is in the DELTAS decomp part.

kolmorgan avatar Sep 27 '22 02:09 kolmorgan

I do not find many differences except for the number of residues you considered in both calculations. Can you be more specific and point out the differences?

Valdes-Tresanco-MS avatar Sep 27 '22 03:09 Valdes-Tresanco-MS

Please look at the data from the 765th in rewrite_FINAL_DECOMP_MMPBSA.txt and the 428th in FINAL_DECOMP_MMPBSA.txt, they are both DELTA total energy decomposition but quite different. And the number of rows in these files is also different. What's more, when using --rewrite-output , the energy of individual residue was printed with their chain number, which is also different between them.

kolmorgan avatar Sep 27 '22 06:09 kolmorgan

It is difficult to know what is going on. The number of residues in both cases is different, which may be due to two factors: That you have not correctly assigned the chain IDs to the structure or that you have done the rewrite-output on different results. I don't remember your system very well and I don't have it anymore because, for confidentiality and ethical reasons, we delete all user systems once the issue is solved. Please give me access to the shared files again to check what is going on.

Valdes-Tresanco-MS avatar Sep 27 '22 13:09 Valdes-Tresanco-MS

Sure, I have uploaded the file in https://drive.google.com/file/d/1ivKvXeZYNp6FLeDawPRQjS087aXSpV8T/view?usp=sharing please tell me if you need more files.

kolmorgan avatar Sep 29 '22 00:09 kolmorgan

As I mentioned, the problem is that you defined different parameters in the two calculations. In the first one (the one that only contained the files without results), you define print_res = "within 15", while in the second one, you left it by default, that is, print_res = "within 6". This is where the different number of residues comes from. In your trajectories, it has several chains and two (equal) ligands. In its calculation, group 13 of the index includes both, so the results could be pretty confusing. I remember that I suggested not to have all chains and to compute only one ligand. Reviewing the results you sent me, I saw that the internal energy component is not 0, as it should be using the ST approximation. However, in the rewrite-output file, it is 0. This reaffirms that you are mixing results from different calculations.

HTH!

Valdes-Tresanco-MS avatar Sep 29 '22 01:09 Valdes-Tresanco-MS

The calculations between the first files I sent to you and the second files I sent were different indeed, and I mean that I have recalculated the results using more frames for the last 200ns (the second files) instead of the last 50ns (the first files). The differences I said between the normal results of the calculation and the one using --rewrite-output was inside the second calculation. When I used --rewrite-output to the second files I sent, the results are different from its normal-ended calculation. I have both computed only one ligand or two ligands in the monomer before, the values are nearly proportional to the results of four ligands, but that was using the MM/PBSA in Amber instead of gmx_MMPBSA, I will try that now as you suggested.
After checking the --rewrite-output files, they are different in the internal energy, indeed. But the new files I sent to you are the results of normal-ended calculation instead of the one using --rewrite-output . Please use the --rewrite-output to the new files I sent and compare their differences. If I'm using the --rewrite-output inappropriately, what exact code should I use to rewrite the right results? Also, can I add some parameters like print_res="xxx" to it to get more residues contributions using --rewrite-output ? Thanks for the help!

kolmorgan avatar Sep 29 '22 02:09 kolmorgan

Sorry for the delay. --rewrite-output just uses the function to get the result from the files and pass it to the output file. It does the same in all circumstances. No, --rewrite-output only allows modification of a few parameters, all related to the way the results are displayed, not recalculations. These parameters can be found in the _GMXMMPBSA_info file. To calculate new/more residues, you must redefine print_res and make a new calculation.

Valdes-Tresanco-MS avatar Oct 22 '22 16:10 Valdes-Tresanco-MS

OK. Thanks!

kolmorgan avatar Oct 24 '22 02:10 kolmorgan