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]: #484

Closed debanjansen48 closed 4 months ago

debanjansen48 commented 4 months ago

Bug summary

When running for other complex its working for few system not working giving following error.

I run some MD simulation with Gromacs 2023 for them its working. The md simulation executed with Gromacs 2024 for them getting following err.

Terminal output

MMGBSA$ gmx_MMPBSA -O -i mmpbsa.in -cs ../md_100.tpr -ct ../md_100.xtc -ci index.ndx -cg 1 13 -cp ../topol.top -o 3_RESULTS_MMPBSA.dat -eo 3_RESULTS_MMPBSA.csv
[INFO   ] Starting gmx_MMPBSA v1.6.1
[INFO   ] Command-line
  gmx_MMPBSA -O -i mmpbsa.in -cs ../md_100.tpr -ct ../md_100.xtc -ci index.ndx -cg 1 13 -cp ../topol.top -o 3_RESULTS_MMPBSA.dat -eo 3_RESULTS_MMPBSA.csv

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

[INFO   ] Checking external programs...
[INFO   ] cpptraj found! Using /home/debanjan/miniconda3/envs/gmxMMPBSA/bin/cpptraj
[INFO   ] tleap found! Using /home/debanjan/miniconda3/envs/gmxMMPBSA/bin/tleap
[INFO   ] parmchk2 found! Using /home/debanjan/miniconda3/envs/gmxMMPBSA/bin/parmchk2
[INFO   ] sander found! Using /home/debanjan/miniconda3/envs/gmxMMPBSA/bin/sander
[INFO   ] Using GROMACS version > 5.x.x!
[INFO   ] gmx found! Using /home/debanjan/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...
[ERROR  ] MMPBSA_Error 

/home/debanjan/miniconda3/envs/gmxMMPBSA/bin.AVX2_256/gmx make_ndx failed when querying index.ndx

Check the gmx_MMPBSA.log file to report the problem.
  File "/home/debanjan/miniconda3/envs/gmxMMPBSA/bin/gmx_MMPBSA", line 8, in <module>
    sys.exit(gmxmmpbsa())
  File "/home/debanjan/miniconda3/envs/gmxMMPBSA/lib/python3.9/site-packages/GMXMMPBSA/app.py", line 98, in gmxmmpbsa
    app.make_prmtops()
  File "/home/debanjan/miniconda3/envs/gmxMMPBSA/lib/python3.9/site-packages/GMXMMPBSA/main.py", line 687, in make_prmtops
    self.FILES.mutant_receptor_prmtop, self.FILES.mutant_ligand_prmtop) = maketop.buildTopology()
  File "/home/debanjan/miniconda3/envs/gmxMMPBSA/lib/python3.9/site-packages/GMXMMPBSA/make_top.py", line 123, in buildTopology
    self.gmx2pdb()
  File "/home/debanjan/miniconda3/envs/gmxMMPBSA/lib/python3.9/site-packages/GMXMMPBSA/make_top.py", line 263, in gmx2pdb
    GMXMMPBSA_ERROR('%s failed when querying %s' % (' '.join(self.make_ndx), self.FILES.complex_index))
  File "/home/debanjan/miniconda3/envs/gmxMMPBSA/lib/python3.9/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: 

/home/debanjan/miniconda3/envs/gmxMMPBSA/bin.AVX2_256/gmx make_ndx failed when querying index.ndx

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

gmx_MMPBSA.log

[INFO ] Starting gmx_MMPBSA v1.6.1 [DEBUG ] WDIR : /media/debanjan/DS-1TB/Project/PhD_Students/Shovan/5ZZV/Md/3/MMGBSA [DEBUG ] AMBERHOME : /home/debanjan/miniconda3/envs/gmxMMPBSA [DEBUG ] PYTHON EXE : /home/debanjan/miniconda3/envs/gmxMMPBSA/bin/python [DEBUG ] PYTHON VERSION: 3.9.15 | packaged by conda-forge | (main, Nov 22 2022, 08:45:29) [GCC 10.4.0] [DEBUG ] MPI : /home/debanjan/MPICH4/bin/mpirun [DEBUG ] ParmEd : 3.4.3+11.g41cc9ab [DEBUG ] OS PLATFORM : Linux-5.15.0-102-generic-x86_64-with-glibc2.35 [DEBUG ] OS SYSTEM : Linux [DEBUG ] OS VERSION : #112-Ubuntu SMP Tue Mar 5 16:50:32 UTC 2024 [DEBUG ] OS PROCESSOR : x86_64

[INFO ] Command-line gmx_MMPBSA -O -i mmpbsa.in -cs ../md_100.tpr -ct ../md_100.xtc -ci index.ndx -cg 1 13 -cp ../topol.top -o 3_RESULTS_MMPBSA.dat -eo 3_RESULTS_MMPBSA.csv

