This file describes how to reproduce the analysis of "Identification of the Mode of Evolution in Incomplete Carbonate Successions"
Niklas Hohmann
Utrecht University
email: [email protected]
Web page: uu.nl/staff/NHohmann
Orcid: 0000-0003-1559-1838
There are multiple ways to reproduce and repeat the study:
- Full reproduction, where all data is generated anew from scratch
- Inspection of the provided data
- Reproduction of figures alone
Each point is described in a separate step, and can be performed independently
- Clone the "scenarioA" branch of the CarboCAT lite repository from here.
- Run the file "carbocatGUI.m" in Matlab
- Click initialize in the GUI. The GUI after initialization is saved under "figs/matlab/scenarioA_initial_conditions.pdf" and serves as the basis for fig S1.
- Click "Run CA model". This will start the model run, progress is displayed in the console.
- Once the console outputs indicates the run is finished, save your workspace. The generated data is identical to the data saved under "data/matlab_output_scenarioA_matlab_outputs.mat". It constains all the raw data generated by CarboCAT.
- Click "Plot run" to generate the chronostratigraphic chart and dip section saved under "figs/matlab/scenarioA_dip_section_and_chronostrat.pdf". This might take a while.
Repeat for the branch scenarioB to generate the data for scenario B.
- In the folder data -> matlab_outputs, run "get_adm_from_carbocat_outputs.m" in matlab. This generates the file "scenarioA_and_B_matlab_to_R.mat", which can be read into R.
- Open RProj "CarbStratPalEvo"
- Run process_adm_from_matlab.R to import the ADMs into R. This will generate the file data/R_outputs/ageDepthModelsScenariosAandB.Rdata
Open the project "blblb" in Rstudio
All produced data is in the folder /data/. For a detailed description of the data structure and contents see the file /data/R_outputs/codebook.md (for outputs from R) and /data/matlab_outputs/codebook.md (for outputs from matlab)
To reproduce the figures in the main test and supplementary material, open the R project, and run
source("code/make_plots.R")
This will use the data in /data/R_outputs/ to generate summary figures in the folder /figs/R/
NOTE: Only the figures displaying AIC weights make use of the test results stored in /data/R_outputs/results_modes_of_evolution.Rdata. All lineages are simulated anew when make_plots is run. To make the plots reproducible, they can be seeded via the parameter plot_seed.
This is a result of the study design. The tests simulate lineages at a specific basin position. Because trait values are random, this makes it impossible to compare identical simulated lineages across multiple basin positions. This problem is circumvented in the functions used for plotting, see /code/make_plots.R for details.