This repository contains python codes and data analysis pipelines for 3D calcium imaging analysis on thermosensory neurons in drosophila.
- Project Overview
- Data
- Installation
- Description
- File Overview
- Input and Output File Organization
- Usage Instructions
- Example Directory Structures
- Troubleshooting
- License
- Contact
The Drosophila larval head is equipped with a highly organized peripheral sensory system composed of three main ganglia: the Dorsal Organ Ganglion (DOG), the Terminal Organ Ganglion (TOG), and the Ventral Organ Ganglion (VOG). These structures house distinct populations of sensory neurons that extend dendrites to the larval surface and specialize in detecting environmental cues. The DOG is primarily responsible for olfactory and thermosensory functions, while the TOG and VOG are largely involved in gustatory perception. Together, these ganglia enable the larva to navigate its environment through smell, taste, and temperature sensing.
Our research focuses on thermosensory neurons within the DOG—Dorsal Organ Warm Cells (DOWCs) and Dorsal Organ Cool Cells (DOCCs)—which play key roles in larval temperature-guided behaviors.
• Dorsal Organ Warm Cells (DOWCs)
Each DOG contains a pair of DOWCs. These neurons are activated by warming and play a key role in mediating warm avoidance behavior in Drosophila larvae. Genetic and functional studies have identified three Ionotropic Receptors (IRs) expressed in DOWCs—Ir68a, Ir93a, and Ir25a—which are essential for their thermosensory function.
• Dorsal Organ Cool Cells (DOCCs)
Each DOG contains three of DOCCs, two A type and one B type, that respond to cooling. These neurons are mediating cool avoidance behavior in Drosophila larvae. Genetic and functional studies have identified three Ionotropic Receptors (IRs) expressed in DOCCs—Ir21a, Ir93a, and Ir25a—which are essential for their thermosensory function.
- Clone or download this repository.
- Create a python virtrual environment.
- Install dependencies:
python -m pip install --upgrade pip python -m pip install -r requirements.txt
- Test scripts usging demo data
python .\CIAanalysis_120min.py -i path/demo_analysis --merge --cell_type DOWC python .\CITbind_dynamic.py -i path/demo_cbind -n 2
These python scripts allows batch processing and analysis of calcium imaging datasets collected from Drosophila larvae or other small model systems. The pipline has three main stages:
- Fluorescence extraction using TrackMate in ImageJ
insert the user manual for the steps in Trackmate here! - Primary Analysis (CIAnalysis_120min.py)
This is the main script for the processing individual calcium imaging datasets.
It automatially: • Generates background values from background_i.xlsx
• Extracts fluorescence change
• DOCC: Uses the first timepoint fluorescence as F₀
• DOWC: Uses the minimum fluorescence in the first cooling and warming cycle as Fmin
• Merges individual neuron results into a summary CSV and plot
Supporting modules that run internally:
| File Name | Description |
|---|---|
Generate_background.py |
Generates background list creation. |
individual_dFoverF0_1.py |
ΔF/F0 calculation for DOCC. |
individual_dFoverF0_DOWC.py |
ΔF/Fmin calculation for DOwC. |
merge_dFoverF0_1.py |
Merges all neuron result files into a combined dataset. |
utility.py |
Shared utility functions across all modules. |
-
Temperature Binding (CITbind_dynamic.py)
After individual sample processing, this script combines temperature data and calcium imaging results and generates aligned dual-axis plots.
• Generate summarized time-synchronized combined CSVs
• Generate plots of ΔF/F₀ and temperature (two versions: default and y-range limited) -
Summary Visualization (data_summary.py)
Once all individual samples have been processed, this script:
• Computes mean ± SEM
• Outputs a stacked plot (combined_gradient_plot.png) showing:
• Top panel: Average ΔF/F₀ or ΔF/Fmin
• Bottom panel: Temperature curve