[DEBUG ] |Input file: [DEBUG ] |-------------------------------------------------------------- [DEBUG ] |Input file generated by gmx_MMPBSA (v1.6.1) [DEBUG ] |Be careful with the variables you modify, some can have severe consequences on the results you obtain. [DEBUG ] | [DEBUG ] |# General namelist variables [DEBUG ] |&general [DEBUG ] | sys_name = "Lig-2" # System name [DEBUG ] | startframe = 1 # First frame to analyze [DEBUG ] | endframe = 9999999 # Last frame to analyze [DEBUG ] | interval = 1000 # Number of frames between adjacent frames analyzed [DEBUG ] | forcefields = "oldff/leaprc.ff99SB,leaprc.gaff" # Define the force field to build the Amber topology [DEBUG ] | ions_parameters = 1 # Define ions parameters to build the Amber topology [DEBUG ] | PBRadii = 3 # Define PBRadii to build amber topology from GROMACS files [DEBUG ] | temperature = 300 # Temperature [DEBUG ] | qh_entropy = 0 # Do quasi-harmonic calculation [DEBUG ] | interaction_entropy = 0 # Do Interaction Entropy calculation [DEBUG ] | ie_segment = 25 # Trajectory segment to calculate interaction entropy [DEBUG ] | c2_entropy = 0 # Do C2 Entropy calculation [DEBUG ] | assign_chainID = 0 # Assign chains ID [DEBUG ] | exp_ki = 0.0 # Experimental Ki in nM [DEBUG ] | full_traj = 0 # Print a full traj. AND the thread trajectories [DEBUG ] | gmx_path = "" # Force to use this path to get GROMACS executable [DEBUG ] | keep_files = 2 # How many files to keep after successful completion [DEBUG ] | netcdf = 0 # Use NetCDF intermediate trajectories [DEBUG ] | solvated_trajectory = 1 # Define if it is necessary to cleanup the trajectories [DEBUG ] | verbose = 1 # How many energy terms to print in the final output [DEBUG ] |/ [DEBUG ] | [DEBUG ] |# (AMBER) Generalized-Born namelist variables [DEBUG ] |&gb [DEBUG ] | igb = 5 # GB model to use [DEBUG ] | intdiel = 1.0 # Internal dielectric constant for sander [DEBUG ] | extdiel = 78.5 # External dielectric constant for sander [DEBUG ] | saltcon = 0.0 # Salt concentration (M) [DEBUG ] | surften = 0.0072 # Surface tension [DEBUG ] | surfoff = 0.0 # Surface tension offset [DEBUG ] | molsurf = 0 # Use Connelly surface ('molsurf' program) [DEBUG ] | msoffset = 0.0 # Offset for molsurf calculation [DEBUG ] | probe = 1.4 # Solvent probe radius for surface area calc [DEBUG ] | ifqnt = 0 # Use QM on part of the system [DEBUG ] | qm_theory = "" # Semi-empirical QM theory to use [DEBUG ] | qm_residues = "" # Residues to treat with QM [DEBUG ] | qmcharge_com = 0 # Charge of QM region in complex [DEBUG ] | qmcharge_lig = 0 # Charge of QM region in ligand [DEBUG ] | qmcharge_rec = 0 # Charge of QM region in receptor [DEBUG ] | qmcut = 9999.0 # Cutoff in the QM region [DEBUG ] | scfconv = 1e-08 # Convergence criteria for the SCF calculation, in kcal/mol [DEBUG ] | peptide_corr = 0 # Apply MM correction to peptide linkages [DEBUG ] | writepdb = 1 # Write a PDB file of the selected QM region [DEBUG ] | verbosity = 0 # Controls the verbosity of QM/MM related output [DEBUG ] | alpb = 0 # Use Analytical Linearized Poisson-Boltzmann (ALPB) [DEBUG ] | arad_method = 1 # Selected method to estimate the effective electrostatic size [DEBUG ] |/ [DEBUG ] | [DEBUG ] |-------------------------------------------------------------- [DEBUG ] [INFO ] Checking mmpbsa.in input file... [INFO ] Checking mmpbsa.in input file...Done.

