phac-nml / mob-suite

MOB-suite: Software tools for clustering, reconstruction and typing of plasmids from draft assemblies
Apache License 2.0
125 stars 33 forks source link

Installation in Galaxy failed #61

Closed PHemarajata closed 4 years ago

PHemarajata commented 4 years ago

Hi, I was trying to install the mob-suite via Galaxy toolshed into my own Galaxy instance but I kept getting this error while conda is running.

ERROR conda.core.link:_execute(568): An error occurred while installing package 'bioconda::mob_suite-3.0.0-py_1'. LinkError: post-link script failed for package bioconda::mob_suite-3.0.0-py_1 running your command again with -v will provide additional information location of failed script: /home/phemarajata/galaxy/database/dependencies/_conda/envs/__mob_suite@3.0.0/bin/.mob_suite-post-link.sh

I tried to resolve the dependencies using conda a few times, but was never successful. Is there anything I should do differently? Thank you and stay safe.

kbessonov1984 commented 4 years ago

Hello, We are glad to help. I developed Galaxy wrapper for the tool. The error code is not very detailed so it is difficult to tell what went wrong with MOB-Suite 3.0.0 installation. Could you also post relevant excerpt from the galaxy.log file? Is bioconda channel added to your conda install?

I propose to have it installed manually instead installing the tool via the Galaxy Admin interface.

#login to the server where galaxy is installed
#install mob-suite in a separate conda environment like so (note double underscore in the environment name)
conda create -n __mob_suite@3.0.0 -y
#add conda channels (optional)
conda config --add channels defaults
conda config --add channels bioconda
conda config --add channels conda-forge
#activate environment and install MOB-Suite and initialize it
conda activate __mob_suite@3.0.0
conda install mob_suite=3.0.0 -y
#initialize all MOB-Suite databases to make 1st run faster (optional)
mob_init

After successful MOB-Suite install manually install the tool wrapper and modify tool_ file so that tool shows in the list The wrapper xml files are available from here

#create new folder in tools directory
cd tools && mkdir mob_suite && cd mob_suite
#download the 2 xml wrapper files to this new directory
wget https://raw.githubusercontent.com/phac-nml/galaxy_tools/master/tools/mob_suite/mob_recon.xml
wget wget https://raw.githubusercontent.com/phac-nml/galaxy_tools/master/tools/mob_suite/mob_typer.xml

Finally modify tool_conf.xml file in config folder by adding this new xml code. Start galaxy server daemon via run.sh --daemon start and see if the tool appears in the list. If not renamed, the tools config file can be tool_conf.xml.sample.

 <section id="mobsuite" name="Plasmid typing and reconstruction">
   <tool file="mob_suite/mob_recon.xml"/>
   <tool file="mob_suite/mob_typer.xml"/>
 </section>

Here is a snapshot of a successful install Screen Shot 2020-07-28 at 12 28 08 PM

PHemarajata commented 4 years ago

Hi thank you so much. I will try and report back.

PHemarajata commented 4 years ago

Hi, I ran into an error trying to install from conda. After the command "conda install mob_suite=3.0.0 -y" I ran into this error at the end:

