Figures and data

Usage of DrosoMating and CAD Parameters of the Chamber
(A) Typing input speed and input board numbers before selecting analyzing area (upper). Schematic representation of the region selection process (lower). Columns should be selected in a clockwise direction starting from the top left corner to define the chamber boundaries for perspective transformation (Fig. 1A, lower). Well numbering (1–36) follows a left-to-right, top-to-bottom sequence after perspective correction and is independent of pillar selection order. (B) Selection of reference flies for tracking accuracy. Any three reference flies were chosen for the analysis. (C) Use the X-axis, Y-axis, and threshold regulator to adjust the selection area to fit each well. Click “Enter” to run the program. Output file will be in the video folder: [Video Name]_output_[board numbers].csv (D) CAD (computer-aided design) exploded 3D view of the chamber instruction. (E) CAD parametric data of the chamber (dimensions in mm). (F) 3D diagram of the completed chamber

Comparison of the Accuracy of DrosoMating with Manual Scoring
(A) Copulation latency (CL) of Canton-S males was analyzed using DrosoMating and compared with manual recordings. For this figure, DBMs represent the ‘difference between means’ for the evaluation of estimation statistics. Asterisks represent significant differences, as revealed by the Student’s t test (* p<0.05, ** p<0.01, *** p<0.001). Differences between methods were assessed using two-sided Student’s t-test (ns, not significant). See the Background for a detailed description of the CL assays used in this study. (B) Courtship index (CI) of Canton-S was analyzed by DrosoMating and manual recording. CI was measured by [courtship time/ (mating time-courtship time) *100%]. For detailed methods, see the BACKGROUND for a detailed description of the CI assays used in this study. (C) Mating Duration (MD) of Canton-S was analyzed by DrosoMating and manual recording. See the BACKGROUND for a detailed description of the MD assays used in this study.

Behavioral assays of Drosophila males under different rearing conditions.
(A) CL of Canton-S, w1118, y1, and Oregon-R males. (B) CI of Canton-S, w1118, y1, and Oregon-R males. (C) MD of Canton-S, w1118, y1, and Oregon-R males. For detailed methods, see the background for a detailed description of the mating assays used in this study. Violin plots show the distribution of copulation latency (CL, in minutes) for Canton-S, w¹¹¹8, y¹, and Oregon-R males. Sample sizes are indicated below each group. Statistical significance was assessed using one-way ANOVA followed by Tukey’s post hoc test for multiple comparisons for Fig. 3A-C. ****p < 0.0001; ns, not significant. (D) CL of group-housed and single-reared Canton-S males. For Fig. 3D-I, DBMs represent the ‘difference between means’ for the evaluation of estimation statistics. Asterisks represent significant differences, as revealed by the Student’s t test (* p<0.05, ** p<0.01, *** p<0.001). Differences between methods were assessed using two-sided Student’s t-test (ns, not significant). (E) CI of group-housed and single-reared Canton-S males. (F) LMD assays of Canton-S males. In the MD assays, white data points denote males that were group-reared (or sexually naïve), whereas blue data points signify males that were singly reared. The dot plots represent the MD of each male fly. The mean value and standard error are labeled within the dot plot. (G) CL of naive and sexually experienced Canton-S males. (H) CI of naive and sexually experienced Canton-S males. (I) SMD assays of Canton-S males. White data points represent sexually-naïve males and pink data points represent sexually-experienced ones.

behavioral assays of learning in Drosophila which combined with temperature-dependent temporal activation/inhibition methods.
(A) Learning Index (LI) calculation and experimental design for temperature-dependent activation/inhibition of neural circuits in adult Drosophila. This figure illustrates the experimental paradigm for calculating the LI using CI measurements from sham and trained group. The protocol involves rearing flies at 20°C for four days followed by a one-day exposure to 29°C to activate/inhibit temperature-dependent, genetically-encoded neuronal modulators (for example, shits as inhibitor or TrpA1 as activator). (B) CI of training and sham training MB247-GAL4/UAS-GFP, MB247-GAL4/UAS-TrpA1 and MB247-GAL4/UAS-shits flies. Sample sizes (n) are indicated below each group. Statistical significance was assessed using two-way ANOVA for Fig. 4 B,C,D and F, followed by Sidak’s post hoc test for pairwise comparisons between sham and trained groups within each genotype. ****p < 0.0001; ns, not significant. (C) CI of different training days (D1: 1 day, D2: 2 days, D3: 3 days) and sham trained Canton-S flies. (D) CI of different training days (D1: 1day, D2: 2 days, D3: 3 days) and sham training orbΔ/orbΔQ flies. (E) LI of Canton-S and orbΔ/orbΔQ males. For fig. 4E and G, DBMs represent the ‘difference between means’ for the evaluation of estimation statistics. Asterisks represent significant differences, as revealed by the Student’s t test (* p<0.05, ** p<0.01, *** p<0.001). Differences between methods were assessed using two-sided Student’s t-test (ns, not significant). (F) CI of training and sham training rut2080; UAS-rut, rut2080; GAL4OK107, rut2080; GAL4OK107/UAS-rut flies. (G) LI of rut2080; UAS-rut, rut2080; GAL4OK107, rut2080; GAL4OK107/UAS-rut flies.

