All the steps worked pretty well except the last line for database indexing $HOME/prokka/bin/prokka --setupdb
I got this compilation error message:
Can't locate XML/Simple.pm in @INC (you may need to install the XML::Simple module) (@INC contains: /home/miniconda3/lib/site_perl/5.26.2/x86_64-linux-thread-multi /home/miniconda3/lib/site_perl/5.26.2 /home/miniconda3/lib/5.26.2/x86_64-linux-thread-multi /home/miniconda3/lib/5.26.2 .) at /home/prokka/bin/prokka line 29.
BEGIN failed--compilation aborted at /home/prokka/bin/prokka line 29.
Have you run cpan install XML::Simple with sudo? It may have installed the module to your local path and that path may not be in your perl path. Try either adding that local directory to your perl path or installing the package with sudo.
You have multiple Perl installations which is causing your problem. You have a system Perl into which you have installed some Perl modules with sudo apt-get install. However, you also have a Miniconda installed Perl which is used by Prokka because it takes precedence in your path. Check out which -a perl that gives you a list of all Perl binaries in your Path. To solve this you need to decide which Perl you want to use. You could, for example, install all required modules using conda or cpan (checkout which cpan to see that you are using the conda-provisioned one), modify your $PATH environment to give precedence to system perl, or change all your perl scripts to start with #!/path/to/perl where path/to/perl is of course the path to the perl you choose. I do however recommend the first option to use conda perl.
Yes, I have multiple Perl installations (please see below):
which -a perl
/home/xxxxxx/miniconda3/bin/perl
/usr/bin/perl
/bin/perl
which cpan
/home/xxxxx/miniconda3/bin/cpan
from prokka folder, shebang of Perl script
#!/usr/bin/env perl
path of cpan
#!/home/xxxxx/miniconda3/bin/perl
Sorry to ask again, but should I replace #!/usr/bin/env perl from Prokka folder with #!/home/xxxxx/miniconda3/bin/perl (cpan)?
And do the same for all Perl files in Prokka folder?
Disclaimer, I havent ever installed that software...
Please try the easy way first as described in the documentation first:
conda install -c conda-forge -c bioconda -c defaults prokka # install into base env
or even better:
conda create -n prokka -c conda-forge -c bioconda -c defaults prokka # make a prokka env
conda activate prokka
should I replace #!/usr/bin/env perl from Prokka folder with
#!/home/xxxxx/miniconda3/bin/perl (cpan)? And do the same for all Perl files in Prokka folder?
No, that would have no effect as /usr/bin/env perl is already miniconda3/bin/perl.
You should install and use preferentially miniconda perl, not system-wide perl. Using system wide perl for services is a NO-NO. Install ALL requested perl modules using conda or cpan, DO NOT use apt-get, DO NOT use sudo. Therefore, you have to find out what the modules are called in cpan using the module search, then do something like
cpan # not sudo!
> install XML::Simple
> install Digest::MD5
Have you run
cpan install XML::Simple
withsudo
? It may have installed the module to your local path and that path may not be in your perl path. Try either adding that local directory to your perl path or installing the package with sudo.Thanks for your comment, but
sudo cpan install XML::Simple
did not work!