DOI: 10.6084/m9.figshare.26310574
title: Scratching beyond the surface: examining macroecological patterns in avian eggshell texture

description: <b>Data and R scripts for </b><b>Marie R. G. Attard</b><b>,</b><b> </b><b>James Bowen</b><b>,</b><b> </b><b>Steven J. Portugal (2025) Scratching beyond the surface: examining macroecological patterns in avian eggshell texture.</b><b> </b><b><i>J R Soc Interface</i></b><b> </b><b>22 (232): 20240527.</b><b> </b><b>https://doi.org/10.1098/rsif.2024.0527</b>The dataset and accompanying R scripts are organised into three subfolders within the eggshell-texture zipped folder. This study utilised previously blown whole eggshells from 486 bird species, sourced from the Class II collection at the Natural History Museum, Tring (NHM, UK), and the destructive eggshell collection at the Western Foundation of Vertebrate Zoology, Camarillo (WFVZ, USA). The eggshells, intended for scientific research, were cleaned using damp cotton buds to remove surface dirt. Surface topography was analysed using three measures: roughness (<i>S</i><sub><em>a</em></sub>), skewness (<i>S</i><sub><em>sk</em></sub>), and kurtosis (<i>S</i><sub><em>ku</em></sub>). <i>S</i><sub><em>a</em></sub> represents the average height variations on the surface, providing an index of smoothness or roughness. <i>S</i><sub><em>sk</em></sub><sub> </sub>measures the distribution of surface features: positive values signify a predominance of peaks, while negative values indicate a greater presence of valleys. <i>S</i><sub><em>ku</em></sub><sub> </sub>assesses the geometry of these features, with values exceeding 3 suggesting the presence of sharp peaks or deep troughs, and values below 3 indicating a flatter, more uniform surface.<b>Profilometry measures of surface texture</b>The surface topography of eggshell surfaces was obtained using a three-dimensional non-contacting optical profilometer (DCM 3D, Leica Microsystems, Germany) connected to a white light interferometric microscope. For each eggshell fragment, a section along the surface was scanned at three non-overlapping locations at a focal depth of 100 μm (100 focal planes at 1 μm resolution) using the 20x objective magnification to give a measurement area of 636.61 x 477.25 μm<sup>2 </sup>(pixel<sup> </sup>resolution = 768 x 576). <i>S</i><sub><em>a</em></sub>, <i>S</i><sub><em>sk</em></sub> and <i>S</i><sub><em>ku</em></sub> are based on surface height distribution and are scale-dependent. The same scanning parameters and magnification were applied to all eggshells scanned, therefore, direct comparisons of surface texture between specimens requires that the measurement scale and the sampling interval remain the same.The foreground and background pigment of maculated eggshells were scanned separately at three randomly selected non-overlapping locations. In contrast, eggshells from immaculate eggs and densely speckled eggs— which were too difficult to divide into foreground and background pigments— were scanned at three randomly selected, non-overlapping locations. Each scan (total 7013 scans) was processed using the Scanning Probe Image Processor (SPIP) software (version 4.4.3.0, Image Metrology, Hørsholm, Denmark) to quantify <i>S</i><sub><em>a</em></sub>, <i>S</i><sub><em>sk</em></sub> and <i>S</i><sub><em>ku</em></sub>. We used the plane correction tool to automatically correct plane distortions in the data by using polynomial functions to fit the surface topography. In this case, a second-order polynomial was used as the slope on the data was approximately spherical, then the lowest z-value was adjusted to 0 nm. These corrections helps eliminate artifacts caused by sample tilt or uneven surfaces, ensuring that the quantitative measurements of surface features are accurate and reliable.When using an interferometer to scan curved eggshells, we occasionally encountered missing pixel height data due to several factors. The curvature of the eggshell can create varying angles of incidence for the light used in interferometry; if the angle becomes too steep, it may result in low reflectivity and consequently missing data. Additionally, this curvature can cause sections of the surface to fall out of the focal plane or misalign with the beam path, leading to gaps in the pixel data. Our scans were taken under a narrow focal plane, so the centre of the field of view usually captured the topography well and were suitable for inclusion in the analysis, even where pixel information was absent around the scan edges. Since interferometry relies on coherent light, any variations in surface texture can disrupt interference patterns. Rough or imperfect surfaces may generate noisy data or result in the loss of coherence, contributing to missing pixels. To address these issues, we meticulously inspected each eggshell surface scan with less than 40% pixel coverage for irregularities in SPIP. This inspection revealed that areas at the corners or sides of the rectangular scanning region often lacked pixel data, as these sections typically fell outside the focal plane. If sufficient data remained within the focal plane, those scans were cropped to remove low-quality regions for analysis. Conversely, scans exhibiting extensive pixelation were deemed indicative of surface imperfections, such as dirt or other obstructions, leading to noisy data, and were subsequently excluded from our analysis.<br><b>Subfolder 1: Data</b>This folder contains raw and processed data related to the study.<b>eggshell_texture_raw data: </b>eggshell_topography_raw_data.csv includes raw surface topography data, encompassing scans from multiple eggs per species, where available.<b>bird_lifehistory: </b>bird_lifehistory.csv contains life-history traits for each bird species and their sources.<b>eggshell_wettability: </b>species_eggshell_wettability_data.csv contains eggshell wettability measurements from Attard et al. 2021 Ecological drivers of eggshell wettability in birds. J R Soc Interface. 18: 20210488. doi: 10.1098/rsif.2021.0488.<b>eggshell_conductance_data: </b>species_eggshell_conductance_data.csv contains eggshell conductance measurements from Attard and Portugal 2021 Climate variability and parent nesting strategies influence gas exchange across avian eggshells. Pro Bio Sci. 288(1953): 20210823. doi: 10.1098/rspb.2021.0823.<b>phylogenetic_tree:</b>Hackett_phylogenetic_tree.nex provides avian phylogenetic trees constructed via <b>http://www.birdtree.org</b> using the Hackett et al. (2008) backbone tree. Ten thousand trees were generated, encompassing all species in this study.BLIOCPhyloMasterTax.csv lists all species included in the tree based on the backbone from Hackett et al. (2008).<b>Subfolder 2: R Scripts</b>Five R scripts were developed for data analysis and visualisation:<b>1_RMarkdown_Extract_Eggshell_Topography.Rmd:</b><br>Processes raw topography data and performs key analyses:Surface texture profiles from brood parasites were excluded from analysis as they have specific eggshell adaptations to suit their unique breeding strategy. Brood parasite values are in the raw data.Removes low quality (less than 40% pixel coverage) scans.Identifies and excludes influential values based on Cook's distance. For species represented by a single egg, any influential specimen was excluded from the analysis. For species represented by multiple eggs, if all specimens were identified as influential, all were retained for analysis. However, if only a portion of a species’ eggs were identified as influential, those influential specimens were excluded from further analysis.Generates a maximum clade credibility tree (species_surface_texture_phylogenetic_tree.nwk) for phylogenetic analyses.Produces specimen- and species-level topography mean values (specimen_texture_lifehistory_data_for_MCMCglmm.csv and species_surface_texture_lifehistory.csv).Assesses predictor collinearity using pairwise comparisons and Variance Inflation Factors (VIF).Creates hybrid boxplots and scatterplots for influential life-history traits.<b>2_RMarkdown_MCMCglmm.Rmd:</b><br>Uses specimen_texture_lifehistory_data_for_MCMglmm.csv and species_surface_texture_phylogenetic_tree.nwk to evaluate the impact of life-history traits on eggshell texture for 460 species through MCMCglmm modelling. Results are saved in the MCMCglmm folder under three levels per texture measure.<b>3_RMarkdown_Tree_Figure.Rmd:</b><br>Generates phylogenetic tree diagrams for <i>S</i><sub><em>a</em></sub>, <i>S</i><sub><em>sk</em></sub>, and <i>S</i><sub><em>ku</em></sub>, highlighting influential categorical predictors.<b>4_RMarkdown_MCMCglmm_Posterior_Predictions_HPC.Rmd:</b>Produces posterior predictions for eggshell surface traits, generated from MCMCglmm models across all combinations of life-history predictors.Continuous predictors binned into 3 equally spaced values; all categorical combinations included.All table outputs are saved under eggshell-texture/output/MCMCglmm_HPC/ folder, including predictions. There is one file per eggshell surface trait (1,048,575 rows) representing posterior predictions for every predictor combination.Predictions computed in 500-row batches; posterior means and 95% HPDIs extracted..Analysis run on the British Antarctic Survey HPC (SLURM; 160 GB RAM, 2 cores) in a Conda environment called <i>eggshell</i>, which contained R. Required packages are listed in the R script.<b>5_RMarkdown_MCMCglmm_Posterior_Predictions_Figure.Rmd:</b>Plots showing posterior density, credible intervals (50%, 80%, 95%) and median for all significant predictors identified in '<b>2_RMarkdown_MCMCglmm.Rmd'.</b>Figures saved under eggshell-texture/output/Figures/.<b>Subfolder 3: Output</b>This folder contains results and visualisations from the R scripts, organised into the following subfolders:<b>Body_mass: </b>Phylogenetic Generalised Least Squares (PGLS) results showing body mass effects on <i>S</i><sub><em>a</em></sub>, <i>S</i><sub><em>sk</em></sub>, and <i>S</i><sub><em>ku</em></sub>.<b>Conductance:</b> Phylogenetic Generalised Least Squares (PGLS) results for eggshell conductance's influence on <i>S</i><sub><em>a</em></sub>, <i>S</i><sub><em>sk</em></sub>, and <i>S</i><sub><em>ku</em></sub>.<b>Cooks_distance:</b> Plots of influential values based on Cook's distance.<b>Correlation:</b> Pairwise correlation plots and VIF results.<b>Figures:</b> Phylogenetic trees, hybrid boxplots and posterior predictor distributions from MCMCglmm.<b>MCMCglmm:</b> Results for releveling categorical variables in MCMCglmm to complete pairwise comparisons using 2_RMarkdown_MCMCglmm.Rmd.<b>MCMCglmm_HPC: </b>Posterior predictions for eggshell surface traits generated from MCMCglmm models across all combinations of life-history predictors. To manage computational demands, reduced MCMC settings were used (80,000 iterations, burn-in of 20,000, thinning interval of 500), with only the prediction outputs retained for analysis. Predictions were produced using the script 4_RMarkdown_MCMCglmm_posterior_mean_HPC.Rmd on a high-performance computing cluster (SLURM scheduler; 160 GB RAM, 2 cores).<b>Phylogenetic_Comparative_Analysis_data:</b> Data for MCMCglmm, phylogenetic signal, and PGLS analyses.<b>Phylogenetic_signal:</b> Results for <i>S</i><sub><em>a</em></sub>, <i>S</i><sub><em>sk</em></sub>, and <i>S</i><sub><em>ku</em></sub> phylogenetic signal.<b>Repeatability:</b> Tested the repeatability of each eggshell texture measurements by conducting a repeatability test for multiple measures at different locations on the same fragment. Repeatability tests were conducted separately for for immaculate and maculate eggs (foreground and background pigments analysed separately). Scans of maculated eggs were cropped to isolate either the foreground or background pigment. These repeatability tests evaluated variability in surface texture across 3 or more scans at different locations on the same egg for the maculation or pigment type being analysed.<b>Wettability:</b> Phylogenetic Generalised Least Squares (PGLS) results for the influence of contact angle and spreadability on <i>S</i><sub><em>a</em></sub>, <i>S</i><sub><em>sk</em></sub>, and <i>S</i><sub><em>ku</em></sub>. All wettability measures (contact angle and spreadability) were from Attard et al. 2021.<br>