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
229 stars 66 forks source link

[Bug-gmx_MMPBSA]: IndexError: list index out of range #500

Closed RazzyChen closed 6 months ago

RazzyChen commented 6 months ago

Bug summary

Here is my test system: MMPBSA_test.zip

My PDB file contains two chains (Chain A and Chain B). I'm attempting to compute the PB energy and energy decomposition between Chain A and Chain B. I utilized 'gmx make_ndx' to generate an index (ndx) file based on residue numbers. I've ensured that there are no overlapping atoms within the specified groups.

I noticed that gmx_MMPBSA works correctly when using amber14sb_parmbsc1 from User contributions but when using amber14SB_ROC_lipid17 from this site gmx_MMPBSA gives an 'IndexError: list index out of range' error."

The amber14SB_ROC_lipid17 source website language is Chinese, and I am translating it into English here.

Title: Gromacs-Compatible Amber14SB_ROC_lipid17 Force Field Package Content: This force field package uses Amber14SB for proteins, with 10 phosphorylated amino acids already supplemented. The nucleic acid parameters are from ROC, which has certain improvements over the older OL3 parameters for RNA simulation. Lipids use the Lipid17 parameters, with all lipids except cholesterol composed of 3 residue units. Additionally, we provide 246 lipid gro files that have been pre-stretched and can be directly used with modeling tools like Packmol.

To facilitate modification, the entire force field has been modularized, with all amino acid/ion/water atom type names remaining the same as before. Nucleic acid atom types have been suffixed with "_n", while lipid atom types have been suffixed with "_l" to distinguish them. Since the Amber series force fields (excluding DES-Amber developed by D. E. Shaw Res.) do not involve specific atom type-based LJ potential definitions, this will not cause other issues.

Update May 20th, afternoon(UTC+8)

This seems to be caused by gromacstop.py being unable to correctly obtain the bond and angle funct generated by the Amber14SB_ROC_lipid17 force field.

I'm trying to replace funct = int(words[2]) [line 600] with just funct = int(1), It's worked! However, this method does not have universal applicability.

Terminal output

[INFO   ] Starting gmx_MMPBSA v1.6.3
[INFO   ] Command-line
  gmx_MMPBSA -O -i mmpbsa.in -cs Production.tpr -ci index.ndx -cg 10 11 -ct ProductionPBSA_test.xtc -cp topol.top

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

[INFO   ] Checking external programs...
[INFO   ] cpptraj found! Using /home/yangzichen/Software/Miniconda/envs/MMPBSA/bin/cpptraj
[INFO   ] tleap found! Using /home/yangzichen/Software/Miniconda/envs/MMPBSA/bin/tleap
[INFO   ] parmchk2 found! Using /home/yangzichen/Software/Miniconda/envs/MMPBSA/bin/parmchk2
[INFO   ] sander found! Using /home/yangzichen/Software/Miniconda/envs/MMPBSA/bin/sander
[INFO   ] Using GROMACS version > 5.x.x!
[INFO   ] gmx found! Using /home/yangzichen/Software/GMX-2023.5/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 r_1-306_r_307-611 (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-306 (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_307-611 (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...
  File "/home/yangzichen/Software/Miniconda/envs/MMPBSA/bin/gmx_MMPBSA", line 8, in <module>
    sys.exit(gmxmmpbsa())
  File "/home/yangzichen/Software/Miniconda/envs/MMPBSA/lib/python3.10/site-packages/GMXMMPBSA/app.py", line 98, in gmxmmpbsa
    app.make_prmtops()
  File "/home/yangzichen/Software/Miniconda/envs/MMPBSA/lib/python3.10/site-packages/GMXMMPBSA/main.py", line 681, in make_prmtops
    self.FILES.mutant_receptor_prmtop, self.FILES.mutant_ligand_prmtop) = maketop.buildTopology()
  File "/home/yangzichen/Software/Miniconda/envs/MMPBSA/lib/python3.10/site-packages/GMXMMPBSA/make_top.py", line 124, in buildTopology
    tops = self.gmxtop2prmtop()
  File "/home/yangzichen/Software/Miniconda/envs/MMPBSA/lib/python3.10/site-packages/GMXMMPBSA/make_top.py", line 565, in gmxtop2prmtop
    com_top = self.cleantop(self.FILES.complex_top, self.indexes['COM']['COM'])
  File "/home/yangzichen/Software/Miniconda/envs/MMPBSA/lib/python3.10/site-packages/GMXMMPBSA/make_top.py", line 854, in cleantop
    rtemp_top = parmed.gromacs.GromacsTopologyFile(ttp_file.as_posix())
  File "/home/yangzichen/Software/Miniconda/envs/MMPBSA/lib/python3.10/site-packages/parmed/gromacs/gromacstop.py", line 346, in __init__
    self.read(fname, defines, parametrize)
  File "/home/yangzichen/Software/Miniconda/envs/MMPBSA/lib/python3.10/site-packages/parmed/gromacs/gromacstop.py", line 407, in read
    bond, bond_type = self._parse_bonds(line, bond_types, molecule.atoms)
  File "/home/yangzichen/Software/Miniconda/envs/MMPBSA/lib/python3.10/site-packages/parmed/gromacs/gromacstop.py", line 600, in _parse_bonds
    funct = int(words[2])
IndexError: list index out of range
Exiting. All files have been retained.

gmx_MMPBSA.log

gmx_MMPBSA.log

Operating system

RockyLiunx 9

gmx_MMPBSA Version

gmx_MMPBSA v1.6.3

Python version

Python 3.10.13

Installation

conda AmberTools + pip

marioernestovaldes commented 6 months ago

There is some missing information in tip3p.itp file... just add the missing numbers (marked as added in the picture below) and it should run smoothly:

image

RazzyChen commented 6 months ago

I'm go glad hear from you. Let me try it : )

RazzyChen commented 6 months ago

It's worked! I'm apologize for my temerity:). I've closed this issues. Thank you very much!