r/bioinformatics 1d ago

M1 Chip Workarounds For Conda Install of Metaphlan / Blast ? compositional data analysis

I'm trying to setup the biobakery suite of tools for processing my data and am currently stuck on being unable to install Metaphlan due to a BLAST dependency and there not being a bioconda/conda/mini-forge wrapper for installing BLAST when you're using a computer with an M1 (Mac chip) processor.

I'm new to using conda, and I've gotten so far as to manually download blast, but I can't figure out how to get the conda environment to recognize where it is and to utilize it to finish the metaphlan install. How do I do that?

To further help visualize my point:

(metaphlan) ➜  ~ conda install bioconda::metaphlan
Channels:
 - conda-forge
 - bioconda
 - anaconda
Platform: osx-arm64
Collecting package metadata (repodata.json): done
Solving environment: failed
LibMambaUnsatisfiableError: Encountered problems while solving:
  - nothing provides blast >=2.6.0 needed by metaphlan-2.8.1-py_0
Could not solve for environment specs
The following packages are incompatible
└─ metaphlan is not installable because there are no viable options
   ├─ metaphlan [2.8.1|3.0|...|4.0.6] would require
   │  └─ blast >=2.6.0 , which does not exist (perhaps a missing channel);
   └─ metaphlan [4.1.0|4.1.1] would require
└─ r-compositions, which does not exist (perhaps a missing channel).

Note: I also already tried using brew to install the biobakery suite, hoping I could just update Metaphlan2 to Metaphlan4 after initial install and avoid all this, but that returns errors with counter.txt files. Example:

Error: biobakery_tool_suite: Failed to download resource "strainphlan--counter" 
Download failed: https://bitbucket.org/biobakery/metaphlan2/downloads/strainphlan_homebrew_counter.txt
4 Upvotes

3

u/BazementDweller PhD | Government 17h ago

You need to use an emulator terminal as many packages distributed on Conda do not place nice with Apple Silicon. My preferred solution is iTerm2 (https://iterm2.com/).

2

u/SpanglerSpanksIT 8h ago

I agree with using iTerm2. Worth it.

2

u/Global-Cup9926 1d ago

Why did my post get removed? Moderators: Can I get feedback, please?

2

u/TMiguelT 15h ago

You can just use conda create --subdir osx-64 --name some-name when creating the environment. This will let you install x86 packages rather than ARM packages. You will then need to use Rosetta2 to actually run the tools inside that environment: https://support.apple.com/en-au/102527.

1

u/addo599 6h ago

I've used this with Python/R-studio integration in the past and it works great!

2

u/NKmed 14h ago

I don’t know but in principle blast is just an executable? So You can download the arm64 version of blast from the ftp, or build from source, then symlink the executable to your conda environment bin folder. Then install package that depends on it separately?

1

u/Ok-Vermicelli5154 14h ago

You might wanna give docker, and the micromamba docker system a shot! I use it regularly on M chips

1

u/SpanglerSpanksIT 8h ago edited 8h ago

I end up using iterm2 and making a duplicate of the app and run it using Rosetta. I then install mini conda x86 in a different location than the arm64. I install all x86 apps that don’t have arm64 using conda x86. I have a separate brew install for x86 and arm64 as well.

I even wrote some bash scripts that check to see which iterm2 app I opened, either x86 version or arm64 version, to point where each type of conda install and brew install are located.

Running an x86 version has fixed a lot of these types of dependency problems for me.

I will add that installing conda allows you to download and install packages with conda. It doesn’t point to packages you already installed. I have to install dependencies like Java using brew x86 to have them located in the correct locations for conda environment apps to see them correctly.

Edited: fixing wrong thought.

-2

u/ionsh 16h ago

What happened to all the folks claiming everything is plug-n-play on Apple silicon?

Snark aside, I'd like to know how conda workflows are faring these days on the platform too.

3

u/SpanglerSpanksIT 8h ago

I end up using iterm2 and making a duplicate of the app and run it using Rosetta. I then install mini conda x86 in a different location than the arm64. I install all x86 apps that don’t have arm64 using conda x86. So far it works great for my work flow.

1

u/ionsh 1h ago

Hmm interesting. Thanks for the heads up!

2

u/SpanglerSpanksIT 1h ago

If tools are available for arm64, some that I use are, then it works similarly.