README for genetic and incubation condition analysis in Diversity and Distributions manuscript DDI-2020-0295.R1 "Evolving thermal thresholds explain the distribution of temperature sex reversal in an Australian dragon lizard" --- SPECIMEN COLLECTION INFORMATION AND ANALYSIS Field_Pogona_Data.xlsx Contains collection information and collated environmental data (from the Scientific Information for Landowners dataset https://www.longpaddock.qld.gov.au/silo/) for the inferred incubation period for each individual. The first sheet in the excel workbook describes the data contained within each column, and this data is used in the "Inferred_Incubation_Conditions.R" script. pogona_dart_genlight RDS object containing the raw DArT-seq data for each of the specimens sequenced for population genetic analyses. This object is read into the R script "pogona_dart_analysis_Aug2020.R" for all subsequent analyses, mainly using the R package "dartR". pogona_dart_analysis_Aug2020.R R script containing the analyses used to investigate the population genetics of Pogona vitticeps. Based mostly on the functions within the R package dartR, uses the "pogona_dart_genlight" object. Inferred_Incubation_Conditions.R R script containing analyses used to investigate the association between sex reversal and inferred incubation temperatures. Uses the data in "Field_Pogona_Data.xlsx" silo_data_extraction.py Python code for the extraction of climatic data (SILO climate dataset) from relevant dates for each collected specimen. Uses data from "Field_Pogona_Data.xlsx" and relevant SILO climate netCDF files --- CONSTANT TEMPERATURE EQUIVALENT ANALYSIS Please note: detailed instructions on how to run each piece of code can be found within each piece of code's comments (primarily at the top and in the input parameters sections). This is an overview of the pipeline rather than a replication of those instructions. To go from climate data to CTE: 1: Climate data: Download elevation and SILO climate data (variables listed in the Castelli_MicroclimateAndCTE_RandomLocations.R file). This has been completed and climate data are provided in csv files with the prefix "randomlocations_". This includes temperature, rainfall, relative humidity, radiation and vapour pressure. 2: Wind data: Download the near speed wind data and format it as detailed in Castelli_NearSurfaceWindData_extraction.R. Run that file to extract the wind speed data for the locations and times of interest. 3: SLGA grids: Download the soil grids (.tiff) as documented in Castelli_MicroclimateAndCTE_RandomLocations.R 4: To go from climate data to soil temperature data (calculating the microclimate using NicheMapR): Open Castelli_MicroclimateAndCTE_RandomLocations.R. Follow the instructions within and change the input parameters to match the file paths on your computer. Run or source the file. 5: To go from soil temperature data to CTE: Open Castelli_SomaCTE_RandomLocations.R. Follow the instructions to update the input parameters to match your computer. Run or source this file to calculate the mean CTE per year (and the daily CTE if required). This file can be run sequentially (very slow), or in parallel (calculating multiple sites at once, much faster). It took about 5 days to process 1000 sites using 20 cores. 6: Figure1_SupplementaryData.xlsx Contains the constant temperature equivalent (CTE) estimates for each randomly selected location within the range of Pogona vitticeps (displayed in Figure 1 of the manuscript). The first sheet in the excel workbook explains the data contained within each column. This file contains the summarised output of the steps outlined above.