Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/draft-pdf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Draft PDF
on:
push:
paths:
- paper/**
- .github/workflows/draft-pdf.yaml

jobs:
paper:
runs-on: ubuntu-latest
name: Paper Draft
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build draft PDF
uses: openjournals/openjournals-draft-action@master
with:
journal: joss
paper-path: paper/paper.md
- name: Upload
uses: actions/upload-artifact@v4
with:
name: paper
path: paper/paper.pdf
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# dir with input files
*/data/
snazzy_processing/data/*
snazzy_analysis/data/*

# add annotated data for ROI length evaluation
!snazzy_processing/data/20240611/
snazzy_processing/data/20240611/*
!snazzy_processing/data/20240611/annotated
!snazzy_processing/data/20240611/emb_sizes


# dir with output files
*/results/
Expand Down
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# SNAzzy: an image processing pipeline for investigating global Synchronous Network Activity

SNAzzy is a Python package for studying synchronous network activity (SNA) in Drosophia embryos via high-thoughput microscopy.
The software includes processing raw data into individual `.tif` files, quantification of fluorescence and changes in morphology, a custom peak detection algorithm, and a GUI for data visualization and curation.

## Getting Started

Refer to the README files inside the `snazzy_processing` or `snazzy_analysis` packages for details on running the code.

### Installation

