Skip to content

Addressing a common problem with BioPerl installation: "Can't locate Bio/Seq.pm in @INC" #74

@deanna-kim

Description

@deanna-kim

Hi Simon,

I just wanted to share my quick solution to what appears to be a common issue with BioPerl installation, at least based on: #63 , #71 . This may be helpful for anyone who has found that their err output file contains the following message:

Can't locate Bio/Seq.pm in @INC (you may need to install the Bio::Seq module)
(@INC contains: /Users/kimde/opt/anaconda3/envs/virsorter/lib/site_perl/5.26.2/darwin-thread-multi-2level
/Users/kimde/opt/anaconda3/envs/virsorter/lib/site_perl/5.26.2
/Users/kimde/opt/anaconda3/envs/virsorter/lib/5.26.2/darwin-thread-multi-2level
/Users/kimde/opt/anaconda3/envs/virsorter/lib/5.26.2 .)

Some background information, which is all included in the README:

Here is the series of commands that I used to install VirSorter and MetaGeneAnnotator.
# create conda environment
conda create --name virsorter \
             -c bioconda mcl=14.137 \
                         muscle \
                         blast \
                         perl-bioperl \
                         perl-file-which \
                         hmmer=3.1b2 \
                         perl-parallel-forkmanager \
                         perl-list-moreutils \
                         diamond=0.9.14

# clone the VirSorter repository
git clone https://github.com/simroux/VirSorter.git
cd VirSorter/Scripts
make clean
make

# to run VirSorter in any directory, make symbolic links to VirSorter/wrapper_phage_contigs_sorter_iPlant.pl
# and VirSorter/Scripts and place them in the bin folder for the “virsorter” conda environment.
ln -s ~/VirSorter/wrapper_phage_contigs_sorter_iPlant.pl ~/opt/anaconda3/envs/virsorter/bin
ln -s ~/VirSorter/Scripts ~/opt/anaconda3/envs/virsorter/bin
    
# install MetaGeneAnnotator
conda install --name virsorter -c bioconda metagene_annotator
Here's the series of commands I used to download the reformatted HMMs database.
# download the reformatted data pack
cd ~/VirSorter
wget https://zenodo.org/record/1168727/files/virsorter-data-v2.tar.gz

# run md5sum to make sure the output
# matches to dd12af7d13da0a85df0a9106e9346b45
md5sum virsorter-data-v2.tar.gz

# unpack it
tar -xvzf virsorter-data-v2.tar.gz

Here's the series of commands I used to run wrapper_phage_contigs_sorter_iPlant.pl on my FASTA file:

source activate virsorter
wrapper_phage_contigs_sorter_iPlant.pl -f NM65_B17-contigs-prefix-formatted-only.fa \
                                       --db 1 \
                                       --wdir  \
                                       --ncpu 4 \
                                       --data-dir ~/virsorter-data

After receiving the error message that I described earlier, I decided to first check that the Bio::Seq module was actually installed. I ran conda install -n virsorter perl-bioperl as previously recommended by you in #71 . However, I received an output stating "All requested packages already installed".

When I attempted perl -e "use Bio::Seq;" I kept getting the same error message as before, stating that Seq.pm could not be found. This suggested to me that although BioPerl was installed, it wasn't in any of the directories that were listed that were listed in the @INC variable.

I visited my conda environment virsorter, and checked for Seq.pm in:

/Users/kimde/opt/anaconda3/envs/virsorter/lib/site_perl/5.26.2/darwin-thread-multi-2level
/Users/kimde/opt/anaconda3/envs/virsorter/lib/site_perl/5.26.2
/Users/kimde/opt/anaconda3/envs/virsorter/lib/5.26.2/darwin-thread-multi-2level
/Users/kimde/opt/anaconda3/envs/virsorter/lib/5.26.2 .

As suspected, Seq.pm was not in any of these directories.

I figured that BioPerl was located somewhere else within the lib of the virsorter environment. I found a folder named Bio with this full path:

/Users/kimde/opt/anaconda3/envs/virsorter/lib/perl5/site_perl/5.22.0/Bio

There was a Seq.pm file inside, along with what appeared to be a number of other BioPerl modules. Since the Bio folder was not listed in the @INC variable, Seq.pm had not been found.

I tried to modify the @INC variable, but because I have extremely cursory programming experience I found it too difficult to do. Instead, I just copied the entire Bio folder and pasted it into:

/Users/kimde/opt/anaconda3/envs/virsorter/lib/site_perl/5.26.2/darwin-thread-multi-2level

Which was one of the directories already listed in the @INC variable.

I then ran this wrapper_phage_contigs_sorter_iPlant.pl on my FASTA file again:

source activate virsorter
wrapper_phage_contigs_sorter_iPlant.pl -f NM65_B17-contigs-prefix-formatted-only.fa \
                                       --db 1 \
                                       --wdir  \
                                       --ncpu 4 \
                                       --data-dir ~/virsorter-data

And it worked!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions