This repository contains code that reproduces the main analyses of the following study:
Dimitrios - Georgios Kontopoulos, Danielle L. Levesque, and Michael Hiller: Numerous independent gains of daily torpor and hibernation across endotherms, linked with adaptation to diverse environments. 2025. Functional Ecology.
To run the scripts in this repository, please first create "Data/" and "Results/" directories, outside "Code/". Inside Data/, place the files deposited in this Figshare repository.
Most scripts need to be run from the command line with some user-provided arguments. Specific instructions are provided at the top of each script. Note that some scripts will take more than a week to finish running and will require high amounts of memory (typically around 30-70 GB).
Given that some scripts depend on the outputs of other scripts, you can follow the order below as a rough guide (but also read the information at the top of each script):
- fit_Mk_variants.R
- fit_MCMCglmm_without_body_mass_corrections.R
- fit_MCMCglmm_without_body_mass_corrections_only_across_mammals.R
- fit_MCMCglmm_without_body_mass_corrections_only_across_birds.R
- extract_allometric_scaling_exponents.R
- fit_MCMCglmm_with_body_mass_corrections.R
- fit_MCMCglmm_with_body_mass_corrections_only_across_mammals.R
- fit_MCMCglmm_with_body_mass_corrections_only_across_birds.R
- extract_threshold_between_daily_torpor_and_hibernation.R
- extract_correlations.R
- run_phylogenetic_pca.R
- fit_Mk_variants_with_some_torpor_incapable_mammals_shifted_to_torpor.R
- fit_MCMCglmm_with_body_mass_corrections_with_some_torpor_incapable_mammals_shifted_to_torpor.R
- check_ESS_PSRF.R
- extract_torpor_probabilities.R