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
211 stars 64 forks source link

[Bug-gmx_MMPBSA]: mmbgsa fails at "Parsing results to output files..." stage #495

Closed morin-andrew closed 4 months ago

morin-andrew commented 4 months ago

Bug summary

When I execute the an mmgbsa run, the run proceeds through calculating the complex, receptor and ligand contributions, but then fails at "Parsing results to output files..." saying that "Some energy terms are undefined. Please, check..." I checked the .gro, .top and .xtc files as far as I could and they look normal. The URL included in the error output was not helpful. Attached is the input and .gro files.

Thank you for your help and all your efforts on this amazing project!

index.ndx.txt processed.gro.txt

Terminal output

> gmx_MMPBSA -O -i mmgbsa.in -cs ../md_0_1.tpr -ct ../md_0_1.xtc -ci ../index.ndx -cg 10 11 -cp ../topol.top -o FINAL_RESULTS_MMPBSA.dat -eo FINAL_RESULTS_MMPBSA.csv
> mca_base_component_repository_open: unable to open mca_btl_openib: librdmacm.so.1: cannot open shared object file: No such file or directory (ignored)
[INFO   ] Starting gmx_MMPBSA v1.6.3
[INFO   ] Command-line
  gmx_MMPBSA -O -i mmgbsa.in -cs ../md_0_1.tpr -ct ../md_0_1.xtc -ci ../index.ndx -cg 10 11 -cp ../topol.top -o FINAL_RESULTS_MMPBSA.dat -eo FINAL_RESULTS_MMPBSA.csv

[INFO   ] Checking mmgbsa.in input file...
[INFO   ] Checking mmgbsa.in input file...Done.

[INFO   ] Checking external programs...
[INFO   ] cpptraj found! Using /home/ubuntu/miniconda3/envs/gmxMMPBSA/bin/cpptraj
[INFO   ] tleap found! Using /home/ubuntu/miniconda3/envs/gmxMMPBSA/bin/tleap
[INFO   ] parmchk2 found! Using /home/ubuntu/miniconda3/envs/gmxMMPBSA/bin/parmchk2
[INFO   ] sander found! Using /home/ubuntu/miniconda3/envs/gmxMMPBSA/bin/sander
[INFO   ] Using GROMACS version > 5.x.x!
[INFO   ] gmx found! Using /home/ubuntu/miniconda3/envs/gmxMMPBSA/bin.AVX2_256/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 r_1-146_r_147-353 (10_11) 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 r_1-146 (10) 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 r_147-353 (11) in _GMXMMPBSA_COM_index.ndx file as _GMXMMPBSA_LIG.pdb
[INFO   ] Checking the structures consistency...
[INFO   ] 
[INFO   ] Using topology conversion. Setting radiopt = 0...
[INFO   ] Building Normal Complex Amber topology...
[INFO   ] Detected Amber/OPLS force field topology format...
[WARNING] 6 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   ] 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   ] 11 frames were processed by cpptraj for use in calculation.
[INFO   ] Starting calculations in 1 CPUs...

[INFO   ] Running calculations on normal system...
[INFO   ] Beginning GB calculations with /home/ubuntu/miniconda3/envs/gmxMMPBSA/bin/sander
[INFO   ]   calculating complex contribution...
            100%|###############################################################################################################################################################################################################| 11/11 [elapsed: 00:21 remaining: 00:00]
[INFO   ]   calculating receptor contribution...
            100%|###############################################################################################################################################################################################################| 11/11 [elapsed: 00:05 remaining: 00:00]
[INFO   ]   calculating ligand contribution...
            100%|###############################################################################################################################################################################################################| 11/11 [elapsed: 00:07 remaining: 00:00]
[INFO   ] Parsing results to output files...

[ERROR  ] MMPBSA_Error 

Some energy terms are undefined. Please, check the input structure and trajectory. Check this section the docs for more info https://valdes-tresanco-ms.github.io/gmx_MMPBSA/dev/Q%26A/calculations/#possible-solutions