Limitations of conventional tracking-based tools for low-quality Drosophila mating videos.
(A-D) Representative Ctrax detection frames from single-chamber mating videos, showing examples with different detected target numbers. (E) Additional randomly sampled Ctrax detection frames during tracking. (F) Representative Ctrax trajectory plot generated from the tracked video. (G) Frame-by-frame plot of the number of targets detected by Ctrax. (H) FlyTracker background model, background variance, and sample image used for detection. (I-K) Representative FlyTracker segmentation outputs under different threshold settings. (I) Segmentation output using the default threshold setting. (J) Example frame showing relatively successful fly segmentation under the default threshold setting. (K) Representative segmentation output after lowering the threshold to reduce tracking/feature-computation errors. (L) FlyTracker command-window output showing the number of flies detected in sampled frames. (M) Example FlyTracker error message during feature computation.




Setup of mating assay chamber apparatus and architecture of workstation.
(A) Disassembly of the chamber apparatus. Each chamber comprises a roof, two activity areas, and a floor integrated with four pillars. (B) Workstation for assembling mating assay chambers. Essential required equipments for chamber assembly are shown: a stereomicroscope with an integrated light source, carbon dioxide anesthesia apparatus, a soft brush with feather on the opposite end, chamber apparatus, and fly containing vials. (C) 3D schematic of the mating chamber assembly. Assembly from bottom to top as shown. Briefly, first assemble the floor with one activity area 2 for placing females, then cover the females and separate activity area 1 from activity area 2 using the sex-separation slider. Next, position males and secure the chambers with paper tape. (D) The sex-separation slider is positioned between activity area 1 and activity area 2. (E) The mating chamber assembled with paper tape; the sex-separation slider should be marked with a pen to prevent forgetting to remove it. (F) 3D schematic of single chamber unit, can hold up to 36 pairs of fruit flies simultaneously. (G) Multiple chambers are set up with four chambers vertically aligned on an LED backlight, allowing the accommodation of 144 pairs of fruit flies across all chambers. (H) Video recording setup. Position a 1080p resolution camera or a smartphone with matching video capabilities above the chambers, turn on the LED backlight, and remove sex-separation slider before recording. (I) Setup for recording mating behavior using a camera mounted on a stand, positioned vertically above chambers arranged on a size-matched LED backlight to ensure uniform illumination. The camera is aligned to capture the entire chamber array, enabling simultaneous recording of mating interactions under controlled lighting conditions.

Comparison of DrosoMating with tracking-based tools under low-quality mating-video conditions.
The comparison was performed using representative low-quality, high-throughput mating videos recorded under standard experimental conditions. DrosoMating is compatible with low-contrast video streams, supports native multi-chamber analysis (up to 4 boards, 144 wells total), and robustly handles copulation overlap via state-detection without requiring individual identity maintenance. It directly outputs copulation latency (CL), courtship index (CI), and mating duration (MD) as automated CSV files with high (98–99%) agreement relative to manual scoring. By contrast, Under the tested low-quality mating-video conditions, Ctrax and FlyTracker did not provide stable end-to-end outputs suitable for reliable extraction of mating-timing metrics. DrosoMating was designed to extract mating-related timing metrics from high-throughput videos without requiring continuous two-fly identity tracking. Ctrax and FlyTracker were tested on cropped single-chamber videos from the same recording setup. Their limitations described here refer specifically to these low-quality mating videos and should not be interpreted as general limitations of the tools.

Temperature-dependent neural manipulation during LMD and SMD assays in adult Drosophila.
(A) Schematic representation of LMD and SMD assays timeline when flies were crossed with heat-sensitive Drosophila cation channel TrpA1 and shits. (B) MD assays of flies expressing the MB247-GAL4 driver together with UAS-GFP. Sample sizes are indicated below each group. Statistical significance was assessed using one-way ANOVA followed by Tukey’s post hoc test for multiple comparisons for Fig. S1B-C,E-F. ****p < 0.0001; ns, not significant. (C) MD assays of flies expressing the MB247-GAL4 driver together with UAS-shits. (D) Schematic representation of LMD and SMD assays timeline when tub-GAL80ts; UAS-KCNJ2/UAS-NaChBac/UAS-TNT or RNAi flies are crossed with specific GAL4 driver. (E) MD assays of flies expressing the MB247-GAL4 driver together with tub-GAL80ts, UAS-mCherry. (F) MD assays of flies expressing the MB247-GAL4 driver together with tub-GAL80ts, UAS-KCNJ2.

Usage of Linux version of DrosoMating
(A) Typing input speed and input board numbers before selecting analyzing area (upper). Schematic representation of the region selection process (lower). Columns should be selected in a clockwise direction starting from the top left corner. (B) Selection of reference flies for tracking accuracy. Any three reference flies were chosen for the analysis. (C) The DrosoMating home interface. In brief, “Open videos” to import the recorded mating video. “Run analysis” to initiate the analysis process. The progress bar indicates the status of the analysis. Export raw data by clicking “Export”.

Behavioral ethogram of courtship and copulation dynamics across individual wells.
Horizontal bars depict the temporal progression of male mating behaviors. Orange indicates courtship, red indicates copulation, and the x-axis represents time in minutes. Each row corresponds to a single well labeled with well ID on the left. Only wells with successful copulation are shown, sorted by courtship onset.

Basal locomotor activity of male flies from different strains.
(A) Average locomotor velocity of single-housed male flies from Canton-S, Oregon-R, w1118, and y1 strains measured in the absence of females. Velocity was quantified over time and plotted as mm per 10 s. Compared with Canton-S and Oregon-R controls, w1118 and y1 males exhibited reduced basal locomotor activity, indicating that general motor activity contributes to strain-dependent behavioral differences observed in mating assays.