# PWWTPCarrier-grf-decoupling Analysis scripts for the paper "Carrier allocation and directional shifts decouple genetic risk factors from microbial community turnover during pharmaceutical wastewater treatment". ## Overview This repository contains the R scripts and dataset required to reproduce the main quantitative analyses and figures reported in the manuscript. The workflow starts from processed abundance/annotation tables (provided under data/) and generates the corresponding statistics, intermediate tables, and publication-ready figures. ## Repository structure - data/: input tables for running the scripts (full processed tables). - scripts/: numbered R scripts to reproduce each figure/table. - output/: generated results (created automatically). ## System requirements - OS: Windows 11. ## Software - R: v4. 4. 1 (tested). ### Key R package dependencies The scripts use common tidyverse packages plus domain-specific packages (e. g. , vegan, hillR, rdacca. hp, FEAST, tidygraph/ggraph). ## Non-standard hardware (recommended) - RAM: ≥ 16 GB (≥ 32 GB recommended for FEAST and network analyses) - CPU: multi-core recommended. - No GPU required. ## Installation guide 1. Install R (≥ 4. 4. 1). 2. Install required packages in R: `install. packages (c ("tidyverse", "data. table", "vegan", "ape", "hillR", "rdacca. hp", "UpSetVP", "car", "corrplot", "rstatix", "PMCMRplus", "ggpubr", "tidygraph", "igraph", "ggraph", "ComplexUpset", "UpSetR", "tidyplots", "tidyheatmaps", "openxlsx", "Nonpareil", "FEAST", "doParallel", "foreach", "ggsankey", "patchwork", "linkET", "readxl", "ggrepel", "colorspace", "gggenes") ) ` > Typical install time (normal desktop): > ~10 minutes with a stable internet connection (depends on CRAN mirror speed and whether compilation from source is needed). 3. Download/clone this repository. 4. Set the working directory to the repository root. 5. Recommended: open the repository as an RStudio/Positron project, or run `setwd ("path/to/pwwtp-carrier-grf-decoupling") `. 6. Run scripts in order (from scripts/): ## Expected output - Figures: output/*. pdf - Tables: output/*. csv - Texts: output/*. txt ## Approximate runtime (full dataset) - `09ᵥariationₚartitioningᵣdacca. R`: ~20 minutes (depends on permutation settings) - Other scripts: typically minutes. ## How to run on your own data Replace files under data/ with your own processed tables that match the same column names and formats, then re-run the scripts. Scripts assume they are executed from the repository root (i. e. , the working directory is the repository root). ## Reproducibility notes All sampling protocols, DNA extraction, sequencing, and the bioinformatic processing steps are described in the manuscript Methods. This repository focuses on reproducing the downstream statistics and visualization from processed tables. For stochastic analyses (e. g. , FEAST), random seeds are fixed where applicable. ### Packages required Environment details are provided in `sessionInfo. txt`.
Muyu Li (Sun,) studied this question.
Synapse has enriched 5 closely related papers on similar clinical questions. Consider them for comparative context: