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

[Issue-gmx_MMPBSA]: IndexError: list index out of range #519

Closed Ossmonde closed 1 month ago

Ossmonde commented 1 month ago

Bug summary

My system only contains proteins(Chain A, Chain B and Chain C) water and ions. I'm attempting to compute the binding energy of Chain C binding to Chain A-Chain B complex. I utilized 'gmx make_ndx' to generate an index (ndx) file based on my tpr file. And I've ensured that there are no overlapping atoms within the specified groups.

I have tried some similar Protein in water systems. But they all worked well except this one. The following is my system which is prepared by charmm-gui. system_nowater.zip

Terminal output

gmx_MMPBSA -O -i ../mmgbsa_1.in -cs ../system.tpr -ci ../index.ndx -cg 19 18 -ct ../system_3_7ns.xtc -cp ../topol.top -o FINAL_RESULTS_MMPBSA.dat -eo FINAL_RESULTS_MMPBSA.csv
[INFO ] Starting gmx_MMPBSA v1.6.2
[INFO ] Command-line
gmx_MMPBSA -O -i ../mmgbsa_1.in -cs ../system.tpr -ci ../index.ndx -cg 19 18 -ct ../system_3_7ns.xtc -cp ../topol.top -o FINAL_RESULTS_MMPBSA.dat -eo FINAL_RESULTS_MMPBSA.csv
tets
[INFO ] Checking ../mmgbsa_1.in input file...
[INFO ] Checking ../mmgbsa_1.in input file...Done.
[INFO ] Checking external programs...
[INFO ] cpptraj found! Using /home/zhaohaipeng/.conda/envs/gmxMMPBSA/bin/cpptraj
[INFO ] tleap found! Using /home/zhaohaipeng/.conda/envs/gmxMMPBSA/bin/tleap
[INFO ] parmchk2 found! Using /home/zhaohaipeng/.conda/envs/gmxMMPBSA/bin/parmchk2
[INFO ] sander found! Using /home/zhaohaipeng/.conda/envs/gmxMMPBSA/bin/sander
[INFO ] Using GROMACS version > 5.x.x!
[INFO ] gmx found! Using /usr/local/gromacs/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 Chain_A_Chain_B_Chain_C (19_18) 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 Chain_A_Chain_B (19) 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 Chain_C (18) 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...
/home/zhaohaipeng/.local/lib/python3.8/site-packages/parmed/gromacs/gromacstop.py:602: GromacsWarning: bond funct != 1; unknown functional
warnings.warn('bond funct != 1; unknown functional',
File "/home/zhaohaipeng/.local/bin/gmx_MMPBSA", line 8, in
sys.exit(gmxmmpbsa())
File "/home/zhaohaipeng/.local/lib/python3.8/site-packages/GMXMMPBSA/app.py", line 98, in gmxmmpbsa
app.make_prmtops()
File "/home/zhaohaipeng/.local/lib/python3.8/site-packages/GMXMMPBSA/main.py", line 682, in make_prmtops
self.FILES.mutant_receptor_prmtop, self.FILES.mutant_ligand_prmtop) = maketop.buildTopology()
File "/home/zhaohaipeng/.local/lib/python3.8/site-packages/GMXMMPBSA/make_top.py", line 125, in buildTopology
tops = self.gmxtop2prmtop()
File "/home/zhaohaipeng/.local/lib/python3.8/site-packages/GMXMMPBSA/make_top.py", line 555, in gmxtop2prmtop
com_top = self.cleantop(self.FILES.complex_top, self.indexes['COM']['COM'])
File "/home/zhaohaipeng/.local/lib/python3.8/site-packages/GMXMMPBSA/make_top.py", line 843, in cleantop
rtemp_top = parmed.gromacs.GromacsTopologyFile(ttp_file.as_posix())
File "/home/zhaohaipeng/.local/lib/python3.8/site-packages/parmed/gromacs/gromacstop.py", line 346, in init
self.read(fname, defines, parametrize)
File "/home/zhaohaipeng/.local/lib/python3.8/site-packages/parmed/gromacs/gromacstop.py", line 407, in read
bond, bond_type = self._parse_bonds(line, bond_types, molecule.atoms)
File "/home/zhaohaipeng/.local/lib/python3.8/site-packages/parmed/gromacs/gromacstop.py", line 605, in _parse_bonds
bond = Bond(atoms[i], atoms[j])
IndexError: list index out of range
Exiting. All files have been retained.

gmx_MMPBSA.log

gmx_MMPBSA.log

Operating system

WSL2

gmx_MMPBSA Version

gmx_MMPBSA v1.6.2

Python version

3.9.15

Installation

None

Ossmonde commented 1 month ago

I have fixed the problem. The reason why the index out of range is that I added [ intermolecular_interactions ] in my topol.top file. In order to keep the relative position of my two chains, I added a intermolecular bond between them. And gmx_MMPBSA will add this bond which caused the atom numbers of the inter-bond out of the range. topol.txt

So, if you guys also add intermolecular_interactions like me, remember to comment the intermolecular_interaction in your topol.top file before you running the gmx_MMPBSA.