Becksteinlab / GromacsWrapper

GromacsWrapper wraps system calls to GROMACS tools into thin Python classes (GROMACS 4.6.5 - 2024 supported).
https://gromacswrapper.readthedocs.org
GNU General Public License v3.0
169 stars 53 forks source link

Hi there. error for gmx.pdb2gmx() #227

Closed lichman0405 closed 2 years ago

lichman0405 commented 2 years ago

I have Gromacs 2022, and I pip install GromacsWrapper. When I tried to script the following code, it showed me the error:

Python 3.9.13 | packaged by conda-forge | (main, May 27 2022, 16:56:21) [GCC 10.3.0] on linux Type "help", "copyright", "credits" or "license" for more information.

import gromacs gromacs.pdb2gmx(f='1IEE.pdb', o='protein.gro', p='topo1.top', ff='oplssa', water='tip4p') :-) GROMACS - gmx pdb2gmx, 2022.2 (-:

Executable: /usr/local/gromacs/bin/gmx Data prefix: /usr/local/gromacs Working dir: /home/md Command line: gmx pdb2gmx -f 1IEE.pdb -o protein.gro -p topo1.top -ff oplssa -water tip4p


Program: gmx pdb2gmx, version 2022.2 Source file: src/gromacs/gmxpreprocess/pdb2top.cpp (line 227) Function: void choose_ff_impl(const char, char, int, char*, int, const gmx::MDLogger&)

Inconsistency in user input: Could not find force field 'oplssa' in current directory, install tree or GMXLIB path.

For more information and tips for troubleshooting, please check the GROMACS website at http://www.gromacs.org/Documentation/Errors

Traceback (most recent call last): File "", line 1, in File "/root/miniconda3/envs/DevEnv1/lib/python3.9/site-packages/gromacs/core.py", line 398, in call return self.run(*args, *kwargs) File "/root/miniconda3/envs/DevEnv1/lib/python3.9/site-packages/gromacs/core.py", line 178, in run results, p = self._run_command(_args, **_kwargs) File "/root/miniconda3/envs/DevEnv1/lib/python3.9/site-packages/gromacs/core.py", line 611, in _run_command self.check_failure(result, command_string=p.command_string) File "/root/miniconda3/envs/DevEnv1/lib/python3.9/site-packages/gromacs/core.py", line 566, in check_failure raise GromacsError(rc, msg) gromacs.exceptions.GromacsError: [Errno 1] Gromacs tool failed Command invocation: gmx pdb2gmx -f 1IEE.pdb -o protein.gro -p topo1.top -ff oplssa -water tip4p

Dose it mean I need to config some env-setting like GMXLIB path on bashrc?

orbeckst commented 2 years ago

Normally, pdb2gmx should find your force field just as if you invoked it from the command line.

Does the following

gmx pdb2gmx -f 1IEE.pdb -o protein.gro -p topo1.top -ff oplssa -water tip4p

work, i.e., running the command manually?

If not, then you probably need to source your GMXRC file or do something else so that GROMACS finds what it needs.

Once you get gmx pdb2gmx to run successfully, try it through GromacsWrapper again.