Skip to content

Commit

Permalink
bunch of additions and edits for the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
schlegelp committed Aug 27, 2024
1 parent f72d777 commit 5f8fc3b
Show file tree
Hide file tree
Showing 11 changed files with 273 additions and 15 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# neuropython2024
Documentation and Material for the 2024 NeuroPython Workshop
Please visit the [Documentation](https://navis-org.github.io/neuropython2024/) for details.


77 changes: 77 additions & 0 deletions docs/cajal/cajal_setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Installing CAJAL

## Prerequisites
Windows, MacOS, and Linux should all work.

To use `CAJAL`, you must have Python installed. CAJAL is 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`.

It is possible to install `CAJAL` either via pip or from source. `CAJAL` is not available as a conda package, but one can install `CAJAL` in a conda environment using a conda-managed version of `pip`.

We strongly recommend using `pip` to install precompiled wheels from the Python Packaging Index, PyPI.

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.

## Requirements
In addition to `CAJAL`, we will use the following tools in the workshop in conjunction with `CAJAL`
- Jupyter, an interactive environment for evaluating Python code and plotting graphs
- Scanpy, a Python package for the analysis of single-cell gene expression data
- Navis, a neuron visualization package
- umap-learn, which is useful for visualizing the clustering structure of high-dimensional data
- Pandas, a dataframe library for manipulating and filtering tabular data

## 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 cajal scanpy navis umap-learn pandas
```
## Conda
Conda is a package manager commonly used in data science and bioinformatics. We do not provide a conda package for CAJAL; these instructions discuss how to use conda to call 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 scanpy umap-learn pandas pip
```

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

## From source
To build CAJAL from the source on Github, some dependencies are required.
- You need a C++ compiler. On Windows, we recommend Microsoft Visual C++ 14.0 or greater, which can be installed via the [Microsoft C++ Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/). On Linux, you can use g++.
- You should ensure that all necessary header files for compiling C plugins for Python are visible to the C++ compiler. On Ubuntu, this may require the package python3.x-dev; on Windows you should modify the installation of Visual Studio installer as follows:
Open "Visual Studio Installer." Select "Modify". Select "Workloads". Check the "Python Development" box. On the right, check "Python native development tools"

Once these dependencies are installed, you should create and activate a virtual environment, following the instructions as for Pip or Conda above. Then run:
```
python3 -m pip install git+https://github.com/CamaraLab/CAJAL.git
```
and install the other workshop requirements as mentioned above.
25 changes: 13 additions & 12 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
# Welcome to MkDocs
# :material-language-python: NeuroPython 2024

For full documentation visit [mkdocs.org](https://www.mkdocs.org).
Welcome to NeuroPython 2024, _Analysis and Integration of Single-Cell Neuronal Data in Python_ :wave:

## Commands
This is free two-day workshop introducing computational workflows for the analysis and integration of electrophysiological, morphological, and transcriptomic data of neurons using Python. We will cover the packages [`Pynapple`](https://github.com/pynapple-org/pynapple), [`NeMoS`](https://github.com/flatironinstitute/nemos), [`Navis`](https://github.com/navis-org/navis), and [`CAJAL`](https://github.com/CamaraLab/CAJAL), providing a hands-on experience with these tools using public Patch-clamp and Patch-seq datasets.

* `mkdocs new [dir-name]` - Create a new project.
* `mkdocs serve` - Start the live-reloading docs server.
* `mkdocs build` - Build the documentation site.
* `mkdocs -h` - Print help message and exit.
## :fontawesome-solid-location-dot: Where?
Online! We'll share a Zoom link ahead of the workshop.

## Project layout
## :calendar: When?
September 23rd-24th. It's two half days to make sure people in both US and Europe can attend. Please see the [Schedule](schedule.md) for details.

mkdocs.yml # The configuration file.
docs/
index.md # The documentation homepage.
... # Other markdown pages, images and other files.
## :star_struck: Interested?
Registration is still open via [Google Forms](https://forms.gle/twx3ne3HHoV48eMS8).

## :rocket: Already signed up?

Great! Then head over to [Preparations](preparing.md) to learn about what you need to do _before_ the workshop to set things up.
1 change: 1 addition & 0 deletions docs/navis/exercises.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Exercises
87 changes: 87 additions & 0 deletions docs/navis/navis_setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Installing Navis

To follow along during the workshop you will need `Navis` and [Jupyter](https://jupyter.org/) lab or notebook.

You have effectively two options:

## Option 1: Using Google Collaboratory

The hassle-free option is where you use Google's [Collaboratory](https://colab.research.google.com/). That way everything runs on Google's Cloud platform and you don't have to worry about a thing.

Try it out! Clicking on this badge will open a test notebook - simply follow the instructions: [![demo](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/navis-org/neuropython2024/blob/main/material/navis/navis_on_colab.ipynb)

The downside of `Colab` is that the environment is not persistent - i.e. you will have to re-install `Navis` (and other packages) every time you start a
new notebook.

In the long run, you might want to check out Option 2 but for this workshop you should be just fine with this setup.

## Option 2: Installing Navis on your own machine

`Navis` is published as a [Python package] and can be installed with `pip`, ideally by using a [virtual environment]. Open up a terminal and install
`Navis` with:

=== "Full Install"

The full install should set you up for using `Navis` plus a number of
extra dependencies that are just nice to have. If
you run into issues, try the minimal install
instead.

``` sh
pip install navis[all] -U
```


=== "Minimal"

If you're running into issues with the full install, you can try
the minimal install instead:

``` sh
pip install navis -U
```

=== "Dev"

To install the latest version from Github:

``` sh
pip install git+https://github.com/navis-org/navis@master
```

!!! tip

MacOS (both Intel and the new ARM chips) and Linux should work off the bat without any problems.
On Windows, you might run into issues with some of the dependencies. If that happens, we recommend you check
out the [Windows Subsystem for Linux](https://learn.microsoft.com/en-us/windows/wsl/install) (WSL).


Don't forget to all install Jupyter lab/notebook!

## What next?

<div class="grid cards" markdown>

- :material-cube:{ .lg .middle } __Documentation__

---

You're welcome to hop over to `Navis`' documentation and have a browse :nerd:

[:octicons-arrow-right-24: Documentation](https://navis.readthedocs.io/en/latest/)

- :material-eye-arrow-right:{ .lg .middle } __Exercises__

---

Check out the exercises!

[:octicons-arrow-right-24: The Basics](navis/exercises.md)

</div>


[Python package]: https://pypi.org/project/navis/
[virtual environment]: https://realpython.com/what-is-pip/#using-pip-in-a-python-virtual-environment
[Markdown]: https://python-markdown.github.io/
[Using Python's pip to Manage Your Projects' Dependencies]: https://realpython.com/what-is-pip/
1 change: 1 addition & 0 deletions docs/nemos/nemos_setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Installing NeMos
53 changes: 53 additions & 0 deletions docs/preparing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# :fontawesome-solid-computer: Preparations

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.

You are welcome to just cruise :sailboat: along but to make the most of it you will probably want to follow the coding and participate in the exercises on your own machine.

In general, we expect you to have at least basic familiarty with Python including the standard data science libraries such as [`numpy`](https://numpy.org/doc/stable/index.html) and
[`pandas`](https://pandas.pydata.org/).

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:


<div class="grid cards" markdown>

- :material-format-font:{ .lg .middle } __Pynapple__

---

[Pynapple](https://github.com/pynapple-org/pynapple) is a light-weight python library for neurophysiological data analysis.

[:octicons-arrow-right-24: Install instructions](pynapple/pynapple_setup.md)

- :material-cube:{ .lg .middle } __NeMoS__

---

[NeMoS](https://github.com/flatironinstitute/nemos) (Neural ModelS) is a statistical modeling framework optimized for systems neuroscience and powered by JAX.

[:octicons-arrow-right-24: Install instructions](nemos/nemos_setup.md)

- :material-eye-arrow-right:{ .lg .middle } __CAJAL__

---

[CAJAL](https://github.com/CamaraLab/CAJAL) is a Python library for multi-modal cell morphology analyses using Gromov-Wasserstein (GW) distance.

[:octicons-arrow-right-24: Install instructions](cajal/cajal_setup.md)

- :material-camera-control: __Navis__

---

[Navis](https://github.com/navis-org/navis) is a package for **N**euron **A**nalysis and **Vis**ualization.

[:octicons-arrow-right-24: Install instructions](navis/navis_setup.md)


</div>



1 change: 1 addition & 0 deletions docs/pynapple/pynapple_setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Installing Pynapple
26 changes: 26 additions & 0 deletions docs/schedule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Schedule

The schedule is split over two days and centered around noon on the US east coast to allow people from both US west and Europe to attend:


| Day 1 (09/23) | |
|--------------------|------------------------------------------|
| 10:50am - 11:00am | **Welcome and Introduction to Day 1** |
| 11:00am - 1:00pm | **Analysis of Electrophysiological Data using Pynapple and NeMos** _Instructors: Edoardo Balzani (Flatiron), Adrien Peyrache (McGill), Guillaume Viejo (Flatiron), Alex Williams (NYU)_ |
| 1:00pm - 1:30pm | **Break** |
| 1:30pm - 3:30pm | **Analysis and Visualization of Neuronal Morphologies using Navis** _Instructor: Philipp Schlegel (Cambridge U.)_ |
| | Add to calendar: [Google Calendar](https://calendar.google.com/calendar/render?action=TEMPLATE&dates=20240925T144500Z%2F20240925T183000Z&details=&location=Online&text=NeuroPython%202024)[Outlook](https://outlook.live.com/calendar/0/action/compose?allday=false&body=&enddt=2024-09-25T19%3A30%3A00&location=Online&path=%2Fcalendar%2Faction%2Fcompose&rru=addevent&startdt=2024-09-25T15%3A45%3A00&subject=NeuroPython%202024)[Office 365](https://outlook.office.com/calendar/0/action/compose?allday=false&body=&enddt=2024-09-25T19%3A30%3A00&location=Online&path=%2Fcalendar%2Faction%2Fcompose&rru=addevent&startdt=2024-09-25T15%3A45%3A00&subject=NeuroPython%202024) |
| | |
| **Day 2 (09/23)** | |
| 10:50am - 11:00am | **Welcome and Introduction to Day 2** |
| 11:00am - 1:00pm | **Analysis and Integration of Single-Cell Morphology, Electrophysiology, and Transcriptomic Data using CAJAL** _Instructors: Pablo Camara (UPenn), Patrick Nicodemus (UPenn)_ |
| 1:00pm - 1:30pm | **Break** |
| 1:30pm - 2:30pm | **Open Discussion** |
| | Add to calendar: [Google Calendar](https://calendar.google.com/calendar/render?action=TEMPLATE&dates=20240924T144500Z%2F20240924T183000Z&details=&location=Online&text=NeuroPython%202024)[Outlook](https://outlook.live.com/calendar/0/action/compose?allday=false&body=&enddt=2024-09-24T19%3A30%3A00&location=Online&path=%2Fcalendar%2Faction%2Fcompose&rru=addevent&startdt=2024-09-24T15%3A45%3A00&subject=NeuroPython%202024)[Office 365](https://outlook.office.com/calendar/0/action/compose?allday=false&body=&enddt=2024-09-24T19%3A30%3A00&location=Online&path=%2Fcalendar%2Faction%2Fcompose&rru=addevent&startdt=2024-09-24T15%3A45%3A00&subject=NeuroPython%202024) |


_All times are in EDT (Eastern Daylight Time), i.e. time in New York or Washington DC!_

Zoom links will be shared ahead of the workshop.


2 changes: 1 addition & 1 deletion material/navis/navis_on_colab.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"outputs": [],
"source": [
"# First we need to install the navis package\n",
"!pip install navis -U"
"!pip install navis[all] -U"
]
},
{
Expand Down
11 changes: 10 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
site_name: NeuroPython workshop 2024
site_name: NeuroPython Workshop 2024
site_url: https://navis-org.github.io/neuropython2024/
site_description: Documentation and Materials for the NeuroPython workshop 2024
# strict: true
Expand All @@ -9,6 +9,15 @@ edit_uri: edit/main/docs/

nav:
- Home: index.md
- Schedule: schedule.md
- Preparation:
- preparing.md
- NeMos: nemos/nemos_setup.md
- Pynapple: pynapple/pynapple_setup.md
- CAJAL: cajal/cajal_setup.md
- Navis: navis/navis_setup.md



theme:
name: "material"
Expand Down

0 comments on commit 5f8fc3b

Please sign in to comment.