The scripts in this repo can be used to run the analyses conducted in the Stagaman et al. 2024 article, {TITLE} published in Communications Medicine.
File descriptions:
.Rprofilecreates a list of directories for reading in and saving data and plots_packages_and_sources.R_setup.Rloads packages, sources functions, set important variables01_variable_reduction_selection.RConducts the variable reduction step to identify the covariates to be used in all subsequent analyses.02_Analysesall scripts used for statistical analyses01_required_first.Rremoves low abundance and low prevalence OTUs/KOs, rarefies counts, and generates data structures to be used in differential abundances and random forest analyses02_taxonomic_alpha.Rconducts statistical analysis of alpha-diversity in relation to PD and the covariates of interest.03_all_beta.Rconducts statistical analysis of beta-diversity in relation to PD and the covariates of interest.04_random_forestsscripts used for random forest classfier models04A_covariates_split_sources.RRF model training and testing for saliva and stool separately using only covariate data (no OTU or KO abundances).04B_covariates_combined_sources.RRF model training and testing for saliva and stool combined using only covariate data (no OTU or KO abundances).04C_taxon_abunds_split_types_split_sources.RRF model training and testing for saliva and stool separately using OTU, species, and genus abundances separately.04D_taxon_abunds_split_types_combined_sources.RRF model training and testing for saliva and stool combined using OTU, species, and genus abundances separately.04E_taxon_abunds_aggregated_split_sources.RRF model training and testing for saliva and stool separately using OTU, species, and genus abundances combined.04F_taxon_abunds_aggregated_combined_sources.RRF model training and testing for saliva and stool combined using OTU, species, and genus abundances combined.04G_taxon_abunds_covariates_split_types_split_sources.RRF model training and testing for saliva and stool separately using OTU, species, and genus abundances separately, including covariates.04H_taxon_abunds_covariates_split_types_combined_sources.RRF model training and testing for saliva and stool combined using OTU, species, and genus abundances separately, including covariates.04I_taxon_abunds_covariates_aggregated_split_sources.RRF model training and testing for saliva and stool separately using OTU, species, and genus abundances combined, including covariates.04J_taxon_abunds_covariates_aggregated_combined_sources.RRF model training and testing for saliva and stool combined using OTU, species, and genus abundances combined, including covariates.04K_function_abunds_split_types_split_sources.RRF model training and testing for saliva and stool separately using KO, module, and pathway abundances separately04L_function_abunds_covars_split_types_split_sources.RRF model training and testing for saliva and stool separately using KO, module, and pathway abundances separately, including covariates.
05_LDAsscripts used for differential abundance analsyes (a.k.a linear discriminate analyses)05A_taxon_ANCOMBC2_wCovariates.RDifferential OTU abundance analysis using ANCOMBC2, including covariates.05B_taxon_ANCOMBC2_PDonly.RDifferential OTU abundance analysis using ANCOMBC2, without covariates.05C_taxon_ALDEx2_wCovariates.RDifferential OTU abundance analysis using ALDEx2, including covariates.05D_taxon_ALDEx2_PDonly.RDifferential OTU abundance analysis using ALDEx2, without covariates.05E_function_ANCOMBC2_wCovariates.RDifferential KO abundance analysis using ANCOMBC2, including covariates.05F_function_ANCOMBC2_PDonly.RDifferential KO abundance analysis using ANCOMBC2, without covariates.05G_function_ALDEx2_wCovariates.RDifferential KO abundance analysis using ALDEx2, including covariates.05H_function_ALDEx2_PDonly.RDifferential KO abundance analysis using ALDEx2, without covariates.
06_networksscripts used to generate feature-feature (OTUs/KOs) networks06A_between_saliva_stool_associations.RGenerates OTU-OTU and KO-KO co-abundance networks (utilizing SpeicEasi) between saliva and stool microbiomes.06B_within_sample_associations.RGenerates OTU-OTU and KO-KO co-abundance networks (utilizing SpeicEasi) within saliva and stool microbiomes.
99_required_last.Rmerges data from across different scripts in prepartion for plotting and further analysis.
Helpersscripts for custom functions and model specifications used across scriptsfunctions.Rcustom functionsmodel_specs.Rmodel specifications