Skip to content

Commit

Permalink
Merge pull request #38 from yuqiyuqitan/mgbckr-patch-1
Browse files Browse the repository at this point in the history
Fix for setup on Apple M1/M2 silicon
  • Loading branch information
mgbckr authored Jul 6, 2024
2 parents 55018cf + ce179f4 commit c198080
Showing 1 changed file with 78 additions and 8 deletions.
86 changes: 78 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,88 @@ We generally recommend to use a `conda` environment. It makes installing require

### Install

<details><summary>Linux</summary>

```bash
# setup `conda` repository
conda create -n spacec
conda activate spacec

# install Python
conda install python==3.9

# install `graphviz`
conda install graphviz

# install 'libvips'; Mac and Linux specific
conda install -c conda-forge libvips pyvips openslide-python

# install `SPACEc` from pypi
pip install spacec
```

* ⚠️ **IMPORTANT**: always import `spacec` first before importing any other packages
* **Example tonsil data** on [dryad](https://datadryad.org/stash/share/OXTHu8fAybiINGD1S3tIVUIcUiG4nOsjjeWmrvJV-dQ)

</details>


<details><summary>Apple M1/M2</summary>

```bash
# setup `conda` repository
conda create -n spacec python==3.9
conda create -n spacec
conda activate spacec

# set environment; Apple specific
conda config --env --set subdir osx-64

# install Python
conda install python==3.9

# install `graphviz`
conda install graphviz

# install 'libvips' - only on Mac and Linux
# install 'libvips'; Mac and Linux specific
conda install -c conda-forge libvips pyvips openslide-python

# requirements not automatically installed otherwise; Apple specific
pip install numpy==1.26.4 werkzeug==2.3.8

# install `SPACEc` from pypi
pip install spacec

# install `SPACEc` from cloned repo
#pip install -e .
# reinstall tensorflow; Apple specific
conda install tensorflow=2.10.0
```

* ⚠️ **IMPORTANT**: always import `spacec` first before importing any other packages
* **Example tonsil data** on [dryad](https://datadryad.org/stash/share/OXTHu8fAybiINGD1S3tIVUIcUiG4nOsjjeWmrvJV-dQ)

</details>

<details><summary>Windows</summary>

```bash
# setup `conda` repository
conda create -n spacec
conda activate spacec

# install Python
conda install python==3.9

# install `graphviz`
conda install graphviz

# on Apple M1/M2
# conda install tensorflow=2.10.0
# and always import spacec first before importing other packages
# install `SPACEc` from pypi
pip install spacec
```

Example tonsil data on [dryad](https://datadryad.org/stash/share/OXTHu8fAybiINGD1S3tIVUIcUiG4nOsjjeWmrvJV-dQ)
* ⚠️ **IMPORTANT**: always import `spacec` first before importing any other packages
* **Example tonsil data** on [dryad](https://datadryad.org/stash/share/OXTHu8fAybiINGD1S3tIVUIcUiG4nOsjjeWmrvJV-dQ)

</details>


### Docker
If you run into an installation issue or want to run SPACEc in a containerized environment, we have created a Docker image for you to use SPACEc so that you don't have to install manually. You can find the SPACEc Docker image here: https://hub.docker.com/r/tkempchen/spacec
Expand Down Expand Up @@ -90,6 +149,17 @@ pip install torch_geometric
pip install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-2.3.0+cu121.html
```

### Run tests.

```bash
pip install pytest pytest-cov

# Note: before you run `pytest` you might have to deactivate and activate the conda environment first
# conda deactivate; conda activate spacec

pytest
```

## General outline of SPACEc analysis

![SPACEc](https://raw.githubusercontent.com/yuqiyuqitan/SPACEc/master/docs/overview.png)

0 comments on commit c198080

Please sign in to comment.