Downloading` and Extracting Packages c-ares-1.11.0 | 87 KB | ##################################### | 100% Preparing transaction: done Verifying transaction: done Executing transaction: done ERROR conda.core.link:_execute(698): An error occurred while installing package 'bioconda::mob_suite-3.0.0-py_1'. Rolling back transaction: done

LinkError: post-link script failed for package bioconda::mob_suite-3.0.0-py_1 location of failed script: /home/phemarajata/miniconda3/envs/__mob_suite@3.0.0/bin/.mob_suite-post-link.sh ==> script messages <==

==> script output <== stdout: stderr: Traceback (most recent call last): File "/home/phemarajata/miniconda3/envs/__mob_suite@3.0.0/bin/mob_init", line 7, in from mob_suite.mob_init import main File "/home/phemarajata/miniconda3/envs/__mob_suite@3.0.0/lib/python3.8/site-packages/mob_suite/mob_init.py", line 8, in from mob_suite.blast import BlastRunner File "/home/phemarajata/miniconda3/envs/__mob_suite@3.0.0/lib/python3.8/site-packages/mob_suite/blast/__init__.py", line 9, in from pandas.io.common import EmptyDataError ImportError: cannot import name 'EmptyDataError' from 'pandas.io.common' (/home/phemarajata/miniconda3/envs/__mob_suite@3.0.0/lib/python3.8/site-packages/pandas/io/common.py) return code: 1 () How should I proceed? Thank you so much again!
kbessonov1984 commented 4 years ago

Hi, I just learned by working on other software that new recently released pandas 1.1.0 does not support that import exception statement. A temporary fix is to restrict pandas version up to 1.0.5. Thus try to create MOB-suite environment as before but before launching MOB-Suite install get pandas 1.0.5 installed first (conda install pandas==1.0.5). Will soon update conda package to a new build by changing the import code so it would work with any pandas version

PHemarajata commented 4 years ago

Hi, I followed the instructions and was able to see the tools, but when I tried to run it I got an error below:

/home/phemarajata/galaxy/database/jobs_directory/000/986/tool_script.sh: line 25: mob_typer: command not found

Is there anything else I should do? Thank you!

PHemarajata commented 4 years ago

Not sure if this related, but I also got this error during mob_init

2020-08-06 03:48:56,863 mob_suite.utils INFO: Database directory folder already exists at /home/phemarajata/anaconda3/envs/mob_suite@3.0.0/lib/python3.8/site-packages/mob_suite/databases [in /home/phemarajata/anaconda3/envs/mob_suite@3.0.0/lib/python3.8/site-packages/mob_suite/mob_init.py:131] 2020-08-06 03:48:56,864 mob_suite.utils INFO: Placed lock file at /home/phemarajata/anaconda3/envs/mob_suite@3.0.0/lib/python3.8/site-packages/mob_suite/databases/.lock [in /home/phemarajata/anaconda3/envs/mob_suite@3.0.0/lib/python3.8/site-packages/mob_suite/mob_init.py:142] 2020-08-06 03:48:56,864 mob_suite.utils INFO: Initializing databases...this will take some time [in /home/phemarajata/anaconda3/envs/mob_suite@3.0.0/lib/python3.8/site-packages/mob_suite/mob_init.py:165] 2020-08-06 03:48:56,864 mob_suite.utils INFO: Downloading databases...this will take some time [in /home/phemarajata/anaconda3/envs/mob_suite@3.0.0/lib/python3.8/site-packages/mob_suite/mob_init.py:178] 2020-08-06 03:48:56,864 mob_suite.utils INFO: Trying mirror https://share.corefacility.ca/index.php/s/rYaAH7oxrSVtilN/download [in /home/phemarajata/anaconda3/envs/mob_suite@3.0.0/lib/python3.8/site-packages/mob_suite/mob_init.py:182] % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 126 100 126 0 0 281 0 --:--:-- --:--:-- --:--:-- 281 2020-08-06 03:48:57,316 mob_suite.utils INFO: Downloading databases successful, now building databases at /home/phemarajata/anaconda3/envs/mob_suite@3.0.0/lib/python3.8/site-packages/mob_suite/databases [in /home/phemarajata/anaconda3/envs/mob_suite@3.0.0/lib/python3.8/site-packages/mob_suite/mob_init.py:191] 2020-08-06 03:48:57,317 mob_suite.utils INFO: Decompressing /home/phemarajata/anaconda3/envs/mob_suite@3.0.0/lib/python3.8/site-packages/mob_suite/databases/data.tar.gz [in /home/phemarajata/anaconda3/envs/mob_suite@3.0.0/lib/python3.8/site-packages/mob_suite/mob_init.py:107] Traceback (most recent call last): File "/home/phemarajata/anaconda3/envs/__mob_suite@3.0.0/lib/python3.8/shutil.py", line 1155, in _unpack_tarfile tarobj = tarfile.open(filename) File "/home/phemarajata/anaconda3/envs/mob_suite@3.0.0/lib/python3.8/tarfile.py", line 1606, in open raise ReadError("file could not be opened successfully") tarfile.ReadError: file could not be opened successfully

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/phemarajata/anaconda3/envs/mob_suite@3.0.0/bin/mob_init", line 10, in sys.exit(main()) File "/home/phemarajata/anaconda3/envs/mob_suite@3.0.0/lib/python3.8/site-packages/mob_suite/mob_init.py", line 192, in main extract(zip_file, database_directory) File "/home/phemarajata/anaconda3/envs/mob_suite@3.0.0/lib/python3.8/site-packages/mob_suite/mob_init.py", line 108, in extract shutil.unpack_archive(fname, outdir) File "/home/phemarajata/anaconda3/envs/mob_suite@3.0.0/lib/python3.8/shutil.py", line 1227, in unpack_archive func(filename, extract_dir, **kwargs) File "/home/phemarajata/anaconda3/envs/__mob_suite@3.0.0/lib/python3.8/shutil.py", line 1157, in _unpack_tarfile raise ReadError( shutil.ReadError: /home/phemarajata/anaconda3/envs/__mob_suite@3.0.0/lib/python3.8/site-packages/mob_suite/databases/data.tar.gz is not a compressed or uncompressed tar file

kbessonov1984 commented 4 years ago

Hello, there are 2 issues that I can see here: 1) Galaxy instance need to be configured so that it will use conda environments and install necessary dependencies, otherwise it will not see existing conda environments. To enable conda, in the galaxy.yml enable the following options

Also yesterday a new mob_suite version 3.0.0 build 2 conda recipe was released fixing the pandas issue

PHemarajata commented 4 years ago

Hi. Thank you so much. I was able to successfully install the Galaxy wrapper.