Skip to content

Commit

Permalink
Moved installation instructions into preparing.md
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick-nicodemus committed Sep 9, 2024
1 parent 163d2ce commit 20b7bbc
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 89 deletions.
86 changes: 0 additions & 86 deletions Installation.md

This file was deleted.

68 changes: 65 additions & 3 deletions docs/preparing.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# :fontawesome-solid-computer: Preparations

## Setup Python
## Setting up Python

The workshop will consist of a mix of introductory talks for the individual Python packages and a number of interactive coding sessions - see the [Schedule](schedule.md) for details.

Expand All @@ -11,8 +11,24 @@ In general, we expect you to have at least basic familiarty with Python includin

Most of the workshop will be using [Jupyter](https://jupyter.org/) for interactive data analysis. Please see their website for install instructions.

In addition, we have prepared setup instructions for the four different Python packages we will be covering:
## Prerequisites
Windows, MacOS, and Linux should all work.

The tutorials are compatible with Python version >= 3.9. You should have a current version of pip (>= 23) and setuptools (>= 68)

We will use the command `python3` to invoke Python on Linux, but on Windows the appropriate command may be `python`. You should find out what the appropriate command is for Python on your system.

Both pip and setuptools can be updated using pip itself with `python3 -m pip install --upgrade pip setuptools`.

In the tutorials, we use some software which is available from PyPI but is not available as a conda package. If you prefer to use conda, you will have to install some things in a conda environment
using a conda-managed version of pip.

In order to avoid dependency conflicts with other Python packages on your device,
including packages managed by the system package manager rather than pip or conda, you should create a virtual environment to install
all Python packages that will be used in the workshop. Start by navigating to the directory in which you plan to work, and follow the instructions appropriate for your package manager.

## Dependencies
The workshop will focus on four main packages.

<div class="grid cards" markdown>

Expand Down Expand Up @@ -51,7 +67,53 @@ In addition, we have prepared setup instructions for the four different Python p

</div>


In addition to these core tools, we will rely on some other software:
- Scanpy, a Python package for the analysis of single-cell gene expression data
- Jupyter, an interactive environment for evaluating Python code and plotting graphs
- ipywidgets, which extends the functionality of Jupyter (e.g., progress bars)
- leidenalg, an implementation of the Leiden clustering algorithm
- umap-learn, which is useful for visualizing the clustering structure of high-dimensional data
- Pandas, a dataframe library for manipulating and filtering tabular data
- Plotly, a rich visualization library

## Installing dependencies with Pip
Pip is the standard package manager for Python.

```
python3 -m venv ./neuro_workshop
```

After creating the virtual environment, you should activate it, which sets certain environment variables and path variables to
ensure that Python commands and modules refer to code in the ./neuro_workshop folder. In Windows Powershell, the command is `.\neuro_workshop\Scripts\activate.ps1`.
In Linux, the command is `source ./neuro_workshop/bin/activate`. The section "How venvs work" of the [Python venv documentation](https://docs.python.org/3/library/venv.html)
contains a table containing the appropriate command indexed by operating system and shell. You can deactivate the virtual environment with the command `deactivate`.

Before running the command, please check the left hand side of your terminal prompt to ensure that the virtual environment is activated.
```
python3 -m pip install jupyterlab ipywidgets cajal scanpy leidenalg navis umap-learn pandas plotly pynapple nemos matplotlib requests
```
## Installing dependencies with Conda
Conda is a package manager commonly used in data science and bioinformatics. We do not provide a conda package for our tools; these instructions discuss how to use conda to create a sandbox for pip.
Instructions for workin with virtual environments in conda can be found [here](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html).
You can open a conda terminal from the Windows start menu by launching the program "Anaconda Powershell Prompt."

Create and activate a virtual environment with
```
conda create --prefix ./neuro_workshop python=3.11
conda activate ./neuro_workshop
```

Install dependencies as follows:
```
conda config --append channels conda-forge
conda install numpy scipy jupyterlab ipywidgets scanpy leidenalg umap-learn pandas plotly
```

Now run
```
pip install cajal navis pynnapple nemos
```
and pip should install the relevant dependencies into the ./neuro_workshop directory you have just created.

## Download the Data

Expand Down

0 comments on commit 20b7bbc

Please sign in to comment.