Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Analysis code for “Rethinking the soil core microbiome”

This repository contains the reproducible analysis workflow associated with the New Phytologist Viewpoint “Rethinking the soil core microbiome.”

The central argument of the Viewpoint is that taxa selected by occurrence, abundance, Bray-Curtis contribution, clustering threshold, or other analytical filters should not automatically be called a biological “core microbiome.” In this repository, such taxa are therefore described as operationally selected taxa unless there is independent evidence for biological conservation.

This repository is intended for manuscript reproducibility, not as a general-purpose core microbiome detection package.

Repository purpose

The analyses in this repository evaluate how different operational criteria select different subsets of ASVs from the same microbiome dataset. These criteria include occurrence-based selection, abundance-based summaries, Bray-Curtis contribution-based selection, and clustering-threshold-based analysis.

The repository provides the code and input data needed to reproduce the analysis workflow and generate the main figure outputs associated with the Viewpoint.

Terminology note

Throughout this repository, terms such as selected taxa, BC-selected ASVs, occurrence-selected ASVs, and nonselected ASVs are used to emphasize that these subsets are generated by analytical criteria.

Any remaining uses of the term core, especially in external package names, function names, or legacy object names such as BRCore, identify_core(), increase_core, or elbow_core, should be interpreted as legacy operational terminology. They should not be read as evidence that the selected taxa represent a biologically conserved core microbiome.

Repository structure

data/
  README.md
  input/          Input data required for the analysis workflow
  output/         Generated outputs; created when the scripts are run

R/
  README.md
  analysis/       Numbered analysis scripts
  functions/      Helper functions
  utils/          Shared setup script

results/
  logs/           Optional run logs

renv/
  activate.R      renv activation script

renv.lock         R package environment record

Input data

Input files are stored in data/input/.

Key inputs include:

data/input/feature-table-modified.tsv.zip
data/input/metadata.tsv
data/input/taxonomy.tsv
data/input/sabr/all_ps_SABR.rds
data/input/lamps/LAMPS_StandAgeFert.RDS

The large feature table is stored as a compressed zip file:

data/input/feature-table-modified.tsv.zip

The analysis workflow automatically unzips this file when needed. The decompressed file,

data/input/feature-table-modified.tsv

is generated locally during execution and is not intended to be tracked in Git.

Raw FASTQ processing, DADA2 denoising, and initial sequence-quality filtering are not included in this repository. The workflow starts from processed input tables and R objects.

Analysis workflow

The main workflow starts at script 002 and proceeds numerically:

R/analysis/002_phyloseq_import_qc.R
R/analysis/003_summary_stats.R
R/analysis/004_BC_selected_taxa.R
R/analysis/004_operational_taxa_selection_workflow.R
R/analysis/005_cluster_threshold_analysis_SABR.R
R/analysis/006_save_main_physeqs.R
R/analysis/007_ordinations.R
R/analysis/008_paper_figures.R
R/analysis/009_core_randomization_analysis.R
R/analysis/010_box_1_figures.R

Raw-read quality control and denoising are outside the scope of this reproducibility repository, so the workflow begins with processed input tables and starts at script 002.

The final paper figures are generated by:

R/analysis/008_paper_figures.R
R/analysis/010_box_1_figures.R

Expected figure outputs include:

data/output/plots/fig1_008.png
data/output/plots/fig2_008.png
data/output/plots/fig3_008.png
data/output/plots/fig4_010.png

Additional intermediate objects, ordination results, and summary tables are generated under data/output/.

Running the workflow

This repository includes an renv.lock file to record the R package environment.

From the repository root, restore the package environment with:

install.packages("renv", repos = "https://cloud.r-project.org")
renv::restore()

After restoring the environment, restart R or open a new terminal session.

The workflow can then be run in order:

Rscript R/analysis/002_phyloseq_import_qc.R
Rscript R/analysis/003_summary_stats.R
Rscript R/analysis/004_BC_selected_taxa.R
Rscript R/analysis/004_operational_taxa_selection_workflow.R
Rscript R/analysis/005_cluster_threshold_analysis_SABR.R
Rscript R/analysis/006_save_main_physeqs.R
Rscript R/analysis/007_ordinations.R
Rscript R/analysis/008_paper_figures.R
Rscript R/analysis/009_core_randomization_analysis.R
Rscript R/analysis/010_box_1_figures.R

Several steps, especially Bray-Curtis selection and ordination analyses, require substantial memory and runtime. Running the full workflow on a personal computer may not be practical. An HPC environment is recommended for full reproduction of the workflow.

HPC submission scripts are not included because job schedulers, module names, container paths, memory limits, and library paths are system-specific. Users running the workflow on an HPC system should adapt the commands above to their local scheduler and R/container environment.

Main generated outputs

Running the workflow generates outputs such as:

data/output/bc_selection_summary_004.rda
data/output/asv_matrices_006.rda
data/output/distance_matrices_007.rda
data/output/pcoa_results_007.rda
data/output/nmds_results_007.rda

data/output/phyloseq_objects/filtered_phyloseq_002.rda
data/output/phyloseq_objects/bc_selected_phyloseq_006.rda
data/output/phyloseq_objects/bc_nonselected_phyloseq_006.rda
data/output/phyloseq_objects/occurrence_selected_phyloseq_004.rda

data/output/sabr/selected_taxa_summary_long.csv
data/output/sabr/selected_asv_counts.csv
data/output/sabr/selected_sequence_percent.csv

data/output/plots/fig1_008.png
data/output/plots/fig2_008.png
data/output/plots/fig3_008.png

data/output/tables/occurrence_bc_overlap_counts_008.csv
data/output/tables/bc_selection_check_summary_008.csv

Generated outputs are reproducible products of the analysis scripts and may be excluded from version control depending on repository size and archiving needs.

Relationship to BRCore

Some analyses use functions or object structures derived from the BRCore package as operational taxon-selection tools. This repository does not redefine BRCore and is not intended to serve as the BRCore package repository.

Use of BRCore terminology in legacy function or object names should not be interpreted as assigning biological conservation to selected ASVs.

Citation

If you use or refer to this repository, please cite the associated Viewpoint:

Rethinking the soil core microbiome
New Phytologist

Full citation details will be added after publication.

License

See LICENSE.

About

Analysis code and processed data for the New Phytologist Viewpoint “Rethinking the soil core microbiome".

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages