Metadata-Version: 2.1
Name: MiniAn
Version: 0.2.5
Summary: MiniAn is an analysis pipeline and visualization tool inspired by both CaImAn and MIN1PIPE package specifically for Miniscope data.
Home-page: https://github.com/DeniseCaiLab/minian
Author: Denise Cai
Author-email: denisecai@gmail.com
License: UNKNOWN
Project-URL: Documentation, https://github.com/DeniseCaiLab/minian
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Requires-Dist: alabaster (==0.7.12)
Requires-Dist: ansiwrap (==0.8.4)
Requires-Dist: appdirs (==1.4.3)
Requires-Dist: argon2-cffi (==20.1.0)
Requires-Dist: asciitree (==0.3.3)
Requires-Dist: async-generator (==1.10)
Requires-Dist: attrs (==20.1.0)
Requires-Dist: av (==7.0.1)
Requires-Dist: Babel (==2.8.0)
Requires-Dist: backcall (==0.2.0)
Requires-Dist: backports.functools-lru-cache (==1.6.1)
Requires-Dist: black (==19.10b0)
Requires-Dist: bleach (==3.1.5)
Requires-Dist: bokeh (==1.4.0)
Requires-Dist: Bottleneck (==1.3.2)
Requires-Dist: brotlipy (==0.7.0)
Requires-Dist: certifi (==2020.6.20)
Requires-Dist: cffi (==1.14.1)
Requires-Dist: cftime (==1.2.1)
Requires-Dist: chardet (==3.0.4)
Requires-Dist: click (==7.1.2)
Requires-Dist: cloudpickle (==1.6.0)
Requires-Dist: colorcet (==2.0.1)
Requires-Dist: coverage (==5.2.1)
Requires-Dist: cryptography (==3.1)
Requires-Dist: cvxpy (==1.0.27)
Requires-Dist: cycler (==0.10.0)
Requires-Dist: cytoolz (==0.10.1)
Requires-Dist: dask (==2.11.0)
Requires-Dist: datashader (==0.9)
Requires-Dist: datashape (==0.5.2)
Requires-Dist: decorator (==4.4.2)
Requires-Dist: defusedxml (==0.6.0)
Requires-Dist: dill (==0.3.2)
Requires-Dist: distributed (==2.11.0)
Requires-Dist: docutils (==0.16)
Requires-Dist: ecos (==2.0.7.post1)
Requires-Dist: entrypoints (==0.3)
Requires-Dist: fastcache (==1.1.0)
Requires-Dist: fasteners (==0.14.1)
Requires-Dist: ffmpeg-python (==0.2.0)
Requires-Dist: fsspec (==0.8.0)
Requires-Dist: future (==0.18.2)
Requires-Dist: HeapDict (==1.0.1)
Requires-Dist: holoviews (==1.12.7)
Requires-Dist: idna (==2.10)
Requires-Dist: imagecodecs-lite (==2019.12.3)
Requires-Dist: imageio (==2.9.0)
Requires-Dist: imagesize (==1.2.0)
Requires-Dist: importlib-metadata (==1.7.0)
Requires-Dist: iniconfig (==1.0.1)
Requires-Dist: ipykernel (==5.3.4)
Requires-Dist: ipython (==7.12.0)
Requires-Dist: ipython-genutils (==0.2.0)
Requires-Dist: ipywidgets (==7.5.1)
Requires-Dist: jedi (==0.17.2)
Requires-Dist: Jinja2 (==2.11.2)
Requires-Dist: joblib (==0.16.0)
Requires-Dist: jsonschema (==3.2.0)
Requires-Dist: jupyter-client (==6.1.7)
Requires-Dist: jupyter-console (==6.2.0)
Requires-Dist: jupyter-core (==4.6.3)
Requires-Dist: kiwisolver (==1.2.0)
Requires-Dist: llvmlite (==0.31.0)
Requires-Dist: locket (==0.2.0)
Requires-Dist: Markdown (==3.2.2)
Requires-Dist: MarkupSafe (==1.1.1)
Requires-Dist: matplotlib (==3.1.3)
Requires-Dist: mistune (==0.8.4)
Requires-Dist: monotonic (==1.5)
Requires-Dist: more-itertools (==8.5.0)
Requires-Dist: msgpack (==1.0.0)
Requires-Dist: multipledispatch (==0.6.0)
Requires-Dist: multiprocess (==0.70.10)
Requires-Dist: natsort (==7.0.1)
Requires-Dist: nbclient (==0.5.0)
Requires-Dist: nbconvert (==5.6.1)
Requires-Dist: nbformat (==5.0.7)
Requires-Dist: nest-asyncio (==1.4.0)
Requires-Dist: netCDF4 (==1.5.3)
Requires-Dist: networkx (==2.4)
Requires-Dist: notebook (==6.1.3)
Requires-Dist: numba (==0.48.0)
Requires-Dist: numcodecs (==0.6.4)
Requires-Dist: numpy (==1.18.1)
Requires-Dist: olefile (==0.46)
Requires-Dist: opencv-python (==4.2.0.34)
Requires-Dist: osqp (==0.6.1)
Requires-Dist: packaging (==20.4)
Requires-Dist: pandas (==1.0.1)
Requires-Dist: pandocfilters (==1.4.2)
Requires-Dist: panel (==0.8.0)
Requires-Dist: papermill (==2.0.0)
Requires-Dist: param (==1.9.3)
Requires-Dist: parso (==0.7.1)
Requires-Dist: partd (==1.1.0)
Requires-Dist: pathspec (==0.8.0)
Requires-Dist: patsy (==0.5.1)
Requires-Dist: pexpect (==4.8.0)
Requires-Dist: pickleshare (==0.7.5)
Requires-Dist: Pillow (==7.2.0)
Requires-Dist: pluggy (==0.13.1)
Requires-Dist: prometheus-client (==0.8.0)
Requires-Dist: prompt-toolkit (==3.0.7)
Requires-Dist: psutil (==5.7.2)
Requires-Dist: ptyprocess (==0.6.0)
Requires-Dist: py (==1.9.0)
Requires-Dist: pycparser (==2.20)
Requires-Dist: pyct (==0.4.6)
Requires-Dist: pyFFTW (==0.12.0)
Requires-Dist: Pygments (==2.6.1)
Requires-Dist: pyOpenSSL (==19.1.0)
Requires-Dist: pyparsing (==2.4.7)
Requires-Dist: PyQt5 (==5.12.3)
Requires-Dist: PyQt5-sip (==4.19.18)
Requires-Dist: PyQtChart (==5.12)
Requires-Dist: PyQtWebEngine (==5.12.1)
Requires-Dist: pyrsistent (==0.16.0)
Requires-Dist: PySocks (==1.7.1)
Requires-Dist: pytest (==5.4.3)
Requires-Dist: pytest-cov (==2.9.0)
Requires-Dist: python-dateutil (==2.8.1)
Requires-Dist: pytz (==2020.1)
Requires-Dist: pyviz-comms (==0.7.6)
Requires-Dist: PyWavelets (==1.1.1)
Requires-Dist: PyYAML (==5.3.1)
Requires-Dist: pyzmq (==19.0.2)
Requires-Dist: qtconsole (==4.7.7)
Requires-Dist: QtPy (==1.9.0)
Requires-Dist: regex (==2020.7.14)
Requires-Dist: requests (==2.24.0)
Requires-Dist: scikit-image (==0.16.2)
Requires-Dist: scikit-learn (==0.22.1)
Requires-Dist: scipy (==1.4.1)
Requires-Dist: scs (==2.1.1.post2)
Requires-Dist: Send2Trash (==1.5.0)
Requires-Dist: SimpleITK (==1.2.4)
Requires-Dist: six (==1.15.0)
Requires-Dist: sk-video (==1.1.10)
Requires-Dist: snowballstemmer (==2.0.0)
Requires-Dist: sortedcontainers (==2.2.2)
Requires-Dist: statsmodels (==0.11.1)
Requires-Dist: tblib (==1.6.0)
Requires-Dist: tenacity (==6.2.0)
Requires-Dist: terminado (==0.8.3)
Requires-Dist: testpath (==0.4.4)
Requires-Dist: textwrap3 (==0.9.2)
Requires-Dist: tifffile (==2020.2.16)
Requires-Dist: toml (==0.10.1)
Requires-Dist: toolz (==0.10.0)
Requires-Dist: tornado (==6.0.4)
Requires-Dist: tqdm (==4.43.0)
Requires-Dist: traitlets (==4.3.3)
Requires-Dist: typed-ast (==1.4.1)
Requires-Dist: urllib3 (==1.25.10)
Requires-Dist: wcwidth (==0.2.5)
Requires-Dist: webencodings (==0.5.1)
Requires-Dist: wheel
Requires-Dist: widgetsnbextension (==3.5.1)
Requires-Dist: xarray (==0.15.0)
Requires-Dist: zarr (==2.4.0)
Requires-Dist: zict (==2.0.0)
Requires-Dist: zipp (==3.1.0)