Check the gmx_MMPBSA.log file to report the problem.
  File "/home/ubuntu/miniconda3/envs/gmxMMPBSA/bin/gmx_MMPBSA", line 8, in <module>
    sys.exit(gmxmmpbsa())
  File "/home/ubuntu/miniconda3/envs/gmxMMPBSA/lib/python3.10/site-packages/GMXMMPBSA/app.py", line 109, in gmxmmpbsa
    app.parse_output_files()
  File "/home/ubuntu/miniconda3/envs/gmxMMPBSA/lib/python3.10/site-packages/GMXMMPBSA/main.py", line 1215, in parse_output_files
    self.calc_types.normal[key]['complex'].parse_from_file(self.pre + basename[i] % 'complex',
  File "/home/ubuntu/miniconda3/envs/gmxMMPBSA/lib/python3.10/site-packages/GMXMMPBSA/amber_outputs.py", line 108, in parse_from_file
    AmberOutput._read(self)
  File "/home/ubuntu/miniconda3/envs/gmxMMPBSA/lib/python3.10/site-packages/GMXMMPBSA/amber_outputs.py", line 197, in _read
    self._get_energies(output_file)
  File "/home/ubuntu/miniconda3/envs/gmxMMPBSA/lib/python3.10/site-packages/GMXMMPBSA/amber_outputs.py", line 630, in _get_energies
    self['BOND'][self.frame_idx] = conv_float(words[2])
  File "/home/ubuntu/miniconda3/envs/gmxMMPBSA/lib/python3.10/site-packages/GMXMMPBSA/amber_outputs.py", line 603, in conv_float
    GMXMMPBSA_ERROR('Some energy terms are undefined. Please, check the input structure and trajectory. Check this '
  File "/home/ubuntu/miniconda3/envs/gmxMMPBSA/lib/python3.10/site-packages/GMXMMPBSA/exceptions.py", line 171, in __init__
    raise exc('\n\n' + msg + '\n\nCheck the gmx_MMPBSA.log file to report the problem.')
MMPBSA_Error: 

Some energy terms are undefined. Please, check the input structure and trajectory. Check this section the docs for more info https://valdes-tresanco-ms.github.io/gmx_MMPBSA/dev/Q%26A/calculations/#possible-solutions

Check the gmx_MMPBSA.log file to report the problem.
Exiting. All files have been retained.

gmx_MMPBSA.log

gmx_MMPBSA.log

Operating system

Ubuntu 22.04

gmx_MMPBSA Version

gmx_MMPBSA v1.6.3

Python version

Python 3.10.14

Installation

pip

marioernestovaldes commented 4 months ago

could you send the files you are using?

morin-andrew commented 4 months ago

The .xtc file is too large, approx 600MB. Would it be helpful if I truncated it to a upload able size? But here is the topol.top (added the ".txt" so I'd upload) topol.top.txt

marioernestovaldes commented 4 months ago

just need 5 frames from the xtc. please send this and the rest of the files mmgbsa.in, md_0_1.tpr, index.ndx and topol.top with all the tips associated in a compressed folder

morin-andrew commented 4 months ago

FYI - I reran the command using the truncated .xtc file and got the same error. All the latest files and log are included in the .zip file. upload.zip

marioernestovaldes commented 4 months ago

need these files as well:

include "topol_Protein_chain_A.itp"

include "topol_Protein_chain_B.itp"

marioernestovaldes commented 4 months ago

I see your structure and trajectory haven't been fitted or PBC removed. Did you carefully check the recommendations provided here:

https://valdes-tresanco-ms.github.io/gmx_MMPBSA/dev/gmx_MMPBSA_running/

morin-andrew commented 4 months ago

Included: upload.zip

morin-andrew commented 4 months ago

I did not check those recommendations. I will do that and respond with the results (either way) when I have done so.

morin-andrew commented 4 months ago

Success! Fixing the PBC as recommended in Steps 1 & 2 of section "The trajectory defined in -ct, -rt, or -lt doesn't contain PBC" found here https://valdes-tresanco-ms.github.io/gmx_MMPBSA/dev/gmx_MMPBSA_running/ solved the issue and the run completed successfully.

For others encountering this issue, my mistake was that when I visualize the trajectory prior to running, by habit and without thinking I use the "gmx trjconv -pbc cluster -center ..." options. This of course fixed hides any PBC issues in the output .pdb file that I visualize without actually fixing them in the .xtc file.

Thank you Mario E. for your very timely help. Apologies for my careless mistake.

marioernestovaldes commented 4 months ago

no worries... happy to help!