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

[Question]: unknown error when installing gmx_MMPBSA #285

Closed leiqian-nmsu closed 2 years ago

leiqian-nmsu commented 2 years ago

My Question is...

Dear users, I tried to install gmx_MMPBSA using conda/pip in Centos (shell: zsh). After using command "$ screen" and then in screen I ran "$ conda activate gmxMMPBSA" and "$ conda install -c conda-forge mpi4py=3.1.3 ambertools=21.12 compilers -y -q", everything was OK and a comment "all requested packages already installed." showed up. However, I found two errors at the end: path_to_miniconda3/envs/gmxMMPBSA/etc/conda/deactivate.d/ambertools.sh:4: parse error near ]] path_to_miniconda3/envs/gmxMMPBSA/etc/conda/activate.d/ambertools.sh:4: parse error near ]] I am not sure if these two errors could be ignored or not. Thanks!

Valdes-Tresanco-MS commented 2 years ago

No, you should not ignore these errors, since these scripts activate or deactivate the conda environment, so without their execution, you would not have the environment correctly configured. I have installed gmx_MMPBSA several times on Centos 7 as a test and in all cases, it has worked fine. This case seems to be related to the shell interpreter in your OS. The *.sh files should be run with bash, however, seems to be running with zsh. These interpreters differ in syntax so the error is to be expected. Check that the bash interpreter exists.

which bash

Check that it runs correctly

bash path_to_miniconda3/envs/gmxMMPBSA/etc/conda/activate.d/ambertools.sh

Check that the script is correct (my case)

#!/bin/bash

export AMBERHOME=${CONDA_PREFIX}
if [[ ${PERL5LIB+x} ]]; then
    export _PRE_AMBERTOOLS_PERL5LIB=${PERL5LIB}
    export PERL5LIB="${CONDA_PREFIX}/lib/perl/mm_pbsa:${PERL5LIB}"
else
    export PERL5LIB="${CONDA_PREFIX}/lib/perl/mm_pbsa"
fi

If any of the above steps do not work, send me the OS information so I can try to reproduce the error.

leiqian-nmsu commented 2 years ago

Hi @Valdes-Tresanco-MS Thank you for your suggestion

I tried $ which bash, and it is "/usr/bin/bash" and I tried to change double brackets pair [[ ]] to single bracket pair [ ] in the fourth(4th) line in the two ambertools.sh files as mentioned in the below two errors: path_to_miniconda3/envs/gmxMMPBSA/etc/conda/activate.d/ambertools.sh:4: parse error near ]] path_to_miniconda3/envs/gmxMMPBSA/etc/conda/deactivate.d/ambertools.sh:4: parse error near ]]

After that I tried the below commands, but neither error message nor success message showed up: $ bash path_to_miniconda3/envs/gmxMMPBSA/etc/conda/activate.d/ambertools.sh $ bash path_to_miniconda3/envs/gmxMMPBSA/etc/conda/deactivate.d/ambertools.sh My script is almost the same as yours, except in 4th line: if [ ${PERL5LIB+x} ]; then # [ ] is used instead of [[ ]]

I then finished the whole installation process, and did the fast test: $ gmx_MMPBSA_test -f work_dir/ -n 10 I found they worked well: [INFO ] Protein-Ligand (Single trajectory approximation) [ 1/ 9] DONE [INFO ] Protein-Protein [ 2/ 9] DONE [INFO ] Protein-DNA [ 3/ 9] DONE [INFO ] Protein-Glycan [ 4/ 9] DONE [INFO ] Comp_receptor [ 5/ 9] DONE [INFO ] Alanine Scanning [ 6/ 9] DONE [INFO ] Stability calculation [ 7/ 9] DONE [INFO ] Decomposition Analysis [ 8/ 9] DONE [INFO ] Interaction Entropy approximation [ 9/ 9] DONE

And I do not think the below failure is a big deal during gmx_MMPBSA_test [INFO ] Opening gmx_MMPBSA_ana... qt.qpa.xcb: could not connect to display qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Further, after installation I did conda deactivate, and conda activate gmxMMPBSA again, it worked well. So do you think this installation is OK and acceptable? Thanks!

Valdes-Tresanco-MS commented 2 years ago

$ bash path_to_miniconda3/envs/gmxMMPBSA/etc/conda/activate.d/ambertools.sh

bash does not report when it completes successfully, it just shows the prompt again. What it does report is the error if it occurs. If this command finished OK (i.e. did not show an error) that means that for some reason, your OS is running these scripts with zsh by default, which should not be the case.

Further, after installation I did conda deactivate, and conda activate gmxMMPBSA again, it worked well. So do you think this installation is OK and acceptable? Thanks!

If it works, it shouldn't be a problem. You just make sure that the AMBERHOME variable is set correctly when the conda environment in which you installed gmx_MMPBSA is activated. It is common for a variable to be defined and point to a different place than it should, only it may work because the package is similar. I did this with AmberTools20 (compiled) and 21(conda) versions. I could not reproduce a cpptraj error because I was always using AT20 version 4.53, not AT21.

Let me know any other problems. Mario S.

leiqian-nmsu commented 2 years ago

@Valdes-Tresanco-MS Thanks! Problem solved