Last updated: 2026-07-03

Checks: 7 0

Knit directory: immgenT-GP-analysis/analysis/

This reproducible R Markdown analysis was created with workflowr (version 1.7.2). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.

Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.

The command set.seed(1) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.

Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.

The results in this page were generated with repository version db7a5cd. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.

Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:


Ignored files:
    Ignored:    analysis/.DS_Store
    Ignored:    analysis/.Rhistory
    Ignored:    analysis/assets/.DS_Store
    Ignored:    code 2/
    Ignored:    code/pipeline 2/
    Ignored:    data
    Ignored:    figures/final-selected/.DS_Store
    Ignored:    figures/final-selected/bits/.DS_Store
    Ignored:    figures/final-selected/bits/Figure 1/.DS_Store
    Ignored:    figures/final-selected/bits/Figure 2/.DS_Store
    Ignored:    figures/final-selected/bits/Figure 3/.DS_Store
    Ignored:    figures/final-selected/bits/Figure 4/.DS_Store
    Ignored:    figures/final-selected/bits/Figure 6/.DS_Store
    Ignored:    figures/final-selected/bits/Figure 7/.DS_Store
    Ignored:    figures/final-selected/bits/Figure S1/.DS_Store
    Ignored:    figures/final-selected/bits/Figure S2/.DS_Store
    Ignored:    figures/final-selected/bits/Figure S3/.DS_Store
    Ignored:    figures/final-selected/bits/Figure S6/.DS_Store
    Ignored:    figures/final-selected/bits/Figure S7/.DS_Store
    Ignored:    figures/generated/Figure 1 2/
    Ignored:    figures/generated/Figure 5/
    Ignored:    figures/generated/Figure 7/
    Ignored:    figures/generated/Figure 8/
    Ignored:    figures/generated/Figure 9/
    Ignored:    figures/generated/Figure S1 2/
    Ignored:    figures/generated/Figure S2 2/
    Ignored:    figures/generated/Figure S3 2/
    Ignored:    figures/generated/Figure S6 2/

Untracked files:
    Untracked:  code/pipeline/01b_filter_cells.R

Unstaged changes:
    Modified:   code/README.md
    Modified:   code/pipeline/02_compute_auc.R
    Modified:   code/pipeline/04_protein_projection.R
    Modified:   figures/generated/Figure 1/1A.pdf
    Modified:   figures/generated/Figure 1/1C.pdf
    Modified:   figures/generated/Figure 1/1D.pdf
    Modified:   figures/generated/Figure 1/1E.pdf
    Modified:   figures/generated/Figure 1/1F.pdf
    Modified:   figures/generated/Figure 1/1G.pdf
    Modified:   figures/generated/Figure 1/1H.pdf
    Modified:   figures/generated/Figure 1/1I.pdf
    Modified:   figures/generated/Figure 1/hist_active_cells_per_GP.pdf
    Modified:   figures/generated/Figure 1/hist_active_genes_prop_per_GP.pdf
    Modified:   figures/generated/Figure 1/scatter_e_active_cells_vs_genes.pdf
    Modified:   figures/generated/Figure 2/2A.pdf
    Modified:   figures/generated/Figure 2/2B.pdf
    Modified:   figures/generated/Figure 2/2C.pdf
    Modified:   figures/generated/Figure 2/2D.pdf
    Modified:   figures/generated/Figure 2/2E.pdf
    Modified:   figures/generated/Figure 2/2F.pdf
    Modified:   figures/generated/Figure 2/2G.pdf
    Modified:   figures/generated/Figure 2/2H.pdf
    Modified:   figures/generated/Figure 2/2I.pdf
    Modified:   figures/generated/Figure 2/2J.pdf
    Modified:   figures/generated/Figure 2/2K.pdf
    Modified:   figures/generated/Figure 2/2L.pdf
    Modified:   figures/generated/Figure 2/2M.pdf
    Modified:   figures/generated/Figure 3/3c.pdf
    Modified:   figures/generated/Figure 3/3d.pdf
    Modified:   figures/generated/Figure 3/3e.pdf
    Modified:   figures/generated/Figure 3/3f.pdf
    Modified:   figures/generated/Figure 3/3g.pdf
    Modified:   figures/generated/Figure 4/4a.pdf
    Modified:   figures/generated/Figure 4/4b.pdf
    Modified:   figures/generated/Figure 4/4c.pdf
    Modified:   figures/generated/Figure 4/4d.pdf
    Modified:   figures/generated/Figure 4/4e.pdf
    Modified:   figures/generated/Figure 6/6b.pdf
    Modified:   figures/generated/Figure 6/6c.pdf
    Modified:   figures/generated/Figure 6/6d.pdf
    Modified:   figures/generated/Figure 6/6e.pdf
    Modified:   figures/generated/Figure 6/6f.pdf
    Modified:   figures/generated/Figure 6/6g.pdf
    Modified:   figures/generated/Figure 6/6h.pdf
    Modified:   figures/generated/Figure 6/6i.pdf
    Modified:   figures/generated/Figure 6/6j.pdf
    Modified:   figures/generated/Figure 6/6k.pdf
    Modified:   figures/generated/Figure S1/S1A.pdf
    Modified:   figures/generated/Figure S1/S1B.pdf
    Modified:   figures/generated/Figure S1/S1C.pdf
    Modified:   figures/generated/Figure S1/S1D.pdf
    Modified:   figures/generated/Figure S2/S2A.pdf
    Modified:   figures/generated/Figure S2/S2B.pdf
    Modified:   figures/generated/Figure S2/S2C.pdf
    Modified:   figures/generated/Figure S3/s3c.pdf
    Modified:   figures/generated/Figure S3/s3d.pdf
    Modified:   figures/generated/Figure S3/s3e.pdf
    Modified:   figures/generated/Figure S3/s3f.pdf
    Modified:   figures/generated/Figure S3/s3g.pdf
    Modified:   figures/generated/Figure S3/s3h.pdf
    Modified:   script/Figure1.R
    Modified:   script/Figure2.R
    Modified:   script/Figure3.R
    Modified:   script/Figure4.R
    Modified:   script/Figure6.R
    Modified:   script/FigureS1.R
    Modified:   script/FigureS2.R
    Modified:   script/FigureS3.R
    Modified:   script/FigureS6.R
    Modified:   script/TableS1.R

Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.


These are the previous versions of the repository in which changes were made to the R Markdown (analysis/TableS1.Rmd) and HTML (docs/TableS1.html) files. If you’ve configured a remote Git repository (see ?wflow_git_remote), click on the hyperlinks in the table below to view the files as they were in that past version.

File Version Author Date Message
html 827c89b Ziang Zhang 2026-07-03 Build site.
Rmd f9db962 Ziang Zhang 2026-07-02 Simplify layout: drop old code/script folders, rename
html c6e5086 Ziang Zhang 2026-07-02 Build site.
html 5a79883 Ziang Zhang 2026-07-02 Build site.
Rmd 2b0e445 Ziang Zhang 2026-07-02 Fix GitHub source links to point at the new
html cf1d0ac Ziang Zhang 2026-07-02 Build site.
Rmd 06b2461 Ziang Zhang 2026-07-02 Initial commit: immgenT-GP-analysis
html 06b2461 Ziang Zhang 2026-07-02 Initial commit: immgenT-GP-analysis

Produced by script/TableS1.R:

# Supplementary Table 1: per-GP summary.
#
# One row per GP: which Level-1/Level-2/condition/organ categories it
# predicts well (AUC > 0.8, driven by high loading), plus its top positive
# and negative signature genes.
#
# Source: ported from Supplement_Table1.R (unchanged apart from the
# output path).
#
# Required inputs (data/) -- see code/README.md's "Data provenance" table
# for the full picture.

data_path <- "data/"
output_path <- "figures/generated/"

L_pm_filtered <- readRDS(paste0(data_path, "L_pm_filtered.rds")) # code/pipeline/01b_filter_cells.R
F_pm_filtered <- readRDS(paste0(data_path, "F_pm_filtered.rds")) # code/pipeline/01b_filter_cells.R
level_1_AUC_list <- readRDS(paste0(data_path, "level_1_AUC_list_figure.rds")) # code/pipeline/02_compute_auc.R
level_2_AUC_list <- readRDS(paste0(data_path, "level_2_AUC_list_figure.rds")) # code/pipeline/02_compute_auc.R
condition_detailed_AUC_list_figure <- readRDS(paste0(data_path, "condition_detailed_AUC_list_figure.rds")) # code/pipeline/02_compute_auc.R
organ_simplified_AUC_list_figure <- readRDS(paste0(data_path, "organ_simplified_AUC_list_figure.rds")) # code/pipeline/02_compute_auc.R

# Normalize F_pm_filtered such that each column has max abs value of 1
F_pm_filtered <- apply(F_pm_filtered, 2, function(x) x / max(abs(x)))
colnames(F_pm_filtered) <- colnames(L_pm_filtered)

gps <- colnames(F_pm_filtered)

