E2EB GitHub - pawelab/ImmPrint · GitHub
[go: up one dir, main page]

Skip to content
pawelabPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

28 Commits

Folders and files

Repository files navigation

ImmPrint

Code for "Learned Immune Architectures of High Antibody Response Across Vaccines".

ImmPrint is an interpretable machine-learning framework that predicts high vs. low antibody responders from post-vaccination blood transcriptomic fold changes. It covers three HIPC / Immune Signatures Data Resource (ISDR) cohorts: influenza (n = 776), hepatitis B (n = 160) and yellow fever (n = 96). Genes are aggregated into Blood Transcriptional Modules (BTMs) with GSVA, and a random forest is trained for each pathogen. Predictions are then interpreted with bootstrapped permutation importance, surrogate decision trees, limma differential expression and a cross-pathogen concordance test.

Repository layout

ImmPrint/
├── config.R                 # all paths (data, pipeline outputs, figures)
├── install_packages.R       # CRAN + Bioconductor dependencies
├── data/gene_sets/          # BTM_Plus and ImmPort gene sets (+ how they were built)
├── R/                       # function libraries (sourced, no side effects)
│   ├── filter_by_pathogen_variance.R
│   ├── btm_gene_filtering.R
│   ├── btm_pathway_scores.R
│   ├── immport_gene_filtering.R
│   └── immport_pathway_scores.R
├── scripts/                 # run in numeric order
│   ├── 00_prepare_isdr_data.R
│   ├── 01_residualize_age_fc.qmd
│   ├── 02_feature_engineering.qmd
│   ├── 03_list_datasets.sh
│   ├── 03_model_training.R
│   ├── 04_xai_model_interpretation.qmd
│   ├── 05_differential_expression.R
│   ├── 06_power_analysis.R
│   └── figures/             # stand-alone figure/table scripts
└── docs/FIGURES.md          # figure/table → script map

Setup

  1. Install R (≥ 4.4) and Quarto, then run Rscript install_packages.R.

  2. Get the ISDR data (see Data) and place the derived CSVs in data/.

  3. Paths default to data/ and output/ inside the repo. To use other locations, set environment variables, for example in ~/.Renviron:

    IMMPRINT_DATA_DIR=/path/to/data
    IMMPRINT_GENESET_DIR=/path/to/gene_sets
    IMMPRINT_PIPELINE_DIR=/path/to/fc_btm_pipeline
    IMMPRINT_FIG_DIR=/path/to/figures
    

Open ImmPrint.Rproj (or run from the repo root) so that here::here() resolves correctly.

Pipeline

Run the scripts in scripts/ in numeric order:

  1. Split the ISDR eset into timepoint tables
  2. Age residualization and fold change
  3. Feature engineering (variance filter → BTM genes → GSVA)
  4. Model training
  5. Model interpretation (XAI): permutation importance, surrogate trees and cross-pathogen concordance
  6. Differential expression analysis of all predictive BTMs
  7. Power analysis

See scripts/README.md for inputs and outputs of each step.

Figures

See docs/FIGURES.md for which script produces each figure and table.

Data

Expression and antibody data come from the HIPC Immune Signatures Data Resource (Diray-Arce et al., Sci Data 2022, https://doi.org/10.1038/s41597-022-01714-7). Raw data are not included in this repository.

  1. Download all_noNorm_withResponse_eset.rds from the ISDR and place it in DATA_DIR (or point IMMPRINT_ESET to it).

  2. Run scripts/00_prepare_isdr_data.R. It writes the timepoint tables that step 1 reads:

    • filtered_expression_data_timepoint_0_with_meta.csv: baseline samples
    • filtered_expression_data_minimum_timepoint_with_meta.csv: earliest post-vaccination sample per participant

    Each table holds every sample in the eset. Metadata (35 columns) is filled only for the samples in that subset, and step 1 keeps those with filter(!is.na(age_imputed)).

Gene sets:

  • gene_sets/BTM_plus/BTM_Plus_Longform.csv: BTM membership in long format. Included in this repo; it comes from the MIT-licensed BTM package (see data/gene_sets/BTM_plus/README.md).
  • gene_sets/Immport/immport_all_genes_expanded_wide.csv: ImmPort immune gene lists (153 GO/Reactome terms). Included in this repo, along with the scripts that downloaded and parsed them (see data/gene_sets/Immport/README.md). Used for the ImmPort feature comparison in Supp Table 2; downstream analyses use BTM features.

Software

R 4.4.3 (ML on BU SCC) and R 4.5.2 (downstream analyses). Main packages: caret, randomForest, glmnet, kernlab, dbarts, pROC, PRROC, GSVA 2.4.5, limma 3.66.0, rpart 4.1.24, pvca 1.50.0, pwr 1.3-0, ggplot2 4.0.2, tidyverse 2.0.0.

License

MIT. See LICENSE.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

0