Skip to content

Commit

Permalink
Merge pull request #84 from jbwallace123/dev
Browse files Browse the repository at this point in the history
adding automated workflow for pypi publishing
  • Loading branch information
jbwallace123 authored Sep 29, 2023
2 parents 61010e7 + 56897d1 commit 15739b7
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 9 deletions.
85 changes: 85 additions & 0 deletions .github/workflows/pypi_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Publish Python 🐍 distribution 📦 to PyPI

on: push

jobs:
build:
name: Build distribution 📦
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install pypa/build
run: >-
python3 -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/

publish-to-pypi:
name: >-
Publish Python 🐍 distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/roicat # Replace <package-name> with your PyPI project name
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

github-release:
name: >-
Sign the Python 🐍 distribution 📦 with Sigstore
and upload them to GitHub Release
needs:
- publish-to-pypi
runs-on: ubuntu-latest

permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
id-token: write # IMPORTANT: mandatory for sigstore

steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Sign the dists with Sigstore
uses: sigstore/gh-action-sigstore-python@v1.2.3
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Upload artifact signatures to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
# Upload to GitHub Release using the `gh` CLI.
# `dist/` contains the built packages, and the
# sigstore-produced signatures and certificates.
run: >-
gh release upload
'${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'
34 changes: 25 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ROICaT
# Welcome to ROICaT

<div>
<img src="docs/media/logo1.png" alt="ROICaT" width="200" align="right" style="margin-left: 20px"/>
Expand All @@ -18,11 +18,21 @@ A simple-to-use Python package for automatically classifying images of cells and
<img src="docs/media/tracking_FOV_clusters_rich.gif" alt="tracking_FOV_clusters_rich" width="400" align="right" style="margin-left: 20px"/>
</div>

With this package, you can:
**Why use ROICaT?**
- ROICaT is capable of clasifying cells with near human accuracy when compared to human relabeling and can track cells with higher accuracy than other methods currently available. With minimal input data, ROICaT can classify and track cells with XX% accuracy. Additionally, the computational needs of ROICaT are minimal, requiring only a standard computer with 4 GB of RAM and a CPU.

With ROICaT, you can:
- **Classify ROIs** into different categories (e.g. neurons, dendrites, glia, etc.).
- **Track ROIs** across imaging sessions/planes.

We have found that ROICaT is capable of classifying cells with accuracy comparable to human relabeling performance, and tracking cells with higher accuracy than any other methods we have tried. Paper coming soon.
**What data types can ROICaT process?**
- ROICaT can accept many different two-photon imaging data formats including: Suite2p, CaImAn, CNMF, NWB, and more.

**What are the minimum computing needs?**
- We recommend the following as a starting point:
- 4 GB of RAM (more for large data sets e.g., ~32 Gb for 100K neurons)
- GPU not required but will increase run speed.


<br>
<br>
Expand All @@ -32,6 +42,10 @@ We have found that ROICaT is capable of classifying cells with accuracy comparab
<img src="docs/media/umap_with_labels.png" alt="ROICaT" width="300" align="right" style="margin-left: 20px"/>
</div>

Listed below, we have a suite of easy to run notebooks for running the ROICaT pipelines.
- The Google CoLab notebooks can be run fully remotely without installing anything on your computer.
- The Jupyter notebooks can be run locally on your computer and require you to install ROICaT.

**TRACKING:**
- [Interactive notebook](https://github.com/RichieHakim/ROICaT/blob/main/notebooks/jupyter/tracking/tracking_interactive_notebook.ipynb)
- [Google CoLab](https://githubtocolab.com/RichieHakim/ROICaT/blob/main/notebooks/colab/tracking/tracking_interactive_notebook.ipynb)
Expand All @@ -49,6 +63,14 @@ We have found that ROICaT is capable of classifying cells with accuracy comparab
- Use the API to integrate ROICaT functions into your own code: [Documentation](https://roicat.readthedocs.io/en/latest/roicat.html).
<!-- - Train a new ROInet model using the provided Jupyter Notebook [TODO: link]. -->

# General workflow:
- **Pass ROIs through ROInet:** Images of the ROIs are passed through a neural network which outputs a feature vector for each image describing what the ROI looks like.
- **Classification:** The feature vectors can then be used to classify ROIs:
- A simple classifier can be trained using user supplied labeled data (e.g. an array of images of ROIs and a corresponding array of labels for each ROI).
- Alternatively, classification can be done by projecting the feature vectors into a lower-dimensional space using UMAP and then simply circling the region of space to classify the ROIs.
- **Tracking**: The feature vectors can be combined with information about the position of the ROIs to track the ROIs across imaging sessions/planes.


# Installation
ROICaT works on Windows, MacOS, and Linux. If you have any issues during the installation process, please make a [github issue](https://github.com/RichieHakim/ROICaT/issues) with the error.

Expand Down Expand Up @@ -127,12 +149,6 @@ To force install the GPU version of pytorch, see the pytorch installation instru
conda install pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia
```

# General workflow:
- **Pass ROIs through ROInet:** Images of the ROIs are passed through a neural network which outputs a feature vector for each image describing what the ROI looks like.
- **Classification:** The feature vectors can then be used to classify ROIs:
- A simple classifier can be trained using user supplied labeled data (e.g. an array of images of ROIs and a corresponding array of labels for each ROI).
- Alternatively, classification can be done by projecting the feature vectors into a lower-dimensional space using UMAP and then simply circling the region of space to classify the ROIs.
- **Tracking**: The feature vectors can be combined with information about the position of the ROIs to track the ROIs across imaging sessions/planes.

# TODO:
- Unify model training into this repo
Expand Down

0 comments on commit 15739b7

Please sign in to comment.