Authors: Vera Weisbecker, Thomas Guillerme, Cruise Speck, Emma Sherratt, Hyab Mehari Abraha, Alana C. Sharp, Claire E. Terhune, Simon Collins, Steve Johnston, Olga Panagiotopoulou
This repository contains all the code and data used in the manuscript:
Weisbecker, V., Guillerme, T., Speck, C. et al. Individual variation of the masticatory system dominates 3D skull shape in the herbivory-adapted marsupial wombats. Front Zool 16, 41 (2019) doi:10.1186/s12983-019-0338-5
This repo is based on code from the landvR
package.
The tables and figures present in the manuscript are all reproducible through the following scripts:
This script contains all the procedure to modify and prepare the data in a format usable in the analysis below.
- Loading the landmark data
- Selecting the different landmark partitions
- Running the General Procrustes Analysis (
geomorph::gpagen
) - Running the Principal Components Analysis (
stats::prcomp
)
This script is available here in Rmd or here in html.
This vignette (or here in html) describes in details the test used to compare different regions of landmarks in geometric morphometrics.
This example uses the plethodon
dataset from the geomorph
package as an illustration.
The same test applied to our dataset is available in the following scripts 03
and 04
below.
These scripts runs the full landmark test analysis on each tested partition for each dataset (cranium and mandible) with and without rarefaction. In brief, for each partition within each dataset and each species/genus/genera, the script does:
- Load the data generated by the script
01-Data_preparation
above - Calculates the range of variation in the Procrustes space (using the radius of the spherical coordinates)
- Running the random test with 1000 replicates using the area difference and the Bhattacharrya Coefficient as statistics
- Saving the test results in
../Data/Results/
and saving the results figures and tables in../Manuscript/Tables/
and../Manuscript/Figures/
This is done through the pipeline.test
function available in ../Functions/utilities.R
These script take some time to run (~30 min each) and will automatically save data in ../Data/Results/
.
If the results are already computed, it is possible to run the script faster by commenting out the lines containing:
results <- pipeline.test(species, dataset, "../Data/Processed/", [...])
save(results, file = paste0("../Data/Results/", species, [...]))
And un-commenting the lines containing:
load(file = paste0("../Data/Results/", species, "_", [...]))
The test run for either the 100% confidence interval or the 95% confidence intervals.
To switch between both, you can search and replace CI = 0.95
and CI95
by respectively CI = 1
and CI100
or the other way around.
This script is available here in Rmd (here for the rarefied).
This script produces the figure 4 in the manuscript and the tables in the supplementary materials. This script is available here in Rmd or here in html.
This script contains the Procrustes distances analysis and covers the allometry analysis, the linear models and the partial least squares analysis. It was used to produce tables 1 and 2 in the manuscript. This script is available here in Rmd.
This script contains the code for producing the landmark variation heaplots (figures 2 and 3).
The script is based on a modified version of the function geomorph::plotRefToTarget
.
This script is available here in Rmd.
Finally, this script was used to produce the figures 1 in the manuscript and can be found here in Rmd.
To rerun all the code with packages as they existed on CRAN at time of our analyses we recommend using the checkpoint
package, and running this code prior to the analysis:
checkpoint("2018-06-15")
The analysis were run on two different machines.
For reproducibility purposes, the output of devtools::session_info()
used to perform the analyses in the publication for the analysis 03-Landmark_test_analysis.Rmd
, 04-Landmark_test_analysis_rarefied.Rmd
and 05-Results_summary.Rmd
is available here.
The devtools::session_info()
used to perform the analyses in the publication for the analysis 06-Main_Analyses.Rmd
, 07-heatplots.Rmd
and 08-Figures.Rmd
is available here.
The other analysis where run on both machines.