Companion Data Page The effect of environmental enrichment on behavioral variability depends on genotype, behavior, and type of enrichment Jamilla AkhundZade^{1,2}, Sandra Ho^{1,2}, Chelsea O'Leary^{1}, Benjamin de Bivort^{1} 1  Center for Brain Science and Department of Organismic and Evolutionary Biology, Harvard University, Cambridge, Massachusetts, USA. 2  contributed equally Manuscript PDF Preprint at bioRxiv Download all codes and data at Zenodo 

Raw Data 

CantonS_YmazeFlyVac_Data.zip 
Contains CSV files for Ymaze behavior and FlyVac behavior data collected for CantonS flies. predMatrix CSV files show the the enrichment treatments for Ymaze or FlyVac behaviors. To be used with Stan_Enrichment_(CSNormal/NumTurns/TrialTime).R to generate posterior distributions. 
AllGeno_YmazeFlyVac_Data.zip 
Contains CSV files for Ymaze behavior and FlyVac behavior data collected for CantonS and DGRP flies. To be used with Stan_Enrichment_(allGenoNormal/NumTurns/TrialTime).R to generate posterior distributions. 
Posteriors 

Posteriors_CantonS.zip 
RData files that contain posterior distributions for behavioral mean/variance for each enrichment treatment (control, mild, and intense) for CantonS data. Output from Stan_Enrichment_(CSNormal/NumTurns/TrialTime).R. To be used with Stan_Enrichment_PaperFigures.R and Stan_statisticalSignificance.R 
Posteriors_allGenotypes.zip 
RData files containing posterior distributions for the grand behavioral mean/variance/coefficient of variance and G, E, GxE effects from CantonS 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  
StanScripts.zip 
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 lightchoice. 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 interchoice interval. 
RScripts_Posterior.zip 
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  
RScripts_DataAnalysis.zip  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 36. 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. 