simroux / VirSorter

Source code of the VirSorter tool, also available as an App on CyVerse/iVirus (https://de.iplantcollaborative.org/de/)
GNU General Public License v2.0
104 stars 30 forks source link

VirSorter conda version not running #31

Closed cmajones closed 6 years ago

cmajones commented 6 years ago

Hi Simon,

Thanks for all your work on VirSorter. I'm having trouble running the command line version using a conda environment.

When putting in this command: wrapper_phage_contigs_sorter_iPlant.pl -f V-MRN-001-12_scaffolds.fasta --db 2 --ncpu 4 --data-dir /home/casey/local/virsorter/virsorter-data

I get back the two files attached.

err.txt VirSorter_terminal_output.txt

'Namely, in the err output, I get:

Can't locate Bio/Seq.pm in @INC (you may need to install the Bio::Seq module)

and Error: Failed to open sequence file /home/casey/casey_backup/mareen/MAREEN_virome_all/concat_data/V-MRN-001-12_S21_R1_assembly/virsorter-out/fasta/VIRSorter_prots.fasta for reading

I've installed bioperl and metagenemark to try and fix these problems.

Do you have any other suggestions to get this to work? I would use CyVerse but have 100+ files to run in parallel on our cluster.

Thanks!

simroux commented 6 years ago

Hi, It looks like the conda installation did not suceed, or the conda environment is not properly loaded, since the "perl-bioperl" should have been installed.

Did you have any error message when running "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"

cmajones commented 6 years ago

Hi Simon,

I did a fresh install of the conda environment and I'm still getting the following output:

err.txt VirSorter_output.txt

simroux commented 6 years ago

So the error is different now, it looks like the scripts used by VirSorter are not in your path. Did you follow these two steps in the installation: ln -s ~/Applications/VirSorter/wrapper_phage_contigs_sorter_iPlant.pl ~/miniconda/envs/virsorter/bin ln -s ~/Applications/VirSorter/Scripts ~/miniconda/envs/virsorter/bin and replaced "~/miniconda/envs/" by your conda installation folder ?

cmajones commented 6 years ago

Hi Simon,

Sorry about that - I did a fresh install of the conda environment again and am still getting the Can't locate Bio/Seq.pm in @INC error. I did not get an error message when installing the environment.

Error log: err.txt Terminal out: VirSorter_out_2.txt

simroux commented 6 years ago

Can you double check if Bio::Seq is correctly installed in the conda environment ? This can be done by loading the environment and then trying to load only this module, e.g.:

source activate virsorter
perl -e "use Bio::Seq;"

If you get an error message, it means it's unfortunately an issue with conda, not VirSorter.

cmajones commented 6 years ago

Yes I still get the same error message:

Can't locate Bio/Seq.pm in @INC (you may need to install the Bio::Seq module) (@INC contains: /home/casey/miniconda3/envs/virsorter_3/lib/site_perl/5.26.2/x86_64-linux-thread-multi /home/casey/miniconda3/envs/virsorter_3/lib/site_perl/5.26.2 /home/casey/miniconda3/envs/virsorter_3/lib/5.26.2/x86_64-linux-thread-multi /home/casey/miniconda3/envs/virsorter_3/lib/5.26.2 .) at -e line 1. BEGIN failed--compilation aborted at -e line 1.

I will try to find a fix and let you know here.

cmajones commented 6 years ago

Hi Simon, @gavinmdouglas in my lab found a fix for this:

ln -s /home/casey/perl5/lib/perl5/Bio/ /home/casey/miniconda3/envs/virsorter_3/lib/site_perl/5.26.2/x86_64-linux-thread-multi

And adding the following to my .bashrc file

export PERL5LIB=/home/casey/perl5/lib/perl5/

Thanks for helping me locate the issue.

simroux commented 6 years ago

I'm still surprised that conda couldn't install BioPerl by itself, but happy that you found a fix to this issue !

Best, Simon

marschmi commented 4 years ago

More than a year later, I also had this issue with Conda and this post was very helpful! Though, I couldn't link to the perl files on my lab's server. Just in case other people have this issue, here's another solution by pulling the actual perl files from GitHub:

  1. Clone the BioPerl GitHub repo.

  2. Copy the lib/Bio/ folder and all of it's contents to the lib folder in the VirSorter conda environment:

    cp -r relPath/to/lib/Bio relPath/to/miniconda3/envs/virsorter/lib/5.26.2/
  3. Now onto VirSort-ing! :)

simroux commented 4 years ago

Thanks for sharing this tip !

hoelzer commented 4 years ago

Hi all, I also run into such an issue with bioperl and was able to solve it like this:

conda create -n virsorter -c bioconda perl-bioperl-core=1.007002 virsorter=1.0.6

I hope that also helps others. cheers

CynthiaChibani commented 4 years ago

Hi all, I also run into such an issue with bioperl and was able to solve it like this:

conda create -n virsorter -c bioconda perl-bioperl-core=1.007002 virsorter=1.0.6

I hope that also helps others. cheers

This one worked for me, thank you

kyuinHwang commented 3 years ago

I solved the same problem recently,

In my case, this problem occurs since the conda installed Bioperl into the "minicondaPath/pkgs/perl-bioperl-1.6.924-4" instead of "minicondaPath/envs/virsorter/lib/site_perl/5.26.2" even though the @INC is only include the "minicondaPath/envs/virsorter/lib/site_perl/5.26.2"

Therefore, I solved the problem by adding the following commands into the minicondaPath/envs/virsorter/etc/conda/activate.d/update_perllib.sh

!/bin/sh

export OLD_PERL5LIB=$PERL5LIB export PERL5LIB=$PERL5LIB:minicondaPath/pkgs/perl-bioperl-1.6.924-4/lib/perl5/site_perl/5.22.0

Plz, don't forget to replace "minicondaPath" into the path you installed conda.

I hope my solution is helpful to others.

simroux commented 3 years ago

Thanks for sharing !

Qin-2021 commented 3 years ago

Hi all, I also run into such an issue with bioperl and was able to solve it like this:

conda create -n virsorter -c bioconda perl-bioperl-core=1.007002 virsorter=1.0.6

I hope that also helps others. cheers

this one works for me thxthx