Analyses associated with the manuscript "Marine Phanerozoic biodiversity increased in presence of ecosystem engineers" by AT Cribb, SAF Darroch, and W Gearty. This manuscript is currently in revision and is in the process of being updated in accordance with reviewer suggestions. Do not use the scripts without contacting me first.
Contact: [email protected]
This repository contains all data and R scripts neede to reproduce the analyses and figures in the manuscript main text and suppelementary materials. You should run the analyses to generate new Output files in the Output folder created here. If you download this repository, set it as your working directory and everything should run smoothly. Should you have any questions or problems, or if you wish to make modifications for your own publication, please contact me at the email address above.
There are three .RData files in Data:
Bioturbators_data.RData- contains the bioturbator ecosystem engineering dataReef_Ecosystem_Engineers_Final.RData- contains the reef-builder ecosystem engineering dataPhanerozoic_clean_final.Rdata- contains the cleaned and stratigraphically binned (largely following Kocsis et al. 2019 ddPhanero protocol with additional cleaning of formation data) Phanerozoic data. The raw PBDB data was downloaded 1 November 2023. Using this dataset will reproduce the figures in the paper.
There is also a scotese_climate folder that contains a .csv file Scotese-2021_GATs1Myr.csv. These are global average temperatures for every one million years over the Phanerozoic extracted from Scotese et al. (2021) Phanerozoic paleotemperatures: The earth's changing climate during the last 540 million years. Please do not use this data without also appropriately citing Scotese et al. (2021).
There are two sets of Analyses: the main effect text analyses, and the supplemental analyses.
EffectSize_Bioturbation.R- calculates Hedges g effect sizes for bioturbation on biodiversityEffectSize_Reefs.R- calculates Hedges g effect size for reef-buidlers on biodiversity- Both of these scripts contain three different subsampling protocols based on how or if formations are subsampled. By default, these are set to 20 occurrences per formation beacuse that is what is used in the main analysis, but by un-commenting either of the other two options and the corresponding file save line at the end of the script, you can run the analyses with the other two subsampling methods we test. You will need to do all three for the sampling biases analyses. Save all data to your /Output folder that you created in your working repository.
- Also, note that these scripts calculate richness, Shannon's Diversity (H), and Simpson's Dominance. Only Shannon's Diversity is discussed in the manuscript, because it accounts for both richness and evenness together, but we have left each diversity metric in for any interested users.
Biodiversity_bioturbators.R- calculates 1. a gloabl generic richness curve of bioturbators, and 2. the number of genera whose FAD are in each stage. Data is subsampled to 150 occurrences per formation, which requires the removal of stages that do not meet that occurrence quota.Biodiversity_reefs.R- the same thing as above, but for reef-builders.
There are twelve scripts needed to produce the supplementary figures:
EffectSize_Bioturbation_Bathymetry_Deep.RandEffectSize_Reefs_Bathymetry_Deep.R- Effect size analyses for only deep marine palaeoenvironmentsEffectSize_Bioturbation_Bathymetry_Shallow.RandEffectSize_Reefs_Bathymetry_Shallow.R- Effect size analyses for only shallow marine palaeoenvironmentsEffectSize_Bioturbation_Environment_Carbonate.RandEffectSize_Reefs_Environment_Carbonate.R- Effect size analyses for only carbonate faciesEffectSize_Bioturbation_Environment_Siliciclastic.RandEffectSize_Reefs_Environment_Siliciclastic.R- Effect size analyses for only siliciclastic faciesEffectSize_Bioturbators_RemoveEEs.RandEffectSize_Reefs_RemoveEEs.R- effect size analyses if ecosystem engineers are removed from calculation of diversity metricsBioturbation_SamplingBiases.R- used to determine which formation subsampling method best reduces biases of sampling effort on effect sizes for bioturbatorsReef_SamplingBiases.R- uesd to determine which formation subsampling method best reduces biases of sampling effort on effect sizes for reef-buildersEffectSize_Bioturbation_SpatialSubsampling.RandEffectSize_Reefs_SpatialSubsampling.R- Effect size analyses using alternate equal-area grid normalization subsampling technique, as described in the methods section.- These analyses will reproduce supplemenetal figures x and y. You need to have run all three subsampling versions of the effect size analyses to use the sampling biases analyses scripts.
- By default, the plotting output scripts are set to use the results from subsampling 20 occurrences per formation, as this is what is used in the main text. Change what file you load if you want to see results for different subsampling methods.
Figures_Bioturbation_EffectSizes.R- plotting outputs for Figure 1 comparing biodiversity measurements per formation with and without bioturbators in each stage and effect size of the presence of bioturbators in each stage.Figures_Reef_EffectSizes.R- plotting outputs for Figure 2 comparing biodiversity measurements per formation with and without reef-builders in each stage and effect size of the presence of reef-builders in each stage.Figures_MassExtinctions.R- subsets and replots data for each mass extinction to create Figure 3Figures_Correlates_Diversity.R- uses the effect size outputs and ecosystem engineer diveristy outputs to create Figure 4 and Figure 5Figures_Correaltes_Climate.R- uses the effect size outputs and the Scotese et al. (2021) GATs to assess global temperature as a predictor of effect sizes to create Figure 6.Supplementary_Compare_Subsampling.R- supplementary figure comparing effect sizes between formation-based and equal area grid cell-based spatial subsampling approachesPlottingOutput_Supplementals.R- all other supplementary figure plotting scripts
+ updated cleaned datasets
+ uploading revision analyses: spatial subsampling, pooled ecosystem engineer analyses
+ uploading figure scripts for new supplemental figures + starting revision process+ add diversity and climate correlate analyses
+ add all supplementary effect size analyses variations
+ add new main text figure plotting output scripts
+ add supplemental figure plotting output scripts+ Update bioturbation dataset to include a small number of infauna which were not previously included
+ Update sampling bias analysis scripts to plot but linear and polynomial regressions more easily + Minor edits to plotting aesthetics, and fixing issue where effect sizes strength was not being assessed based on uncertainty bounds- remove weighed means/standard deviation because of lack of ability to consistently apply in each stage - with large iter, more likely to deal with n1=1 in stages where EEs are not dominant, where sd and thereby weighted means/sd cannot be calculated. Switching back to unweighted mean and standard deviation to opt for consistency. None of this impacts Hedges g.+ update effect size analyses to calculate weighted means and standard deviations for generic richness and Shannon's Diversity
- remove AIC tests from sampling biases analyses+ upload full PBBD dataset
+ update README to reflect new dataset upload
+ update README for Analyses and Plotting_Output
- remove DataClean in lieu of uploading PBDB data+ writing the README
+ uploading Analyses scripts