0

Hi I am trying to install VelvetOptimizer using docker. and it say Can't locate Bio/SeqIO.pm in @INC. It requires the following to be installed: Velvet >= 0.7.51 ,Perl >= 5.8, BioPerl >= 1.4 and i have installed them

Please find the Dockerfile:

FROM amazonlinux



WORKDIR /shared
    RUN yum -y install gcc
    ADD http://www.cpan.org/src/5.0/perl-5.16.1.tar.gz /shared
    RUN tar -xzf perl-5.16.1.tar.gz
    WORKDIR /shared/perl-5.16.1
    RUN ./Configure -des -Dprefix=/shared/perl-5.16.1/localperl
    RUN make
    RUN make test
    RUN make install
    RUN echo “Perl Installation Complete”
    ENV PATH=/shared/perl-5.16.1/localperl/bin/:${PATH}

WORKDIR /shared
ADD http://www.ebi.ac.uk/~zerbino/velvet/velvet_latest.tgz .
RUN tar -xvf /shared/velvet_latest.tgz
WORKDIR /shared/velvet_1.2.10/
RUN make
ENV PATH=${PATH}:/shared/velvet_1.2.10/

WORKDIR /shared
RUN echo "BIO PERL INSTALLATION"
RUN \wget -O - https://install.perlbrew.pl | bash
ENV PATH=${PATH}:/root/perl5/perlbrew/bin/
RUN perlbrew install-cpanm
RUN cpanm Bio::Perl

WORKDIR /shared
ADD http://www.vicbioinformatics.com/VelvetOptimiser-2.2.5.tar.gz .
RUN tar zxvf VelvetOptimiser-2.2.5.tar.gz
ENV PATH=${PATH}:/shared/VelvetOptimiser-2.2.4

When I run the command/shared/VelvetOptimiser-2.2.5/VelvetOptimiser.pl I get the below error:

Error:

Can't locate Bio/SeqIO.pm in @INC (@INC contains: /shared/VelvetOptimiser-2.2.5 /shared/vcftools/src/perl /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /shared/VelvetOptimiser-2.2.5/VelvetOpt/Assembly.pm line 238.
BEGIN failed--compilation aborted at /shared/VelvetOptimiser-2.2.5/VelvetOpt/Assembly.pm line 238.
Compilation failed in require at /shared/VelvetOptimiser-2.2.5/VelvetOptimiser.pl line 37.
BEGIN failed--compilation aborted at /shared/VelvetOptimiser-2.2.5/VelvetOptimiser.pl line 37.

But when I use "find" command: I am able to find the files.

./root/.cpanm/work/1501770319.1/BioPerl-1.007001/blib/lib/Bio/SeqIO.pm
./root/.cpanm/work/1501770319.1/BioPerl-1.007001/Bio/SeqIO.pm
./shared/perl-5.16.1/localperl/lib/site_perl/5.16.1/Bio/SeqIO.pm

I think its not be found in Perl's include path, which is represented by the variable named @INC. Can anyone please let me know how to fix this issue. how to add it in perls include path.

zx8754
  • 52,746
  • 12
  • 114
  • 209
nad87563
  • 3,672
  • 7
  • 32
  • 54
  • 1
    The `.cpanm/work` dirs are temporary work dirs used when installing the module. Ignore those. – ikegami Aug 03 '17 at 15:03
  • 1
    Note that your installation of `perlbrew` is incomplete. The installer instructs you to add some code to your login script. That said, this probably has no bearing on the issue at hand. – ikegami Aug 03 '17 at 15:06
  • What's the output of `head -1 /shared/VelvetOptimiser-2.2.5/VelvetOptimiser.pl`? – ikegami Aug 04 '17 at 17:53

1 Answers1

1

Clearly, /shared/VelvetOptimiser-2.2.5/VelvetOptimiser.pl has

#!/usr/bin/env perl

as its shebang line. So, it will use the first perl it finds in the $PATH.

You likely have a perl in /usr/bin. In your Docker file, you have:

ENV PATH=${PATH}:/root/perl5/perlbrew/bin/

That is, you likely put /usr/bin ahead of the perlbrew directory. So, /usr/bin/env perl is picking up /usr/bin/perl and not the perl you installed via perlbrew (which is also where you installed your new perl).

So, try

ENV PATH=/root/perl5/perlbrew/bin/:${PATH}

In addition, I do not see you actually install a perl via perlbrew:

You need

perlbrew install 5.xx.x
perlbrew switch 5.xx.x

before installing cpanm and installing Bio::Perl.

Sinan Ünür
  • 116,958
  • 15
  • 196
  • 339
  • i tried what you said but it doesnt work. echo $PATH =/root/perl5/perlbrew/bin/:/shared/perl-5.16.1/localperl/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/shared/samtools-0.1.18/:/shared/velvet_1.2.10/:/shared/VelvetOptimiser-2.2.4 – nad87563 Aug 03 '17 at 16:19
  • I have added perl installation steps in my dockerfile. – nad87563 Aug 03 '17 at 17:22