[INFO ] Checking external programs... [INFO ] cpptraj found! Using /home/debanjan/miniconda3/envs/gmxMMPBSA/bin/cpptraj [INFO ] tleap found! Using /home/debanjan/miniconda3/envs/gmxMMPBSA/bin/tleap [INFO ] parmchk2 found! Using /home/debanjan/miniconda3/envs/gmxMMPBSA/bin/parmchk2 [INFO ] sander found! Using /home/debanjan/miniconda3/envs/gmxMMPBSA/bin/sander [INFO ] Using GROMACS version > 5.x.x! [INFO ] gmx found! Using /home/debanjan/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... [DEBUG ] Running command: echo -e "name 1 GMXMMPBSA_REC\n name 13 GMXMMPBSA_LIG\n 1 | 13\n q\n" | /home/debanjan/miniconda3/envs/gmxMMPBSA/bin.AVX2_256/gmx make_ndx -n index.ndx -o _GMXMMPBSA_COM_index.ndx -f ../md_100.tpr [DEBUG ] :-) GROMACS - gmx make_ndx, 2022.4-conda_forge (-: [DEBUG ] [DEBUG ] Executable: /home/debanjan/miniconda3/envs/gmxMMPBSA/bin.AVX2_256/gmx [DEBUG ] Data prefix: /home/debanjan/miniconda3/envs/gmxMMPBSA [DEBUG ] Working dir: /media/debanjan/DS-1TB/Project/PhD_Students/Shovan/5ZZV/Md/3/MMGBSA [DEBUG ] Command line: [DEBUG ] gmx make_ndx -n index.ndx -o _GMXMMPBSA_COM_index.ndx -f ../md_100.tpr [DEBUG ] [DEBUG ] [DEBUG ] Reading structure file [DEBUG ] Reading file ../md_100.tpr, VERSION 2024.1 (single precision) [DEBUG ] Reading file ../md_100.tpr, VERSION 2024.1 (single precision) [ERROR ] MMPBSA_Error

/home/debanjan/miniconda3/envs/gmxMMPBSA/bin.AVX2_256/gmx make_ndx failed when querying index.ndx

Check the gmx_MMPBSA.log file to report the problem.

Operating system

Linux Mint

gmx_MMPBSA Version

v1.6.1

Python version

Python 3.9.15

Installation

conda AmberTools + pip

debanjansen48 commented 4 months ago

I think i need to install it using amber.python method. I installed it in one of my lab computer with Gromacs 2024.1 and working.

But when i am trying to install it in my workstation returns following error. weher as amber.sh path sourced and tleap working.

base) debanjan@debanjan:~/Desktop$ source /home/debanjan/amber22/amber.sh (base) debanjan@debanjan:~/Desktop$ gmx_MMPBSA Traceback (most recent call last): File "/home/debanjan/amber22/miniconda/lib/python3.10/site-packages/GMXMMPBSA/app.py", line 27, in from GMXMMPBSA import main File "/home/debanjan/amber22/miniconda/lib/python3.10/site-packages/GMXMMPBSA/main.py", line 31, in from GMXMMPBSA import utils, version File "/home/debanjan/amber22/miniconda/lib/python3.10/site-packages/GMXMMPBSA/utils.py", line 43, in import pandas as pd File "/home/debanjan/amber22/miniconda/lib/python3.10/site-packages/pandas/init.py", line 51, in from pandas.core.api import ( File "/home/debanjan/amber22/miniconda/lib/python3.10/site-packages/pandas/core/api.py", line 14, in from pandas.core.algorithms import factorize, unique, value_counts File "/home/debanjan/amber22/miniconda/lib/python3.10/site-packages/pandas/core/algorithms.py", line 62, in from pandas.core.indexers import validate_indices File "/home/debanjan/amber22/miniconda/lib/python3.10/site-packages/pandas/core/indexers/init.py", line 1, in from pandas.core.indexers.utils import ( File "/home/debanjan/amber22/miniconda/lib/python3.10/site-packages/pandas/core/indexers/utils.py", line 15, in from pandas.util._exceptions import find_stack_level ImportError: cannot import name 'find_stack_level' from 'pandas.util._exceptions' (/home/debanjan/amber22/miniconda/lib/python3.10/site-packages/pandas/util/_exceptions.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/debanjan/amber22/miniconda/bin/gmx_MMPBSA", line 5, in from GMXMMPBSA.app import gmxmmpbsa File "/home/debanjan/amber22/miniconda/lib/python3.10/site-packages/GMXMMPBSA/app.py", line 34, in raise ImportError('Could not import Amber Python modules. Please make sure ' ImportError: Could not import Amber Python modules. Please make sure you have sourced /home/debanjan/amber22/amber.sh (if you are using sh/ksh/bash/zsh) or /home/debanjan/amber22/amber.csh (if you are using csh/tcsh)

Valdes-Tresanco-MS commented 4 months ago

@debanjansen48 probably the first error is related to the gromacs version. Maybe you want to define the gmx executable you used for the MD through the gmx_path variable in the input file. the second one is probably related to the pandas version. We recommend using the conda env because you can take more control over the dependencies version. The latest versions of gmx_MMPBSA hasn't been tested using the standalone Ambertools installation

debanjansen48 commented 4 months ago

if i use conda env it can not execute gromacs 2024 trajectory sir

debanjansen48 commented 4 months ago

how to modify pandas

Valdes-Tresanco-MS commented 4 months ago

if i use conda env it can not execute gromacs 2024 trajectory sir

You can use a custom gromacs executable defining it in thegmx_path variable in the input file

debanjansen48 commented 4 months ago

thank you, its now working with all vertions..

outcome

  1. if gmx_MMPBSA installed with amber.python process it can work with local host Gromacs version may be Gromacs 2022,2023, 2024 etc. But due to pands and other python issues gmx_MMPBSA installed in this way may not be executed.
  2. if installed with .yml file it will work only with available version of Gromacs in conda cloud. In that case its crucial to use new format mmpbsa,in file and in the mmpbsa.in file define the locally installed gromacs path. Eg: gmx_path= "/usr/local/gromacs/bin". It works in my case. Thanks