This repository contains the source code used in the article below. It is not being actively maintained; please see individual repositories (linked below) for the latest version of the code.
To cite this work (datasets, methods, code, packages, models, results, etc.), please refer to the article:
Adam A. Atanas*, Jungsoo Kim*, Ziyu Wang, Eric Bueno, McCoy Becker, Di Kang, Jungyeon Park, Talya S. Kramer, Flossie K. Wan, Saba Baskoylu, Ugur Dag, Elpiniki Kalogeropoulou, Matthew A. Gomes, Cassi Estrem, Netta Cohen, Vikash K. Mansinghka, Steven W. Flavell
Cell 2023; doi: https://doi.org/10.1016/j.cell.2023.07.035
* Equal Contribution
The processed data files and the trained neural network weights are available in the repository.
The datasets and modeling results (encoding detection) from this project can be browsed in WormWideWeb. On the website, you can easily find the neural (GCaMP) traces of specific recorded/identified neuron classes, along with the information on how those neurons encode behavioral information—identified by the CePNEM model.
Notebooks and scripts used in this project are stored in the directory notebook
.
To automatically install the latest versions of the key main packages, please use the latest version of our setup script. This script should install all necessary dependencies, including Julia and Python packages, for our code to run. We also provide FlavellPkg.jl which only handles the Julia packages, so it is recommended to run the full installation script in order to ensure the Python packages are installed correctly as well.
Packages in this repository are available in the directory src
. Note that the source code included in this repository is from when the article was published. Any updates (e.g. bug fixes, new features) to any of the packages are not reflected on the code included in this repository.
To use/install or access the latest/maintained versions, please access the individual repositories using the links below, or alternatively use our setup scripts linked above:
Calcium and behavior data processing and extraction
- ANTSUN contains a notebook that executes the full ANTSUN pipeline, from raw microscope data to neural traces and behaviors
- BehaviorDataNIR.jl extracts behavioral data from NIR microscope recordings
- CaAnalysis.jl processes GCaMP traces
- Clustering.jl contains a custom hierarchical clustering algorithm used in neuron identity matching
- ExtractRegisteredData.jl links neural identities between time points and extracting GCaMP traces
- FFTRegGPU.jl runs the FFT-bsased subpixel shift registration in GPU
- FlavellBase.jl contains generic code utilities
- GPUFilter.jl library of GPU-accelerated filtering methods
- ImageDataIO.jl contains IO code that allows different ANTSUN packages to communicate with each other
- MHDIO.jl contains IO code for the MHD image format
- ND2Process.jl contains IO code for the ND2 image format
- NRRDIO.jl contains IO code for the NRRD image format
- NeuroPALData.jl contains a collection of NeuroPAL labeling utilities
- RegistrationGraph.jl generates and executes registration problems to map neural identities between time points
- SLURMManager.jl interacts with
SLURM
to execute code on a cluster - SegmentationStats.jl contains segmentation utlility code
- SegmentationTools.jl performs semantic and instance segmentation using the 3D-UNet
pytorch-3dunet
, and can generate and format UNet input and training data - TotalVariation.jl performs total-variation noise filtering
- UNet2D.jl implements a Julia wrapper for
unet2d
- WormCurveFinder.jl fits a spline to the confocal imaging data
- WormFeatureDetector.jl computes metrics of how similar worm postures are in different time points
- pytorch-3dunet implements the 3D-UNet for neuron segmentation
- unet2d implements 2D-UNets, used for worm segmentation and head detection
Modeling and analysis tools
- ANTSUNData.jl implements IO operations on HDF5 ANTSUN output
- ANTSUNDataJLD2.jl converts ANTSUN output into the HDF5 format
- AnalysisBase.jl implements various GCaMP analysis utilities
- CePNEM.jl contains the mathematical formulation of the CePNEM model
- CePNEMAnalysis.jl and its associated notebooks contain most of the code for interpreting CePNEM model results
- EncoderModel.jl implements non-probabilistic (i.e.: MSE-minimization) versions of CePNEM
- FlavellConstants.jl stores parameter settings and values that are held fixed
- HierarchicalPosteriorModel.jl implements a hierarchical posterior model for interpreting CePNEM fits on the same neuron class across animals
- ConnectomePlot.jl is a package for creating diagrams of the C. elegans connectome with custom color settings for each neuron.
Microscope control and data acquisition software (GUI)
- ConfocalTrackerControl.jl worm tracking and data acquisition software (GUI)
- StageControl.jl interfaces the MAC6000 stage controller