Skip to content

Commit

Permalink
Merge pull request #240 from DendrouLab/macos_installation
Browse files Browse the repository at this point in the history
Installation instructions for MacOS Silicon
  • Loading branch information
bio-la authored Mar 26, 2024
2 parents 1f92896 + 87628ef commit 8bed4fc
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
We recommend running panpipes within a virtual environment to prevent conflicts.

### Option 1: create conda environment (Recommended)
>Note: For installation instructions on Apple machines with M chips, scroll down.
To Run panpipes, we install it in a conda environment with R and python.
Panpipes has a lot of dependencies, so you may want to consider the faster [`mamba`](https://mamba.readthedocs.io/en/latest/index.html) instead of `conda` for installation.
Expand Down Expand Up @@ -71,6 +72,49 @@ or
apt-get install time
```

#### Installation on Apple Silicon M chips
If you intend to install panpipes via conda on a macOS machine with M-Chip, you might face issues when installing or using certain workflows of panpipes.
This is because panpipes relies on [scvi-tools], which currently only supports execution on Apple Silicon machines when installed using a native Python version (owing to a dependency on JAX).

Follow these steps to install pertpy on an Apple Silicon machine:

1. Install [Homebrew](https://brew.sh/)

2. Install Apple Silicon version of Mambaforge (If you already have Anaconda/Miniconda installed, make sure
having both mamba and conda won't cause conflicts). Additionally, we need clang which is included in llvm, so we install that as well.

```bash
brew install --cask mambaforge
brew install llvm
```

3. Create a new environment using mamba (here with python 3.10) and activate it

```bash
conda config --add channels conda-forge
conda config --set channel_priority strict
# you should remove the strict priority afterwards!
mamba search r-base
mamba create --name pipeline_env
mamba activate pipeline_env
```

4. Add the osx-64 channel to the environment, then install Python and R
Because not all R packages are available via the ARM64 channel, we need to specify the osx-64 channel to install all required R packages.

```bash
conda config --env --set subdir osx-64
mamba install python=3.10 r-base=4.3.0
```

5. Install dependencies

```bash
conda install -c conda-forge r-tidyverse r-optparse r-ggforce r-ggraph r-xtable r-hdf5r r-clustree r-cowplot
pip install panpipes
```


### Option 2: python venv environment

Navigate to where you want to create your virtual environment and follow the steps below to create a pip virtual environment.
Expand Down

0 comments on commit 8bed4fc

Please sign in to comment.