All code is made available for reproducing the analyses as described in [insert paper URL here]. This is code only, for full completed dataset click here (not yet available).
The analysis comes in four stages:
Each stage is run once with the exception of B1_parse.R, B2_compare.R and B3_metrics.R
which are each run twice for comparing the results from unconstrained and constrained
pG-lt trees and testing whether there is a difference between total and age
branch length normalisation.
Make sure all relevant packages are installed:
Rscript x_install_deps.R
Additionally, you will need a compiled version of pathD8 in your working directory.
To run entire automated pipeline (UNIX OS):
sh x_run.sh
pG-lt step can only be run separately. It was originally run on Imperial's HPC.
Make sure you have 0_pglt/ before running the calculate step.
C1_analysis.R is an interactive script and it not part of the pipeline.
Note, setup will take a long time to run as they interact
with the GNR.
This is run with the x_setup.sh script. You can run pG-lt after it is run.
A1_presolve.R: read in published trees and PREDICTS data, search names against GNR.A2_parse.R: read in published trees and rate-smoothA3_pgltsetup.R: identify suitable PREDICTS studies, output into pG-lt friendly format. You can run pG-lt with the resulting folder.A4_map.R: use published phylogenies in0_datato generate study-level phylogenies
This is run with the x_calculate.R script.
B1_parse.R: read in pG-lt and mapped phylogenies, check and rate-smoothB2_compare.R: compare mapped and pG-lt phylogeniesB3_metrics.R: generate PD, PSV and PSE values per site using both pG-lt and mapped trees.B4_plots.R: community plot PREDICTS data onto pG-lt consensus phylogenies
-- 0_data/
-- PREDICTS-DATA/
-- [site-level PREDICTS data]
-- raw_trees/
-- [downloaded published trees]
-- 0_pglt/
-- A1_preresolve/
-- A2_parse/
-- A3_pgltsetup/
-- A4_map/
-- B1_parse/
-- B2_compare/
-- B3_metrics/
-- B4_plots/
-- C1_analysis/
-- stages/
-- [all R stages files]
-- tools/
-- [all custom R functions]
-- sanity_checks/
-- [demonstrations of code accuracy]
-- other/
-- [misc non-essential items]
After cloning this repo to your machine, you can download all missing data files with this link (not yet available).
Uncompress files:
sh x_uncompress.sh
And compress again:
sh x_compress.sh