get_passing_categories <- function(auc_list, gps, L_mat, threshold = 0.8) {
  auc_mat <- auc_list$auc
  thr_mat <- auc_list$threshold
  gp_median_loading <- apply(L_mat, 2, median)
  lapply(gps, function(gp) {
    if (!gp %in% colnames(auc_mat)) return("")
    auc_vals <- auc_mat[, gp]
    thr_vals <- thr_mat[, gp]
    med_load <- gp_median_loading[gp]
    # Keep only categories predicted by HIGH loading (threshold >= median loading)
    cats <- rownames(auc_mat)[auc_vals > threshold & thr_vals >= med_load]
    paste(cats, collapse = "; ")
  })
}

level1_cats <- get_passing_categories(level_1_AUC_list, gps, L_pm_filtered)
level2_cats <- get_passing_categories(level_2_AUC_list, gps, L_pm_filtered)
condition_cats <- get_passing_categories(condition_detailed_AUC_list_figure, gps, L_pm_filtered)
organ_cats <- get_passing_categories(organ_simplified_AUC_list_figure, gps, L_pm_filtered)

sig_genes_pos <- lapply(gps, function(gp) {
  vals <- F_pm_filtered[, gp]
  candidates <- names(vals)[vals > 0.25]
  top <- head(candidates[order(vals[candidates], decreasing = TRUE)], 5)
  paste(top, collapse = "; ")
})
sig_genes_neg <- lapply(gps, function(gp) {
  vals <- F_pm_filtered[, gp]
  candidates <- names(vals)[vals < -0.25]
  top <- head(candidates[order(abs(vals[candidates]), decreasing = TRUE)], 5)
  paste(top, collapse = "; ")
})

supp_table <- data.frame(
  GP = gps,
  Level1 = unlist(level1_cats),
  Level2 = unlist(level2_cats),
  Condition = unlist(condition_cats),
  Organ = unlist(organ_cats),
  Signature_Genes_Pos = unlist(sig_genes_pos),
  Signature_Genes_Neg = unlist(sig_genes_neg),
  stringsAsFactors = FALSE
)

write.csv(supp_table, file = paste0(output_path, "Supplementary_Table1_GP_summary.csv"), row.names = FALSE)

Table

Showing the first 20 rows (of 200); download the full table at figures/generated/Supplementary_Table1_GP_summary.csv.

