sanger-pathogens / Bio-Tradis

A set of tools to analyse the output from TraDIS analyses
https://sanger-pathogens.github.io/Bio-Tradis/
Other
22 stars 29 forks source link

Installation on Ubuntu 17.10 fails #84

Closed apeltzer closed 6 years ago

apeltzer commented 6 years ago

Hey everyone,

I tried setting up a Singularity container for our analysis and tried several things to achieve that: a.) Conda installation (which doesn't work the way it is mentioned in the GitHub Readme) b.) Linuxbrew installation (similar issues, missing dependencies)

So instead, I used this here to achieve a Blank Ubuntu 17.10 installation with all the requirements in place:

#Fetch updates
apt-get update 
apt-get install -y r-base r-recommended samtools wget cpanminus
#Fetch smalt and compile it
wget https://netcologne.dl.sourceforge.net/project/smalt/smalt-0.7.6.tar.gz
tar xzfv smalt-0.7.6.tar.gz
rm smalt-0.7.6.tar.gz
cd smalt-0.7.6
./configure 
make 
make install

#Install some other stuff for R
Rscript -e 'source("http://bioconductor.org/biocLite.R")' -e 'biocLite(c("edgeR","getopt", "MASS"))'

cpanm -f Bio::Tradis

Things work fine until I try to install Tradis via the very last command and all tools are in place. The problem seems to persist since dependenceis of Tradis are not met, copying the error message in here for that purpose:

--> Working on Task::Weaken
Fetching http://www.cpan.org/authors/id/E/ET/ETHER/Task-Weaken-1.05.tar.gz ... OK
Configuring Task-Weaken-1.05 ... OK
Building and testing Task-Weaken-1.05 ... OK
Successfully installed Task-Weaken-1.05
Building and testing PPI-1.236 ... OK
Successfully installed PPI-1.236
! Installing the dependencies failed: Module 'MooseX::Types::Structured' is not installed
! Bailing out the installation for Parse-Method-Signatures-1.003019.
--> Working on Scope::Upper
Fetching http://www.cpan.org/authors/id/V/VP/VPIT/Scope-Upper-0.30.tar.gz ... OK
Configuring Scope-Upper-0.30 ... OK
Building and testing Scope-Upper-0.30 ... OK
Successfully installed Scope-Upper-0.30
--> Working on Devel::Declare
Fetching http://www.cpan.org/authors/id/E/ET/ETHER/Devel-Declare-0.006019.tar.gz ... OK
Configuring Devel-Declare-0.006019 ... OK
Building and testing Devel-Declare-0.006019 ... OK
Successfully installed Devel-Declare-0.006019
! Installing the dependencies failed: Module 'Parse::Method::Signatures' is not installed
! Bailing out the installation for TryCatch-1.003002.
! Installing the dependencies failed: Module 'TryCatch' is not installed
! Bailing out the installation for Bio-Tradis-1.4.0.
72 distributions installed
ABORT: Aborting with RETVAL=255
Cleaning up...

Any ideas what we could do here?

lbarquist commented 6 years ago

Hi,

I've been trying to reproduce your problem. I haven't spent much time playing with containers, so I am probably doing this in a non-optimal way, and I am certain I've installed a lot of extraneous stuff that doesn't need to be there if you want to make a minimal container. But I've tested that this at least in principle works in an ubuntu 17.10 singularity container, including running through the example in BioTraDISTutorial.pdf and making sure the mapping, etc. actually runs and produces results. Here's a log of exactly what I did, hopefully this will give you a starting point:

## build ubuntu 17.10 singularity container
sudo singularity build --writable ubuntu.img docker://ubuntu:17.10
sudo singularity shell ubuntu.img

## doesn’t have wget by default, maybe curl would have worked…
apt-get install wget
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
wget https://repo.continuum.io/archive/Anaconda3-5.0.1-Linux-x86_64.sh

## apparently doesn’t have bzip2 either, needed for miniconda
apt-get install bzip2 
bash Miniconda3-latest-Linux-x86_64.sh

## automatically added miniconda lines in bashrc
source .bashrc

bash Anaconda3-5.0.1-Linux-x86_64.sh

## automatically added anaconda lines in bashrc
source .bashrc

conda config --add channels r
conda config --add channels defaults
conda config --add channels conda-forge
conda config --add channels bioconda
conda install r smalt samtools perl-app-cpanminus

#no make or gcc, or at least not obvious to me where they live
conda install make
apt-get install gcc

#I also set the LC_ALL locale variable here, I'm not sure if it was necessary as the missing cc seemed to be the bigger problem

cpanm -f Bio::Tradis

Note the cpanm tests failed for Bio::Tradis, but I think this is an issue with our tests at the moment (the Travis CI started failing recently, not due to a change in our code) rather than the install of Bio::Tradis on ubuntu 17.10.

If you want to go the route of installing the prerequisites manually as above, which will certainly give you a leaner install, I think this will probably work given my experience with the conda install. However there are probably some additional dependencies needed for the perl stuff to work that we've assumed would be there on a "normal" system installation. I worked these out (make and gcc in the case with conda) by looking in the /root/.cpanm/work/*/build.log files cpanm leaves behind when it fails.

Let us know if you do get this container working, it'd be a useful resource to point people to!

apeltzer commented 6 years ago

Hey! After a bit of more fiddling, it seems to work now as a Singularity container and I was able to use it that way.

See here for the container(s), one for the latest version and one (permanent, fixed) for 1.4.0 right now.

https://www.singularity-hub.org/collections/498

Usage e.g. would be