tseemann / prokka

:zap: :aquarius: Rapid prokaryotic genome annotation
836 stars 226 forks source link

prokka install issue with M1 mac processor using homebrew - miniforge #608

Open beherrm opened 2 years ago

beherrm commented 2 years ago

Hello

I am trying to install prokka on my new mac MacOS BigSur M1. I tried just installing miniconda and installing with conda install -c conda-forge -c bioconda -c defaults prokka

it runs this Collecting package metadata (current_repodata.json): done Solving environment: failed with initial frozen solve. Retrying with flexible solve. Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source. Collecting package metadata (repodata.json): done Solving environment: - |-

But halts with this

I exited the install and installed homebrew To install miniforge through homebrew to provide native support to my M1 system. /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" brew install miniforge conda init zsh

However when trying to run conda install for prokka (in environment /Users/user/miniconda3) I get the same issue.

I've also tried running the brew installation but get "Error: hmmer no bottle available!" issue

Could anybody help me with the install using this OS?

Much appreciated!

beherrm commented 2 years ago

Ok so I updated conda with tseemans earlier suggestion conda config --add channels defaults conda config --add channels bioconda conda config --add channels conda-forge conda create -n prokka_env prokka conda activate prokka prokka --version

And it runs but then says that prokka does not exist but realized that _env was missing in activation so activated with conda activate prokka_env and this fixed the problem!

orshalevsk commented 2 years ago

Thanks for the update. However, I am still having the same issue even after reorganising the channels.

I am not sure, but could it be that I must run it with Rosetta 2 (+ brew installation)? That would be a pity, considering the performance trade-off.

Thanks.

AJ-DD commented 2 years ago

Hello,

First time user/commenter/question-asker on this forum. Not an experienced user. Not sure it will work to comment on a 5 month old thread, but it seems to fit my problem.

So I am trying to install Prokka on a Monterey M1 MacBook Air. Rosetta 2 and Python 3.9.X (not sure which exact version) are installed. I am running in to the same problem as above and have tried the suggested solution, i.e. I first run: conda config --add channels defaults conda config --add channels bioconda conda config --add channels conda-forge conda create -n prokka_env prokka

But at this point I still get: Collecting package metadata (current_repodata.json): done Solving environment: failed with initial frozen solve. Retrying with flexible solve. Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source. Collecting package metadata (repodata.json): done Solving environment: - |-

And then the install is stuck and nothing happens.

I've also tried doing this with Anaconda Navigator (which worked on my old Intel Mac), but also there it seems Prokka will not install, the Navigator is stuck at "Solving package specifications".

Well, in case anyone reads this and has any ideas of what is going wrong and/or any suggestions of a workaround I would be very grateful! Thanks!

EDIT: The above issue was resolved, I hadn't BioPerl installed and now that I've done that (suggested in a newer thread on install issues) at least it worked to install Prokka ("conda install -c conda-forge -c bioconda -c defaults prokka").

orshalevsk commented 2 years ago

Hi! So for me what works is to use 'mamba' rather than conda (it is a wrapper of conda).

Try this: conda create -n prokka_env conda activate prokka_env mamba install prokka

Hope it helps. Cheers, Or

GlassLabGT commented 2 years ago

@orshalevsk thank you -- your code worked great for me after struggling with the same problem as OP.

BrairaWahid commented 1 year ago

I am experiencing the same problem, I tried installation of homebrew and perl but it wasn't helpful with installation of prokka.

jbadomics commented 1 year ago

I was able to install and run prokka successfully on a 2023 Macbook Air with M2 chip. I see no reason this approach would not work for an M1 machine.

Infernal appears to be the architecture bottleneck which necessitates creating a local x86_64 environment in order to run prokka..

1) install Homebrew

2) install miniforge (cask). This is as far as we will be using Homebrew to manage dependencies. All other prokka dependencies will be managed within a conda environment.

3) conda init (re-start your shell if needed)

4) edit your ~/.bash_profile to temporarily eliminate all references to homebrew executables otherwise findable your $PATH - i.e. comment out lines putting Homebrew's executables in your $PATH

5) source ~/.bash_profile or restart shell

6) Make sure Perl isn't still looking in any user directories for locally installed modules

unset PERL5LIB PERL_LOCAL_LIB_ROOT PERL_MB_OPT PERL_MM_OPT

7) create an x86_64-specific conda environment and install Python and Clang

CONDA_SUBDIR=osx-64 conda create -n env_x86 python=3.9.13 clangxx_osx-64

8) conda activate env_x86

9) install prokka

CONDA_SUBDIR=osx-64 conda install -c bioconda prokka (solving environment will take a few minutes)

10) If you wish to run signalp, download version 4.1 for Darwin. (I could not get signalp version 5.0 to work.) For convenience I copied the entire file tree into the conda environment parent directory:

tar -xvf ~/Downloads/signalp-4.1.tar
cp -R ~/Downloads/signalp-4.1 /opt/homebrew/Caskroom/miniforge/base/envs/env_x86

In macOS Finder, navigate to the unpacked signalp directory (command+shift+G) and either right- or command-click on the following executables in order to grant macOS permission to run software from an unidentified developer. The three executables are:

signalp4.1/signalp
signalp4.1/lib/nnhowplayer.Darwin_x86_64
signalp4.1/lib/nnhowplayer.Darwin_i386

Per its README, open signalp in a plain text editor and edit line 13 in order to change the path to where you have placed signalp's parent directory:

     11 # full path to the signalp-4.1 directory on your system (mandatory)
     12 BEGIN {
     13     $ENV{SIGNALP} = '/opt/homebrew/Caskroom/miniforge/base/envs/env_x86/signalp-4.1';
     14 }

signalp also includes a required Perl module FASTA.pm. Verify your Perl installation within the active env_x86 environment. You should see only directories associated with the conda environment. In addition, verify that none of the shell variables PERL5LIB PERL_LOCAL_LIB_ROOT PERL_MB_OPT PERL_MM_OPT are set.

perl -V
...
  @INC:
    /opt/homebrew/Caskroom/miniforge/base/envs/env_x86/lib/perl5/5.32/site_perl
    /opt/homebrew/Caskroom/miniforge/base/envs/env_x86/lib/perl5/site_perl
    /opt/homebrew/Caskroom/miniforge/base/envs/env_x86/lib/perl5/5.32/vendor_perl
    /opt/homebrew/Caskroom/miniforge/base/envs/env_x86/lib/perl5/vendor_perl
    /opt/homebrew/Caskroom/miniforge/base/envs/env_x86/lib/perl5/5.32/core_perl
    /opt/homebrew/Caskroom/miniforge/base/envs/env_x86/lib/perl5/core_perl

If all looks good, do

ln -s /opt/homebrew/Caskroom/miniforge/base/envs/env_x86/signalp-4.1/lib/FASTA.pm /opt/homebrew/Caskroom/miniforge/base/envs/env_x86/lib/perl5/site_perl

10) You may have a missing Perl dependency. If so, run:

perl -MCPAN -e 'install Bio::SearchIO::hmmer3'

11) Run prokka --setupdb

12) Annotate a test genome:

prokka --force --outdir prokka_test_M2 --addgenes --locustag TEST  --gram negative --cpus 8 --rfam sequence.fasta

You can confirm how many CPU cores you have in x86_84 mode by running sysctl -a | grep 'core_count'

13) conda deactivate

I was able to get prokka to complete successfully regardless of whether macOS Terminal.app is set to run with Rosetta enabled or not.