Companion Data Page

The effect of environmental enrichment on behavioral variability depends on genotype, behavior, and type of enrichment

Jamilla Akhund-Zade1,2, Sandra Ho1,2, Chelsea O'Leary1, Benjamin de Bivort1

1 - Center for Brain Science and Department of Organismic and Evolutionary Biology, Harvard University, Cambridge, Massachusetts, USA.

2 - contributed equally

Manuscript PDF
Pre-print at bioRxiv
Download all codes and data at Zenodo

Raw Data Contains CSV files for Y-maze behavior and FlyVac behavior data collected for Canton-S flies. predMatrix CSV files show the the enrichment treatments for Y-maze or FlyVac behaviors.

To be used with Stan_Enrichment_(CSNormal/NumTurns/TrialTime).R to generate posterior distributions. Contains CSV files for Y-maze behavior and FlyVac behavior data collected for Canton-S and DGRP flies.

To be used with Stan_Enrichment_(allGenoNormal/NumTurns/TrialTime).R to generate posterior distributions.

Posteriors RData files that contain posterior distributions for behavioral mean/variance for each enrichment treatment (control, mild, and intense) for Canton-S data. Output from Stan_Enrichment_(CSNormal/NumTurns/TrialTime).R.

To be used with Stan_Enrichment_PaperFigures.R and Stan_statisticalSignificance.R RData files containing posterior distributions for the grand behavioral mean/variance/coefficient of variance and G, E, GxE effects from Canton-S and DGRP data. Output from Stan_Enrichment_(allGenoNormal/NumTurns/TrialTime).R.

To be used with Stan_Enrichment_PaperFigures.R and Stan_statisticalSignificance.R

R and Stan analysis scripts

generate posterior distributions Archive .zip file containing Stan scripts necessary to run the sampler from the R interface. These Stan scripts are called by the Stan_Enrichment_(CSNormal/allGenoNormal/NumTurns/TrialTime).R scripts to generate posterior distributions.

Stan_Enrichment_(CSNormal/allGenoNormal).R call on CS_NormalModel.stan and allGeno_NormalModel.stan, respectively, to generate posteriors for turn bias, switchiness, clumpiness, and light-choice.

Stan_Enrichment_NumTurns.R calls on CSymazeNumTurn_NegBin.stan and allGeno_NegBinModel.stan to generate posteriors for number of turns.

Stan_Enrichment_TrialTime.R calls on CSFlyVac_Gamma.stan and allGeno_GammaModel.stan to generate posteriors for inter-choice interval. Archive .zip file containing R scripts necessary to generate the posterior distributions. Call on Stan scripts to run the sampler. Input to sampler comes from the raw data: (i) an outcome vector (ii) predictor matrix that specifies the treatment contrasts. R scripts take the raw data input, transform it into input for Stan, run the sampler, save the output, and also run posterior predictive checks.

Note: sampler parameters may change slightly depending on the behavior analyzed to achieve optimal sampling - adapt_delta can either be 0.8 or 0.9 and max_treedepth can be either 10 or 15. If warnings are generated, follow the link to diagnose.
data analysis + figure generation Archive .zip file containing R scripts and Stan scripts necessary to generate the data and figures presented in the manuscript. Takes posterior distributions as input. Stan_Enrichment_PaperFigures.R generates posterior distribution for coefficient of variance, modifies contrasts, and calculates average effect magnitudes in order to make Figures 3-6. Stan_statisticalSignificance.R calculates credible intervals on the posteriors provided; some preprocessing in Stan_Enrichment_PaperFigures.R is necessary and is specified in the script comments.