Skip to content

Commit

Permalink
Merge pull request #2 from arayabrain/feature/fetch-upstream-main
Browse files Browse the repository at this point in the history
fetch upstream main
  • Loading branch information
ReiHashimoto committed Jun 22, 2023
2 parents b43414b + 2f9839c commit 6cfe6d8
Show file tree
Hide file tree
Showing 1,239 changed files with 1,748,161 additions and 91,518 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Python Linters
on:
pull_request:
paths-ignore:
- 'docs/**'
- 'notebooks/**'
- 'frontend/**'
- 'sample_data/**'

jobs:
flake8:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.8'
- run: python -m pip install flake8
- uses: liskin/gh-problem-matcher-wrap@d8afa2cfb66dd3f982b1950429e652bc14d0d7d2
with:
linters: flake8
run: flake8
isort:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.8'
- run: python -m pip install isort
- uses: liskin/gh-problem-matcher-wrap@d8afa2cfb66dd3f982b1950429e652bc14d0d7d2
with:
linters: isort
run: isort --check --diff optinist
black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: psf/black@stable
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ __pycache__
.ipynb_checkpoints
.vscode/*
!.vscode/settings.json
!.vscode/extensions.json
dist
/build
optinist/frontend
Expand Down
14 changes: 14 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

version: 2
build:
os: ubuntu-22.04
tools:
python: "3.11"
sphinx:
configuration: docs/conf.py
python:
install:
- requirements: docs/requirements.txt
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"ms-python.black-formatter",
"ms-python.flake8",
"ms-python.isort"
]
}
11 changes: 11 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,16 @@
"frontend/build/**": true,
"build/**": true
},
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
},
"python.linting.enabled": true,
"python.linting.lintOnSave": true,
"python.linting.pylintEnabled": false,
"python.linting.flake8Enabled": true,
"esbonio.sphinx.confDir": ""
}
19 changes: 4 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,12 @@
FROM python:3.9.7-slim
FROM --platform=linux/amd64 python:3.8.16-slim

COPY requirements.txt /app/requirements.txt

RUN apt-get --allow-releaseinfo-change update && \
apt-get install --no-install-recommends -y git gcc g++ libgl1 libgl1-mesa-dev && \
apt-get install --no-install-recommends -y gcc g++ libgl1 libgl1-mesa-dev && \
pip3 install --no-cache-dir --upgrade pip && \
pip3 install --no-cache-dir -r /app/requirements.txt && \
pip3 install --no-cache-dir \
cython==0.29.30 \
holoviews==1.14.9 \
ipyparallel==8.4.1 \
matplotlib==3.5.2 \
opencv-python==4.6.0.66 \
scikit-image==0.18.0 \
scikit-learn==1.1.1 \
tensorflow==2.9.1 && \
watershed==2.2.2 \
pip3 install --no-cache-dir git+https://github.com/flatironinstitute/CaImAn.git@914324989443fac5d481ef32aad4f327701294a8#egg=caiman && \
apt-get purge git -y && apt-get autoremove -y && apt-get clean && rm -rf /root/.cache/pip/*
apt-get clean && rm -rf /root/.cache/pip/*

RUN mkdir -p /root/miniconda3 && \
apt-get install --no-install-recommends -y wget && \
Expand All @@ -31,7 +20,7 @@ RUN mkdir -p /root/miniconda3 && \
conda clean -y --tarballs

COPY frontend/build /app/frontend/build
COPY studio /app/studio
COPY optinist /app/optinist
COPY main.py /app/main.py

ENV PATH $PATH:/root/miniconda3/bin
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile-test
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.9.7-slim
FROM --platform=linux/amd64 python:3.8.16-slim

COPY requirements.txt /app/requirements.txt

Expand Down
39 changes: 23 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,57 +2,64 @@
test_run:
docker-compose -f docker-compose.yml down --rmi all --volumes --remove-orphans
docker-compose -f docker-compose.yml rm -f
docker-compose -f docker-compose.yml build test_studio
docker-compose -f docker-compose.yml build test_studio_frontend
docker-compose -f docker-compose.yml run test_studio
docker-compose -f docker-compose.yml run test_studio_frontend
docker-compose -f docker-compose.yml build test_optinist
docker-compose -f docker-compose.yml build test_optinist_frontend
docker-compose -f docker-compose.yml run test_optinist
docker-compose -f docker-compose.yml run test_optinist_frontend

.PHONY: test_python
test_python:
docker-compose -f docker-compose.yml down --rmi all --volumes --remove-orphans
docker-compose -f docker-compose.yml rm -f
docker-compose -f docker-compose.yml build test_studio
docker-compose -f docker-compose.yml run test_studio
docker-compose -f docker-compose.yml build test_optinist
docker-compose -f docker-compose.yml run test_optinist

.PHONY: test_frontend
test_frontend:
docker-compose -f docker-compose.yml down --rmi all --volumes --remove-orphans
docker-compose -f docker-compose.yml rm -f
docker-compose -f docker-compose.yml build test_studio_frontend
docker-compose -f docker-compose.yml run test_studio_frontend
docker-compose -f docker-compose.yml build test_optinist_frontend
docker-compose -f docker-compose.yml run test_optinist_frontend

.PHONY: build_frontend
build_frontend:
docker-compose -f docker-compose.yml down --rmi all --volumes --remove-orphans
docker-compose -f docker-compose.yml rm -f
docker-compose -f docker-compose.yml build build_studio_frontend
docker-compose -f docker-compose.yml run build_studio_frontend
docker-compose -f docker-compose.yml build build_optinist_frontend
docker-compose -f docker-compose.yml run build_optinist_frontend

.PHONY: docs
docs:
rm -rf docs/_build/
# sphinx-apidoc -f -o ./docs/_build/modules ./studio
# sphinx-apidoc -f -o ./docs/_build/modules ./optinist
sphinx-autobuild -b html docs docs/_build --port 8001

.PHONY: dockerhub
dockerhub:
docker build --rm -t oistncu/studio:latest . --platform=linux/amd64
docker push oistncu/studio:latest
docker build --rm -t oistncu/optinist:latest . --platform=linux/amd64
docker push oistncu/optinist:latest

.PHONY: local_build
local_build:
cp -r frontend/build studio/frontend/build
cp -r frontend/build optinist/frontend/build
pip install .

.PHONY: upload_testpypi
upload_testpypi:
mkdir -p optinist/frontend/build
cp -r frontend/build optinist/frontend/
python setup.py sdist
twine upload --repository testpypi dist/*

.PHONY: test_pypi
test_pypi:
python3 -m pip install --index-url https://test.pypi.org/simple/ studio
python3 -m pip install --index-url https://test.pypi.org/simple/ optinist

.PHONY: push_pypi
push_pypi:
twine upload --repository pypi dist/*
twine upload --repository pypi dist/*

.PHONY: test_doc
test_doc:
python3 -m pip install -r docs/requirements.txt
sphinx-autobuild -b html docs docs/_build --port 8001
58 changes: 30 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# studio <img src="docs/_static/studio.png" width="250" title="studio" alt="studio" align="right" vspace = "50">
# optinist <img src="docs/_static/optinist.png" width="250" title="optinist" alt="optinist" align="right" vspace = "50">

<p align="center">
<a>
Expand All @@ -7,36 +7,37 @@
<a>
<img src="https://img.shields.io/badge/-TypeScript-007ACC.svg?logo=typescript&style=flat&logoColor=white">
</a>
<a href="https://pypi.org/project/studio">
<img alt="PYPI" src="https://static.pepy.tech/personalized-badge/studio?period=total&units=international_system&left_color=black&right_color=blue&left_text=Downloads(PYPI)">
<a href="https://pypi.org/project/optinist">
<img alt="PYPI" src="https://static.pepy.tech/personalized-badge/optinist?period=total&units=international_system&left_color=black&right_color=blue&left_text=Downloads(PYPI)">
</a>
<a href="https://pypi.org/project/studio">
<img alt="PYPI" src="https://static.pepy.tech/personalized-badge/studio?period=week&units=international_system&left_color=black&right_color=blue&left_text=Downloads/week(PYPI)">
<a href="https://pypi.org/project/optinist">
<img alt="PYPI" src="https://static.pepy.tech/personalized-badge/optinist?period=week&units=international_system&left_color=black&right_color=blue&left_text=Downloads/week(PYPI)">
</a>
<a href="https://pypi.org/project/studio">
<img alt="" src="https://badge.fury.io/py/studio.svg">
<a href="https://pypi.org/project/optinist">
<img alt="" src="https://badge.fury.io/py/optinist.svg">
</a>
<a href="https://github.com/oist/studio">
<img alt="" src="https://img.shields.io/github/repo-size/oist/studio">
<a href="https://github.com/oist/optinist">
<img alt="" src="https://img.shields.io/github/repo-size/oist/optinist">
</a>
<a href="https://github.com/oist/studio">
<img alt="" src="https://img.shields.io/github/stars/oist/studio?style=social">
<a href="https://github.com/oist/optinist">
<img alt="" src="https://img.shields.io/github/stars/oist/optinist?style=social">
</a>
<a href="https://github.com/oist/studio">
<img alt="" src="https://img.shields.io/github/forks/oist/studio?style=social">
<a href="https://github.com/oist/optinist">
<img alt="" src="https://img.shields.io/github/forks/oist/optinist?style=social">
</a>
</p>

studio(Optical Neuroimage Studio) is a GUI based workflow pipeline tools for processing two-photon calcium imaging data.
OptiNiSt(Optical Neuroimage Studio) is a GUI based workflow pipeline tools for processing two-photon calcium imaging data.

studio helps researchers try multiple data analysis methods, visualize the results, and construct the data analysis pipelines easily and quickly on GUI. studio's data-saving format follows NWB standards.
OptiNiSt helps researchers try multiple data analysis methods, visualize the results, and construct the data analysis pipelines easily and quickly on GUI. OptiNiSt's data-saving format follows NWB standards.

studio also supports reproducibility of scientific research, standardization of analysis protocols, and developments of novel analysis tools as plug-in.
OptiNiSt also supports reproducibility of scientific research, standardization of analysis protocols, and developments of novel analysis tools as plug-in.

## Support library
### ROI detection
- [x] [Suite2p](https://github.com/MouseLand/suite2p)
- [x] [CaImAn](https://github.com/flatironinstitute/CaImAn)
- [x] [LCCD](https://github.com/magnetizedCell/lccd-python)

### Postprocessing
- [x] Basic Neural Analysis(Event Trigger Average...)
Expand All @@ -50,55 +51,55 @@ studio also supports reproducibility of scientific research, standardization of

## Key Features
### :beginner: Easy-To-Create Workflow
- **zero-knowledge of coding**: studio allows you to create analysis pipelines easily on the GUI.
- **zero-knowledge of coding**: OptiNiSt allows you to create analysis pipelines easily on the GUI.

### :zap: Visualizing analysis results
- **quick visualization**: studio supports you visualize the analysis results by plotly.
- **quick visualization**: OptiNiSt supports you visualize the analysis results by plotly.

### :rocket: Managing Workflows
- **recording and reproducing**: studio records and reproduces the workflow pipelines easily.
- **recording and reproducing**: OptiNiSt records and reproduces the workflow pipelines easily.


## Installation
Need anaconda or miniconda environment.
```
conda create -n studio python=3.8
conda activate studio
conda create -n optinist python=3.8
conda activate optinist
```

Install from pip.
```
pip install studio
pip install optinist
```

launch.
```
run_studio
run_optinist
```

Open browser. http://localhost:8000

## Documentation
https://studio.readthedocs.io/en/latest/
https://optinist.readthedocs.io/en/latest/


## Using GUI
### Workflow
- studio allows you to make your analysis pipelines by graph style using nodes and edges on GUI. Parameters for each analysis are easily changeable.
- OptiNiSt allows you to make your analysis pipelines by graph style using nodes and edges on GUI. Parameters for each analysis are easily changeable.
<p align="center">
<img width="400px" src="docs/_static/workflow/whole.png" alt="workflow" />
</p>



### Visualize
- studio allows you to visualize the analysis results with one click by plotly. It supports a variety of plotting styles.
- OptiNiSt allows you to visualize the analysis results with one click by plotly. It supports a variety of plotting styles.
<p align="center">
<img width="400px" src="docs/_static/visualize/whole.png" alt="visualize" />
</p>

### Record
- studio supports you in recording and reproducing workflow pipelines in an organized manner.
- OptiNiSt supports you in recording and reproducing workflow pipelines in an organized manner.
<p align="center">
<img width="400px" src="docs/_static/record/whole.png" alt="record" />
</p>
Expand All @@ -119,12 +120,13 @@ Kenji Doya, Yukako Yamane [OIST Neural Computation Unit](https://groups.oist.jp/
## References
[[Suite2p]](https://github.com/MouseLand/suite2p) Marius Pachitariu, Carsen Stringer, Mario Dipoppa, Sylvia Schröder, L. Federico Rossi, Henry Dalgleish, Matteo Carandini, Kenneth D. Harris. "Suite2p: beyond 10,000 neurons with standard two-photon microscopy". 2017
[[CaImAn]](https://github.com/flatironinstitute/CaImAn) Andrea Giovannucci Is a corresponding author, Johannes Friedrich, Pat Gunn, Jérémie Kalfon, Brandon L Brown, Sue Ann Koay, Jiannis Taxidis, Farzaneh Najafi, Jeffrey L Gauthier, Pengcheng Zhou, Baljit S Khakh, David W Tank, Dmitri B Chklovskii, Eftychios A Pnevmatikakis. "CaImAn: An open source tool for scalable Calcium Imaging data Analysis". 2019
[[LCCD]](https://github.com/magnetizedCell/lccd-python) Tsubasa Ito, Keisuke Ota, Kanako Ueno, Yasuhiro Oisi, Chie Matsubara, Kenta Kobayashi, Masamichi Ohkura, Junichi Nakai, Masanori Murayama, Toru Aonishi, "Low computational-cost cell detection method for calcium imaging data", 2022
[[PyNWB]](https://github.com/NeurodataWithoutBorders/pynwb) Oliver Rübel, Andrew Tritt, Ryan Ly, Benjamin K. Dichter, Satrajit Ghosh, Lawrence Niu, Ivan Soltesz, Karel Svoboda, Loren Frank, Kristofer E. Bouchard, "The Neurodata Without Borders ecosystem for neurophysiological data science", bioRxiv 2021.03.13.435173, March 15, 2021

<!-- ## Citing the Project
To cite this repository in publications:
```
@misc{studio,
@misc{OptiNiSt,
author = {name},
title = {title},
year = {2022},
Expand Down
22 changes: 11 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
version: "3.8"
services:
test_studio:
image: test_studio
container_name: test_studio
test_optinist:
image: test_optinist
container_name: test_optinist
build:
context: .
dockerfile: Dockerfile-test
environment:
PYTHONPATH: .
TZ: Asia/Tokyo
volumes:
- ./studio:/app/studio
- ./optinist:/app/optinist
- ./conda/yaml:/app/conda/yaml
- ./studio/test_data:/tmp/studio
- ./optinist/test_data:/tmp/optinist

test_studio_frontend:
image: test_studio_frontend
container_name: test_studio_frontend
test_optinist_frontend:
image: test_optinist_frontend
container_name: test_optinist_frontend
build:
context: ./frontend
dockerfile: Dockerfile-test
environment:
TZ: Asia/Tokyo
command: yarn test:ci

build_studio_frontend:
image: build_studio_frontend
container_name: build_studio_frontend
build_optinist_frontend:
image: build_optinist_frontend
container_name: build_optinist_frontend
build:
context: ./frontend
dockerfile: Dockerfile-build
Expand Down
Loading

0 comments on commit 6cfe6d8

Please sign in to comment.