Skip to content

TGuillerme/landmark-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

landmark-test

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.

Analyses

The tables and figures present in the manuscript are all reproducible through the following scripts:

01 - Data preparation

This script contains all the procedure to modify and prepare the data in a format usable in the analysis below.

  1. Loading the landmark data
  2. Selecting the different landmark partitions
  3. Running the General Procrustes Analysis (geomorph::gpagen)
  4. Running the Principal Components Analysis (stats::prcomp)

This script is available here in Rmd or here in html.

02 - Landmark region difference

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.

03 - Landmark test analysis and 04 - landmark test analysis rarefied

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:

  1. Load the data generated by the script 01-Data_preparation above
  2. Calculates the range of variation in the Procrustes space (using the radius of the spherical coordinates)
  3. Running the random test with 1000 replicates using the area difference and the Bhattacharrya Coefficient as statistics
  4. 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).

05 - Results summary

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.

06 - Main analyses

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.

07 Heatplots

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.

08 Figures

Finally, this script was used to produce the figures 1 in the manuscript and can be found here in Rmd.

Checkpoint for reproducibility

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published