Data and code from: The inversion In(2L)t impacts complex, temperature-sensitive behaviors in Drosophila melanogaster
Data files
Jul 17, 2026 version files 81.72 MB
-
In_2L_t_behavior_Drosophila-main.zip
81.71 MB
-
README.md
8.51 KB
Abstract
Genetic variation in behavioral traits allows organisms to respond and adapt to environmental challenges. Genetic variation in behavior is often affected by many genes and thus has a complex genetic basis. Inversions, the reorientation of genes along the chromosome, tightly link genetic variants together because they suppress recombination. Therefore, inversions are believed to have a major impact on phenotypic variation because they combine the effects of multiple genes, which can pleiotropically alter multiple aspects of behavior. This study investigates how the inversion In(2L)t, found in Drosophila melanogaster populations around the world, impacts different aspects of behavior in an environment-sensitive manner. We test the activity, locomotion, and startle-induced behavior of flies with different In(2L)t genotypes across sex and temperatures. We observe that Drosophila homozygous for In(2L)t spend more time active, spend more time away from a source of food, and have a smaller intensity of startle response than flies heterozygous for the inversion or homozygous for the standard arrangement. Additionally, the impacts of In(2L)t on aspects of behavior can be sex-specific and are largely consistent across temperatures. Taken together, our research demonstrates that inversions can regulate aspects of behavior, and suggests hypotheses explaining the distribution of In(2L)t across space and time.
This dataset: In_2L_t_behavior_Drosophila-main.zip contains the data and scripts for the 2026 publication on In_2L_t's impact on D. melanogaster behavior. We have included the scripts used for analyzing the fly position data, constructing activity and startle response phenotypes, statistical analysis, and figure creation.
We have also included the raw position data annotated with the fly genotypes, in addition to phenotype data that is organized at the individual level. We have included the simplified data objects used to reconstruct the figures used in the publications.
Additionally, we include the script for our re-analysis of Lee 2017 along with the relevant data from this publication.
Note on data: The majority of data objects are .RDS files created using the base R saveRDS(), which is a function intended to create space-efficient storage. They can be read using readRDS(). The exception is foraging.csv, which can be read with the fread() command from data.table.
Description of the data
Pipeline: Scripts 01-03. – Inputs exp[1-3]behaviordataRAW, output exp[1-3]behaviordataPROCESSED
Reads in the locomotion data from the DART, and estimates the baseline speed of individual flies before the first stimulus, their duration of startle response after each stimulus, and their magnitude of startle response after each stimulus. Saves individual, stimulus-specific data.
Script 04. – Inputs exp[1-3]behaviordataPROCESSED, output activity.startle. phenotypes.FINAL and figuredataFINAL
Combines the three locomotion phenotypes, finds average phenotypes at the individual level, organizes the data for analysis, and saves data ready for modeling and figure creation
Script 05. Inputs sleepexp[1-3]RAW , output sleepdataFINAL
Reads in the sleep data from DART and organizes the sleep phenotypes at the individual level. Combines data across experiments, and saves the output in a form ready for modeling.
Scripts 06-08. Inputs exp[1-3]positionsRAW, output Input exp[1-3]positionsPROCESSED
Reads in the fly position data from DART, and calculates the proportion of time the flies spend in each region of the holding tube. This position phenotype data is saved at the individual level.
Script 09. Inputs exp[1-3]positionsPROCESSED, output positionsFINAL
Combines the three experiments' worth of position phenotypes, and saves into a file format used for both modeling and figure creation
Script 10. Inputs activity.startle phenotypes.FINAL, sleepdataFINAL, and positionsFINAL
Performs the modeling analysis of the paper, and outputs results in summary tables. First, the script loads in the individual level for the 6 phenotypes being considered, and performs final data organization prior to modeling. Next, the script constructs a series of 8 models for each trait: A null model, sex model, inversion genotype model, and interaction model for flies of both sexes at 25C, and a null model, temperature model, inversion genotype model, and interaction model for female flies at all temperatures. Models are compared, and the summary statistics of the likelihood ratio tests are saved for each model comparison. The summary statistics for the sex-specific and temperature-specific model comparisons are saved as .csv files.
Script 11. Inputs activity.startle phenotypes.FINAL, sleepdataFINAL, and positionsFINAL
Performs the t.test analysis of differences across groups in the data. Similarly to before, the individual-level data for the 6 phenotypes is loaded again, and merged into one data object. T.tests are performed across every genotype group, within each temperature, within each sex category, and within each phenotype. Summary statistics of each test are aggregated, and then multiple-testing correction is applied. For phenotype-environment conditions where modeling revealed a significant effect, t.test summary statistics are manually observed and incorporated into the manuscript.
Script 12. Inputs dgrpreftable.gz & foraging.csv
This script loads in the foraging data from Lee et al., 2017, as well as the inversion genotype data for the DGRP lines, to append the inversion status to the Lee dataset. Then, the script checks if In(2L)t presence alters the foraging behavior observed, and reports the results.
Script 13-15. Inputs, figuredataFINAL & positionsFINAL
Creates the publication figures. Loads in theindividual-levell phenotype data, and creates one layer a) that finds the mean and 95% confidence intervals for the given phenotype across sex, genotype, and temperature groups, and a second layer b) that shows the raw phenotype data. Both layers are graphed together to illustrate differences in phenotype across experimental groups, as well as distributions within the raw data. Significant differences are marked by the inclusion of brackets, with aasterisksoften added in later by image editing.
Description of columns in repository data objects.
(some columns will appear in multiple objects)
- Activity- the speed of the individual (mm/s) at the given point in time.
- Basal.act, mean.base - the mean activity of the fly (mm/s) over 1 hour prior to first stimulus
- Bout Duration – the average duration of a given bout of inactivity (minutes)
- Day, day.x, day.y – the day of a given experiment data is reported from
- DGRP, DGRP strain- the ID # of the fly lineage from the Drosophila Genetic Research Panel
- Duration- the time in seconds from the stimulus to when the fly’s activity returns to baseline
- End.time- the timepoint in the experiment when the fly’s activity returns to baseline
- Exp- the identification number of which of the experiments this data is reported from
- Fly, Fly Index- initial identifiers of individual flies supplied by DART
- Flyid, flyidfull, flyid.total- Identifiers of individual flies unique across all data- including information on day and experiment #.
- Geno, genotype – the genotype of the individual described by way of the parents used in this F1 cross.
- Group, order- a categorical variable to describe which of the regions of the DART this individual was placed within
- Hour- the time of the experiment this data is reported from, in units of hours
- Intensity- a measure of the intensity of the stimulus, measured in the DART’s own parameter setting
- Inv.st- a classification of the In(2L)t genotype of this individual
- Inversion_(X)_NA, gives the genotype of inversion X for a given lineage. Different column for each inversion listed for X.
- Mean.duration- the average duration (seconds) of a startle response, across each stimulus for an individual
- Mean.peak- the average magnitude (delta in mm/s) of a startle response, across each stimulus for an individual
- Median- the median of the time (hours) during a specific window, to help parse the stimulus events.
- N_region- a count of the number of rows of a given dataframe that fit within each of 8 regions
- Peak.act, peakact , scaled.act– The magnitude of startle response for an individual (delta mm/s)
- Peak.time – the time (hours) of peak activity following immediately following a stimulus
- Phenotype, traits- a categorical variable referring to one of several traits being analyzed
- Region- a categorical variable referring to the 8 regions that evenly divide the fly’s arena
- Region.prop – the proportion of time the fly spends within a given region
- Sex- the biological sex of the individual
- Sleep Bout – the mean number of sleep bouts within an hour
- Sleep Duration – the mean duration of time spent inactive (minutes per hour)
- Sleep.scaled – the z score of sleep Duration (sleep duration – mean (sleep duration) / sd(sleep duration)
- Startle, startle.number. startle2 – ways of numbering different stimulus events within an experiment
- Starvation resistance index – a measurement of success in foraging
- Stimulus – a categorical variable for high or low intensity stimulus
- Temp – the temperature (Celsius) during which the data was reported
- Time – the time (seconds) from which given data is reported
- Value – in some instances, multiple phenotypes are combined into one column (see Phenotype description), and the corresponding trait values are shown here
- WolbachiaStatus_NA – a categorical variable showing the presence or absence of Wolbachia in a given DGRP line (according to existing reference data tables).