The project uses [conda](https://docs.conda.io) to manage dependencies.
Expand All @@ -19,6 +24,18 @@ Activate the environment:
```
conda activate snazzy-env
```

## Testing

Tests can be run with pytest.

You can run the test suite from the project’s root directory to test everything at once.
Make sure the environment is active, and then run:

```
pytest
```

## Contributing

Thank you for being interested in `snazzy`!
Expand Down
6 changes: 5 additions & 1 deletion docs/source/Data_analysis/Graphical_User_Interface.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,13 @@ From this window it's possible to set:
* To_remove: embryo numbers that will be analyzed, but will appear in the 'Removed' group.
* Embryos that have it's first peak before the first peak threshold or that were marked by the user as removed will also be at the to_remove category.
* Has_transients: if selected the code will try to identify and skip the first peak if it's likely just a transient.
* Has_dsna: if selected the code will try to determine dSNA and ignore all peaks that happen after dSNA start.
* Dff_strategy: Combo box with the baseline strategy methods. ``local_minima`` will pick the bottom 11 points out of the ``baseline_window_size`` and use that average as the baseline. ``baseline`` will split the DFF values into bins and use the average of the most frequent bin as the baseline. This method assumes that the bursts of activity are sparse, so that for all windows the most frequent bin falls into the baseline values.

The embryos listed in ``to_remove`` are not used for plotting and comparisons between Groups.
There are different reasons for marking an embryo as removed.
One example would be to remove embryos that already are in later stages of development when the imaging session starts.
Another would be to remove unhealthy embryos, or embryos that don't hatch, if that is a requirement for the experiment.

Inside the File menu there is an option to open the ``json`` file and change any of its parameters.
Updating the file causes the entire Dataset to be recreated with the new configuration data.

Expand Down
2 changes: 1 addition & 1 deletion docs/source/Data_analysis/Hatching_Point.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ It can also happen that an embryo is still inside the egg and a larva that alrea
It's very rare that this scenario affects the ROI calculation, because we only consider the largest connected area for calculating the ROI, which is usually the VNC.
If it does, then the only option is to remove that embryo.

When loading an experiment for the first time, it's worth it to visualize the structural channel signal of each embryo.
When loading a dataset for the first time, it's worth it to visualize the structural channel signal of each embryo.
On a few occasions, mostly due to very abrupt motion, the ROI is underestimated and the hatching point is determined earlier.
In these cases, you can drag the line that indicates the hatching to a more accurate position or remove that embryo.

Expand Down
3 changes: 3 additions & 0 deletions docs/source/Data_analysis/Peak_Detection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ Since the leftmost peak can have an amplitude very different than the local maxi
3. Filter peaks by local threshold
----------------------------------

This step is **not enabled** by default.
To enable it the ``dff_peak_indices`` in ``trace.calculate_peaks`` must be passed to ``trace.filter_peaks_by_local_threshold``.

As the embryos develop, there is a global trend of peak amplitude to rise and then stabilize before hatching.
We use this fact to perform an extra validation step for the calculated peaks.
Each peak is compared against its neighboring peaks, and peaks that are too high or too low are discarted.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
Neurodevelopmental Time
----------------
Together the ROI length and the full embryo size are used as a proxy to measure the embryonic neurodevelopmental progression:

developmental_progression = embryo_length / ROI_length

ROI length
==========
Neurodevelopmental Progression
==============================

The ROI length is calculated by center line estimation.
The general approach is to measure the line that will pass through the center of the ROI; this will correspond to the ventral nerve cord length.

Together the ROI length and the full embryo size are used as a proxy to measure the embryonic neurodevelopmental progression:

.. math::
neurodevelopmental\ progression = \frac{embryo\ length}{ROI\ length}

To determine the ROI length, the following steps are used:

1. Binarize the image
Expand All @@ -26,6 +25,7 @@ Embryo Full size
The full specimen size is calculated by approximating the entire sample shape as an ellipse, and measuring this ellipse's diameter.

The steps to calculate the embryo's size are:

1. Equalize the image histogram
2. Automatic threshold (Triangle method)
3. Binarize the image
Expand Down
2 changes: 1 addition & 1 deletion docs/source/Data_processing/Overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ Refer to the other documentation pages for a description of the pipeline steps:

* `Process raw data <Process_raw_data.html>`__
* `ROI and signal intensity <ROIs_and_signal_intensity.html>`__
* `ROI length <ROI_length.html>`__
* `Neurodevelopmental_progression <Neurodevelopmental_progression.html>`__
2 changes: 1 addition & 1 deletion docs/source/Data_processing/ROIs_and_signal_intensity.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ To display it, ``cd`` into the ``snazzy_processing`` directory, and run the file

python3 scripts/plot_contours.py

It will look for any experiment directories you have inside the ``./data`` directory and present the available options in the terminal.
It will look for any dataset directories you have inside the ``./data`` directory and present the available options in the terminal.
Animations can be paused by pressing any key.
2 changes: 1 addition & 1 deletion docs/source/Data_processing/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ Data Processing
Overview
Process_raw_data
ROIs_and_signal_intensity
ROI_length
Neurodevelopmental_progression
3 changes: 3 additions & 0 deletions docs/source/Getting_Started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ Running the code

Refer to the Getting Started session of each package for how to run the code.

Two sample datasets with a reduced number of samples (to reduce dataset size) were uploaded to zenodo.
Please find the datasets here: https://doi.org/10.5281/zenodo.17295552.

To process raw data, start with `Getting Started <Data_processing/Overview.html>`__.
To analyze the output of the processing step, go to `Getting Started <Data_analysis/Overview.html>`__.

Expand Down
Binary file added paper/figures/snazzy-fig1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added paper/figures/snazzy-fig2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added paper/figures/snazzy-fig3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added paper/figures/snazzy-fig4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
203 changes: 203 additions & 0 deletions paper/paper.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
@article{wu:2024,
title={Network state transitions during cortical development},
ISSN={1471-003X},
url={http://dx.doi.org/10.1038/s41583-024-00824-y},
DOI={10.1038/s41583-024-00824-y},
journal={Nature reviews. Neuroscience},
author={Wu, Michelle W. and Kourdougli, Nazim and Portera-Cailliau, Carlos},
year={2024},
month=may,
language={en} }

@article{akin:2020,
title={Activity regulates brain development in the fly},
volume={65},
ISSN={0959-437X},
DOI={10.1016/j.gde.2020.04.005},
journal={Current opinion in genetics & development},
publisher={Elsevier BV},
author={Akin, Orkun and Zipursky, S. Lawrence},
year={2020},
month=dec,
pages={8–13},
language={en} }

@article{ardiel:2022,
title={Stereotyped behavioral maturation and rhythmic quiescence in C. elegans embryos},
volume={11},
ISSN={2050-084X},
url={http://dx.doi.org/10.7554/eLife.76836},
DOI={10.7554/eLife.76836},
journal={eLife},
publisher={eLife Sciences Publications, Ltd},
author={Ardiel, Evan L. and Lauziere, Andrew and Xu, Stephen and Harvey, Brandon J. and Christensen, Ryan Patrick and Nurrish, Stephen and Kaplan, Joshua M. and Shroff, Hari},
year={2022},
month=aug,
keywords={C. elegans; behavior; embryo; neuropeptides; neuroscience},
language={en} }

@article{avasthi:2023,
title={Gotta catch ‘em all: Agar microchambers for high-throughput single-cell live imaging},
ISSN={2998-4084},
url={http://dx.doi.org/10.57844/arcadia-v1bg-6b60},
DOI={10.57844/arcadia-v1bg-6b60},
publisher={Arcadia Science},
author={Avasthi, Prachee and Essock-Burns, Tara and Garcia, Galo, III and Gehring, Jase and Matus, David Q. and Mets, David G. and York, Ryan},
year={2023},
month=apr }

@article{blankenship:2009,
title={Mechanisms underlying spontaneous patterned activity in developing neural circuits},
volume={11},
ISSN={1471-003X},
DOI={10.1038/nrn2759},
number={1},
journal={Nature reviews. Neuroscience},
publisher={Nature Publishing Group},
author={Blankenship, Aaron G. and Feller, Marla B.},
year={2009},
pages={18–29} }

@article{carreira:2021,
title={Mechanosensory input during circuit formation shapes Drosophila motor behavior through patterned spontaneous network activity},
volume={31},
ISSN={0960-9822},
DOI={10.1016/j.cub.2021.08.022},
number={23},
journal={Current biology: CB},
author={Carreira-Rosario, Arnaldo and York, Ryan A. and Choi, Minseung and Doe, Chris Q. and Clandinin, Thomas R.},
year={2021},
month=dec,
pages={5341–5349.e4},
keywords={Drosophila embryo; behavioral development; development of locomotor behavior; nervous system development; neural circuit wiring; spontaneous network activity},
language={en} }

@article{crisp:2008,
title={The development of motor coordination in Drosophila embryos},
volume={3717},
DOI={10.1242/dev.026773},
author={Crisp, Sarah and Evers, Jan Felix and Fiala, André and Bate, Michael},
year={2008},
pages={3707–3717},
keywords={coordination; drosophila; embryo; movement; muscle} }

@article{donoughe:2018,
title={High-throughput live-imaging of embryos in microwell arrays using a modular specimen mounting system},
volume={7},
ISSN={2046-6390},
DOI={10.1242/bio.031260},
number={7},
journal={Biology open},
publisher={The Company of Biologists},
author={Donoughe, Seth and Kim, Chiyoung and Extavour, Cassandra G.},
year={2018},
month=jul,
pages={bio031260},
keywords={Development; Embryogenesis; High-throughput; Image analysis; Microscopy; Quantitative imaging; Time lapse},
language={en} }

@article{fischler:1981,
title={Random sample consensus: a paradigm for model fitting with applications to image analysis and automated cartography},
volume={24},
ISSN={0001-0782},
DOI={10.1145/358669.358692},
number={6},
journal={Communications of the ACM},
publisher={Association for Computing Machinery (ACM)},
author={Fischler, Martin A. and Bolles, Robert C.},
year={1981},
month=jun,
pages={381–395},
language={en} }

@article{giovannucci:2019,
title={CaImAn an open source tool for scalable calcium imaging data analysis},
volume={8},
ISSN={2050-084X},
url={http://dx.doi.org/10.7554/eLife.38173},
DOI={10.7554/eLife.38173},
journal={eLife},
publisher={eLife Sciences Publications, Ltd},
author={Giovannucci, Andrea and Friedrich, Johannes and Gunn, Pat and Kalfon, Jérémie and Brown, Brandon L. and Koay, Sue Ann and Taxidis, Jiannis and Najafi, Farzaneh and Gauthier, Jeffrey L. and Zhou, Pengcheng and Khakh, Baljit S. and Tank, David W. and Chklovskii, Dmitri B. and Pnevmatikakis, Eftychios A.},
year={2019},
month=jan,
keywords={calcium imaging; data analysis; mouse; neuroscience; one-photon; open source; software; two-photon; zebrafish},
language={en} }

@article{lin:2016,
title={Genetically encoded indicators of neuronal activity},
volume={19},
ISSN={1097-6256},
DOI={10.1038/nn.4359},
number={9},
journal={Nature neuroscience},
publisher={Nature Publishing Group},
author={Lin, Michael Z. and Schnitzer, Mark J.},
year={2016},
month=aug,
pages={1142–1153},
language={en} }

@unpublished{menzies:2024,
title={A microRNA that controls the emergence of embryonic movement},
url={http://dx.doi.org/10.7554/eLife.95209.2},
DOI={10.7554/elife.95209.2},
journal={eLife},
author={Menzies, Jonathan A. C. and Chagas, Andre M. and Baden, Tom and Alonso, Claudio R.},
year={2024},
month=jun,
language={en} }

@article{nakai:2001,
title={A high signal-to-noise Ca(2+) probe composed of a single green fluorescent protein},
volume={19},
ISSN={1087-0156},
DOI={10.1038/84397},
number={2},
journal={Nature biotechnology},
publisher={Springer Science and Business Media LLC},
author={Nakai, J. and Ohkura, M. and Imoto, K.},
year={2001},
month=feb,
pages={137–141},
language={en} }

@article{otsu:1979,
title={A threshold selection method from gray-level histograms},
volume={9},
ISSN={0018-9472},
DOI={10.1109/TSMC.1979.4310076},
number={1},
journal={IEEE transactions on systems, man, and cybernetics},
publisher={Institute of Electrical and Electronics Engineers (IEEE)},
author={Otsu, Nobuyuki},
year={1979},
month=jan,
pages={62–66},
language={en} }

@unpublished{pachitariu:2016,
title={Suite2p: beyond 10,000 neurons with standard two-photon microscopy},
url={https://www.biorxiv.org/content/10.1101/061507v2.abstract},
DOI={10.1101/061507},
journal={bioRxiv},
publisher={bioRxiv},
author={Pachitariu, Marius and Stringer, Carsen and Dipoppa, Mario and Schröder, Sylvia and Rossi, L. Federico and Dalgleish, Henry and Carandini, Matteo and Harris, Kenneth D.},
year={2016},
month=jun,
pages={061507},
language={en} }

@article{virtanen:2020,
title={SciPy 1.0: fundamental algorithms for scientific computing in Python},
volume={17},
ISSN={1548-7091},
DOI={10.1038/s41592-019-0686-2},
number={3},
journal={Nature methods},
publisher={Springer Science and Business Media LLC},
author={Virtanen, Pauli and Gommers, Ralf and Oliphant, Travis E. and Haberland, Matt and Reddy, Tyler and Cournapeau, David and Burovski, Evgeni and Peterson, Pearu and Weckesser, Warren and Bright, Jonathan and van der Walt, Stéfan J. and Brett, Matthew and Wilson, Joshua and Millman, K. Jarrod and Mayorov, Nikolay and Nelson, Andrew R. J. and Jones, Eric and Kern, Robert and Larson, Eric and Carey, C. J. and Polat, İlhan and Feng, Yu and Moore, Eric W. and VanderPlas, Jake and Laxalde, Denis and Perktold, Josef and Cimrman, Robert and Henriksen, Ian and Quintero, E. A. and Harris, Charles R. and Archibald, Anne M. and Ribeiro, Antônio H. and Pedregosa, Fabian and van Mulbregt, Paul and SciPy 1.0 Contributors},
year={2020},
month=mar,
pages={261–272},
language={en} }
Loading
Loading