GP Level1 Level2 Condition Organ Signature_Genes_Pos Signature_Genes_Neg
K1 CD8.K; CD4.Y; CD4.P; Treg.P; gdT.B; gdT.C; gdT.D; gdT.P; CD8aa.C; CD8aa.D; CD8aa.P; DP.wY; DP.wP CT010467.1; Tmsb4x; Actb; Tmsb10; Eef1a1
K2 CD8.wM; CD4.wM; Treg.wM; gdT.E; gdT.wM; CD8aa.wM; Tz.wM; DN.wM; DP.wC; DP.wM PDAC_SoyHFD Arhgap15; Dock2; Mbnl1; Inpp4b; Foxp1 Tmsb10; Tmsb4x; Fau; Pfn1; Ppia
K3 gdT.A; gdT.B; gdT.C; gdT.D; gdT.E; gdT.F; gdT.Z; CD8aa.C; CD8aa.D; CD8aa.E; DP.wY CeDtg; CeDtg_glia; Ddvillin; Ddvillin_glia; MNVCR6; MNVCW3 small intestine epi Gzma; Cd7; Ccl5; Fcer1g; Tyrobp Tmsb10; Tpt1; CT010467.1; Actb; Tmsb4x
K4 CD4.wN SLO Tmsb10; Fau; CT010467.1; Pfn1; Ppia Dock2; Rack1; Arhgap15; Myh9; Ptprc
K5 CD8.K; CD8.P; CD4.P; Treg.P; gdT.P; CD8aa.P; Tz.P; DN.P; DP.wP H2ac8; H1f5; H1f4; H4c4; Hist1h2ap
K6 CD4.T; CD4.U; CD4.X; CD4.Y; CD4.P; Treg.D; Treg.E; gdT.Q; gdT.R; gdT.S; gdT.T; gdT.U; gdT.V; gdT.X; gdT.Z; Tz.D Crodentium; MTB_49w; Saureus S100a6; Gzmb; Lgals1; Vim; Crip1 Tmsb10; CT010467.1; Eef1a1; Cmss1; Cdk8
K7 gdT.X; gdT.Z; DP.wG CT010467.1; Ccl5; Cmss1; Cdk8; Crip1 Igfbp4; Ccr7; Limd2
K8 gdT.Z VV_D63_AntigenExperienced; VV_D63_bystander; VV_D80_bystander Fth1; S100a6; Thy1; Ctla2a; Gem Ccl5; Gzma; Gzmb; AW112010; Tyrobp
K9 CD8.wU; CD8.wV; DP.wC; DP.wD; DP.wE Cdk8; Cmss1; CT010467.1; Eef2; Myh9 Tmsb10; Fau; Tmsb4x; Cd52
K10 CD8.G; CD8.H; CD8.I; CD8.J; CD8.K; CD8.wU; CD8.wY; CD4.S; DN.F dirty_2m_LCMVarm_D30; dirty_2m_LCMVarm_D7; GBMpron; LCMVarm_intravascular; LCMVarm_intravascularcirculating; LCMVarm_intravascularsurveilling Ccl5; Gzma; Lgals1; Nkg7; Ly6c2
K11 placenta; kidney Vps37b; Gramd3; Dusp10; Junb; Ccr7 Cd52; Ltb; Ptprcap
K12 CD8.C; CD8.wX; CD4.G; CD4.H; CD4.I; CD4.U; Treg.B; DN.A; DN.G Izumo1r; Cdk8; Tox; Tbc1d4; Pdcd1 Crip1; Ccl5; Satb1; Igfbp4; Selplg
K13 CD4.X; CD4.Y; gdT.Q; gdT.R; gdT.S; gdT.T; gdT.U; gdT.V; Tz.D D3; Foxp3mutant_D3; Saureus Tmem176b; Tmem176a; Il7r; CT010467.1; Cd163l1 Ms4a4b; Inpp4b; Ctla4; Ifi27l2a; Cd2
K14 DP.wF; DP.wG Cd8b1; Cd8a; Satb1; Rag1; Themis H2-K1; Crip1; H2-D1; B2m; Eef1a1
K15 CD8.D; CD8.F; CD4.F; Treg.C; gdT.X; DN.G; DN.H; DP.wH Eif5a; Npm1; Hsp90ab1; Ncl; Mif Malat1; Tmsb4x; Itm2b; Cd52; Ypel3
K16 CD8.F; CD4.D; DN.I; DN.J B16_ACTaPD1a41BB; CtrachomatisL2_primaryD5; LCMVcl13_D8; Toxo_D9 Ifi27l2a; Isg15; Ly6a; Bst2; Stat1
K17 Ifi27l2a; Atp5e; Tmsb4x; Ripor2; Lef1 Actg1; Ubb; Hspa8; Eef1a1; Il31ra
K18 Cpa3; CT010467.1; Crip1; Ccl5; Tmsb10 Ifi27l2a; Ccr7; Ly6d; Rgcc
K19 Prl8a9; Tpbpa; Psg21; Prl3b1; Creg1 Cts6; Ccr10
K20 CD8.K LCMVarm_intravascular Cenpa; Ube2c; Cdc20; Cenpf; Arl6ip1 H2ac8; H1f5; H1f4; Hist1h2ap; H1f3

Table S1. One row per GP: which Level-1 (major lineage), Level-2 (sub-lineage), condition, and organ categories it predicts well (AUC > 0.8, driven by high loading), plus its top 5 positive and negative signature genes (|score| > 0.25).


sessionInfo()
R version 4.5.1 (2025-06-13)
Platform: aarch64-apple-darwin20
Running under: macOS Sequoia 15.6.1

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.1

locale:
[1] en_CA/en_CA/en_CA/C/en_CA/en_CA

time zone: Asia/Tokyo
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] vctrs_0.7.3     cli_3.6.6       knitr_1.50      rlang_1.2.0    
 [5] xfun_0.55       stringi_1.8.7   otel_0.2.0      promises_1.5.0 
 [9] jsonlite_2.0.0  workflowr_1.7.2 glue_1.8.1      rprojroot_2.1.1
[13] git2r_0.36.2    htmltools_0.5.9 httpuv_1.6.16   sass_0.4.10    
[17] rmarkdown_2.30  evaluate_1.0.5  jquerylib_0.1.4 tibble_3.3.0   
[21] fastmap_1.2.0   yaml_2.3.12     lifecycle_1.0.5 whisker_0.4.1  
[25] stringr_1.6.0   compiler_4.5.1  fs_1.6.6        Rcpp_1.1.1-1.1 
[29] pkgconfig_2.0.3 later_1.4.4     digest_0.6.39   R6_2.6.1       
[33] pillar_1.11.1   magrittr_2.0.5  bslib_0.9.0     tools_4.5.1    
[37] cachem_1.1.0