[![Build Status](https://img.shields.io/travis/DeniseCaiLab/minian/master.svg?style=flat&label=master%20build)](https://travis-ci.org/DeniseCaiLab/minian)
[![codecov](https://codecov.io/gh/DeniseCaiLab/minian/branch/master/graph/badge.svg)](https://codecov.io/gh/DeniseCaiLab/minian)
&emsp;&emsp;
[![Build Status](https://img.shields.io/travis/DeniseCaiLab/minian/dev.svg?style=flat&label=dev%20build)](https://travis-ci.org/DeniseCaiLab/minian)
[![codecov](https://codecov.io/gh/DeniseCaiLab/minian/branch/dev/graph/badge.svg)](https://codecov.io/gh/DeniseCaiLab/minian)

# About MiniAn

MiniAn is an analysis pipeline and visualization tool inspired by both [CaImAn](https://github.com/flatironinstitute/CaImAn) and [MIN1PIPE](https://github.com/JinghaoLu/MIN1PIPE) package specifically for [Miniscope](http://miniscope.org/index.php/Main_Page) data.

# Quick Start Guide

## Option #2: virtual env
1. Create a python virtual env: `python3 -m venv venv`
1. Activate the virtual enviornment you created during minian installation: `source venv/bin/activate`
1. For Linux:
    1. Install ffmpeg, for debian based systems: `sudo apt install ffmpeg` see also: [ffmpeg](https://ffmpeg.org/download.html#build-linux)
    1. Install required files for AV: `sudo apt install libavformat-dev libavdevice-dev`
1. For Mac OSx:
    1. brew install libvpx
    1. brew install ffmpeg --with-libvpx
    1. brew install libav
1. Install the MiniAn package: `pip install MiniAn`
1. Install the pipeline notebooks: `minian-install-pipeline`
1. Optional install the demo movies: `minian-install-demo`
1. Fire up jupyter: `jupyter notebook` and open the notebook "pipeline_noted.ipynb"

# Quick Start Guide for build and use from source

## Option #1: conda
1. Download and install [conda](https://conda.io/projects/conda/en/latest/).
1. Make sure your conda is up to date: `conda update -n base -c default conda`
1. Download the MiniAn package: `git clone https://github.com/DeniseCaiLab/minian.git`
1. Go into MiniAn folder you just cloned: `cd minian/`
1. Create an conda environment: `conda env create -n minian -f environment.yml`
1. Activate the conda enviornment you created during minian installation: `conda activate minian`
1. Fire up jupyter: `jupyter notebook` and open the notebook "pipeline_noted.ipynb"

## Option #2: virtual env
1. Download the MiniAn package: `git clone https://github.com/DeniseCaiLab/minian.git`
1. Go into MiniAn folder you just cloned: `cd minian/`
1. Create a python virtual env: `python3 -m venv minian`
1. Activate the virtual enviornment you created during minian installation: `source minian/bin/activate`
1. Install the dependencies: `pip install -r requirements.txt`
1. Install ffmpeg, for debian based systems: `sudo apt install ffmpeg`
1. Install required files for AV: `sudo apt install libavformat-dev libavdevice-dev`
1. Fire up jupyter: `jupyter notebook` and open the notebook "pipeline_noted.ipynb"

## Option #3: docker
1. Download and install [docker](https://docs.docker.com/install/).
1. Read the notes below first then run: `docker run -p 8888:8888 -v MY_DATA_PATH:/media denisecailab/minian:latest`
1. Once you read the following, open a browser and navigate to `localhost:8888`:

> The Jupyter Notebook is running at:  
http://<server/ip>:8888  
Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).

Note: this approach runs everything in a more isolated docker container, which makes customizing/extending the code harder and may affect performance. It is recommended to use this approach only when you encounter errors during installation or running demo data with the first conda option, in which case it is highly recommended to submit an [issue](https://github.com/DeniseCaiLab/minian/issues) first as well.

As a result of isolation, you have to explicitly expose resources from within the container to your machine. In our case we want to expose two things: the network port that jupyter is listening to and a file system shared across your machine and the container. The `-p 8888:8888` argument in the docker command expose port 8888 from within the container to port 8888 on your machine. If you prefer another port, for example in case another jupyter application is already running and occupies port 8888, change the number after the colon. The `-v MY_DATA_PATH:/media` argument creates a bind mount from `MY_DATA_PATH` on your machine to `/media` within the container, so that files under this two paths are synced and act as one, and you can refer to anything under `MY_DATA_PATH` by substituting that with `/media` from the notebook within the container. See [here](https://docs.docker.com/storage/bind-mounts/) for more details and change the path to suit your needs.

As a final note, everything within the container **does not persist** across sessions except those in the bind mount, which means all the modifications you made to the default notebook under `/minian` will be reset to the state in the original image. Thus it is advised to keep a working copy of minian on your local machine and mount them in the container if you are using this in production mode.

# Generate documentation

To generate documentation MiniAn uses Sphinx with the Read The Docs theme. All docstrings are in the Google docstring format see [docstring format](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html)

To generate the documentation please execute these commands:
```
pip install -r requirements/requirements-doc.txt
cd docs
make html
```

After the process finishes the documentation files are in the build folder

# Packaging for Conda (Forge) and PyPi

## Create/tag a new release

Merge all branches for the release into master, make sure you are on the master branch `git checkout master`
Run the create_release script `./bin/create_release.sh` with the new version number e.g. `./bin/create_release.sh 0.1.0`
The script will do some checks on the Git repo, creates a new tag and updates the VERSION file with the new release number

## Conda (Forge)

First add the conda-forge channel to your config: `conda config --add channels conda-forge`
Install conda build: `conda install conda-build`
To create and upload the MiniAn package to Conda Forge install Conda Smithy: `conda install -y conda-smithy`
Then build the package `conda-build recipes/minian`

## PyPi

Create the dist build from the MiniAn source: `python3 setup.py sdist bdist_wheel`
Install Twine: `pip install --upgrade twine`
Upload the dist to PyPi: `python3 -m twine upload dist/*`

for testing purpose you can upload to the PyPi test repo: `python3 -m twine upload --repository testpypi dist/*`
installing the test package: `python3 -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple minian`

see also: [packaging](https://packaging.python.org/tutorials/packaging-projects/)

# License

This project is licensed under GNU GPLv3.


