diff --git a/README.md b/README.md index b8532ed..e4d49a3 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ [![GitHub forks](https://img.shields.io/github/forks/MouseLand/rastermap?style=social)](https://github.com/MouseLand/rastermap/) -Rastermap is a discovery algorithm for neural data. The algorithm was written by Carsen Stringer and Marius Pachitariu. For support, please open an [issue](https://github.com/MouseLand/rastermap/issues). Please see install instructions [below](README.md/#Installation). If you use Rastermap in your work, please cite the [paper](https://www.biorxiv.org/content/10.1101/2023.07.25.550571v1): +Rastermap is a discovery algorithm for neural data. The algorithm was written by Carsen Stringer and Marius Pachitariu. For support, please open an [issue](https://github.com/MouseLand/rastermap/issues). Please see install instructions [below](README.md/#Installation). If you use Rastermap or analysis code in this repo in your work, please cite the [paper](https://www.biorxiv.org/content/10.1101/2023.07.25.550571v1): Stringer C., Zhong L., Syeda A., Du F., Kesa M., & Pachitariu M. (2023). Rastermap: a discovery method for neural population recordings. *bioRxiv* 2023.07.25.550571; doi: https://doi.org/10.1101/2023.07.25.550571 @@ -25,7 +25,7 @@ Rastermap runs in python 3.8+ and has a graphical user interface (GUI) for runni * [rastermap_interactive.ipynb](notebooks/rastermap_interactive.ipynb) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/MouseLand/rastermap/blob/main/notebooks/rastermap_interactive.ipynb) allows running Rastermap in an interactive way without a local installation * [tutorial.ipynb](notebooks/tutorial.ipynb) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/MouseLand/rastermap/blob/main/notebooks/tutorial.ipynb) is a guided tutorial for integrating rastermap and facemap to visualize behavioral representations. See the student/teacher versions [here](https://github.com/MouseLand/course-materials/tree/main/behavior_encoding). -All demo data available [here](https://osf.io/xn4cm/). +Also all notebooks to analyze the data and create the figures in the paper are [here](paper/). All data available [here](https://osf.io/xn4cm/). Here is what the output looks like for a segment of a mesoscope recording in a mouse during spontaneous activity (3.2Hz sampling rate), compared to random neural sorting: @@ -45,7 +45,7 @@ Linux, Windows and Mac OS are supported for running the code. For running the gr ### Instructions -Recommended to install an [Anaconda](https://www.anaconda.com/download/) distribution of Python -- Choose **Python 3.x** and your operating system. Note you might need to use an anaconda prompt (windows) if you did not add anaconda to the path. Open an anaconda prompt / command prompt with **python 3** in the path, then: +We recommend to install a [miniforge](https://github.com/conda-forge/miniforge) (conda-based) distribution of Python. Note you might need to use an anaconda prompt (windows) if you did not add anaconda to the path. Open an anaconda prompt / command prompt with **python 3** in the path, then: ~~~sh pip install rastermap @@ -59,13 +59,12 @@ pip install rastermap[gui] Rastermap has only a few dependencies so you may not need to make a special environment for it (e.g. it should work in a `suite2p` or `facemap` environment), but if the pip install above does not work, please follow these instructions: - -1. Open an anaconda prompt / command prompt with `conda` for **python 3** in the path. -2. Create a new environment with `conda create --name rastermap python=3.8`. Python 3.9 and 3.10 will likely work fine as well. + +1. Open an anaconda prompt / command prompt which has `conda` for **python 3** in the path +3. Create a new environment with `conda create --name rastermap python=3.9`. We recommend python 3.9, but python 3.8, 3.9 and 3.11 will also work. 4. To activate this new environment, run `conda activate rastermap` -5. To install the minimal version of rastermap, run `pip install rastermap`. -6. To install rastermap and the GUI, run `pip install rastermap[gui]`. If you're on a zsh server, you may need to use ' ' around the rastermap[gui] call: `pip install 'rastermap[gui]'`. - +5. (option 1) To install rastermap with the GUI, run `python -m pip install rastermap[gui]`. If you're on a zsh server, you may need to use ' ': `python -m pip install 'rastermap[gui]'`. +6. (option 2) To install rastermap without the GUI, run `python -m pip install rastermap`. To upgrade rastermap (package [here](https://pypi.org/project/rastermap/)), run the following in the environment: ~~~sh @@ -127,16 +126,14 @@ Short example code snippet for running rastermap: ``` import numpy as np import matplotlib.pyplot as plt -from rastermap import Rastermap, utils -from scipy.stats import zscore +from rastermap import Rastermap # spks is neurons by time spks = np.load("spks.npy").astype("float32") -spks = zscore(spks, axis=1) # fit rastermap model = Rastermap(n_PCs=200, n_clusters=100, - locality=0.75, time_lag_window=5).fit(spks, compute_X_embedding=True) + locality=0.75, time_lag_window=5).fit(spks) y = model.embedding # neurons x 1 isort = model.isort