DOI: 10.5061/dryad.mkkwh718t
title: Data from: Tempo and mode of winter diapause evolution in butterflies

description: Quantifying the tempo and mode via modern phylogenetic comparative methods
 can provide key insights into how selection and constraints shape trait
 evolution on a macroevolutionary time scale. Here we elucidate the
 evolution of hibernation (winter) diapause, a complex and defining
 life-history trait that allows temporal escape from harsh winters in
 temperate regions in many insects, including our model system,
 butterflies. Butterflies can diapause in all major life-stages and
 availability of global-scale phylogenies makes them an ideal model system
 for studying diapause evolution. First, using a thorough literature
 survey, we scored the developmental stage of hibernation diapause (egg,
 larva, pupa, adult) vs. absence of diapause. We find that larval diapause
 is most common while pupal, egg, and adult diapause are relatively rare.
 Next, we determined that the loss of diapause occurred at a much higher
 rate, and that gains primarily occurred from the non-diapause state. While
 ancestral state estimation at deeper nodes remained uncertain, we found
 consistent patterns for some families and strong evidence for extensive
 convergence in diapause evolution. Contrary to expectations, we find no
 support for increased gain of diapause during the Eocene-Oligocene
 glaciation (~35 MYA). Overall, the evolution of diapause in butterflies
 has a complex history, has evolved convergently, and has likely pre-dated
 the major glaciation event consistent with the deep history of diapause
 evolution in insects. This study advances our understanding of the
 evolution of a complex and important life-history trait and establishes a
 macroevolutionary base for future studies on the ultimate and proximate
 basis of diapause evolution.
description: The data comprises the developmental stage in which butterflies
 diapause (i.e. egg, larva, pupa, adult) or do not diapause, and was
 collected by literature search. The diapause classification was scored at
 the genus level. Next, using the phylogenetic comparative methods, mainly
 models for modelling the evolution of discrete traits or Mk models, a
 range of analyses were performed, for example, quantifying the rate of
 transition between states, ancestral state estimation, rate through time,
 etc. Please refer to the Methods section in the paper for more details.
 All analyses data analyses were performed in R.
description: # Tempo and mode of diapause evolution in butterflies Sridhar Halali, Etka
 Yapar, Christopher W Wheat, Niklas Wahlberg, Karl Gotthard, Nicolas
 Chazot, Sören Nylin, Philipp Lehmann Dataset and R codes for modelling
 diapause evolution in butterflies Summary of the contents ## Trait data *
 `diapause_classification_data_RAW.xlsx`: This file contains raw data for
 five, three and binary diapause classification along with the data on tree
 id (as in the phylogeny), species, genus, and references used for diapause
 classification. Note that the full citations corresponding to these
 references are provided in the supplementary information. All the columns
 are self-explanatory and contain information on the tip labels in the
 phylogeny, genus, species and species family followed by five, three and
 two-state diapause classification. Note that there are ’NA’ rows in the
 ‘tree_species’ column which simply means that the species name for that
 specific genus is not known. *
 `diapause_classification_data_PROCESSED.xlsx`: This file contains the data
 on diapause classification but has been processed (e.g. by removing ‘skip’
 and ‘skip_high_altitude’ rows from ‘diapause_classification_data_RAW.xlsx’
 file) for phylogenetic comparative analyses. Note that there are ’NA’ rows
 in the ‘tree_species’ column which simply means that the species name for
 that specific genus is not known. ## Phylogenies *
 `S_3b_core_analysis_median_ages.tre`: Global genus-level phylogeny
 obtained from Chazot et al. [1] * `butterfly_phylogeny_pruned.trees`: This
 is a pruned phylogeny (from the global phylogeny from Chazot et al [1])
 consisting of 952 tips ready for running the comparative analyses. *
 `ButterflyPhyloMulti_pruned.trees`: This is a pruned phylogeny with 952
 tips consisting of 200 posterior trees from Chazot et al. [1] ## R Scripts
 * `Preprocessing data & some plots.Rmd`: Code for processing raw data
 (e.g. renaming some columns/diapause classification), pruning phylogeny
 and making some basic plots * `Fitting Mk models, simmap & ancestral
 state estimation_phytools.Rmd`: Code for fitting the Mk models, extracting
 transition rates, carrying out stochastic mapping and ancestral state
 estimation using both maximum likelihood and stochastic mapping in
 phytools R package * `Counting transitions & rate through time.Rmd`:
 Code for counting number of state transition (using 1000 stochastic maps)
 and calculating rate through time * `Fitting hidden rate
 models_corHMM.Rmd`: Code for fitting several hidden rate models using the
 corHMM R package. * `Plotting uncertainty in ancestral estimation.Rmd`:
 Code for calculating the uncertainty in ancestral state estimation across
 methods and root priors using the sum of squares metric *
 `source_rate_through_time_Hughes_et_al_2021.R`: R code provided by Hughes
 et al. [2] (code available here:
 [https://github.com/jakeberv/mammal_arboreality](https://github.com/jakeberv/mammal_arboreality)) for calculating rate through time for both single and using posterior trees. * `getRates_modified_Etka_Yapar.R`: modified function from Hughes et al. [2], mainly to plot 95% CI on points, when stochastic maps are generates for a single best (e.g. consensus) tree. \[1] Chazot, N., Wahlberg, N., Freitas, A. V. L., Mitter, C., Labandeira, C., Sohn, J. C., ... & Heikkilä, M. (2019). Priors and posteriors in Bayesian timing of divergence analyses: the age of butterflies revisited. Systematic biology, 68(5), 797-813. \[2] Hughes, J. J., Berv, J. S., Chester, S. G., Sargis, E. J., & Field, D. J. (2021). Ecological selectivity and the evolution of mammalian substrate preference across the K–Pg boundary. Ecology and Evolution, 11(21), 14540-14554.