Last updated: 2026-07-04
Checks: 6 1
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.
The R Markdown file has unstaged changes. To know which version of
the R Markdown file created these results, you’ll want to first commit
it to the Git repo. If you’re still working on the analysis, you can
ignore this warning. When you’re finished, you can run
wflow_publish to commit the R Markdown file and build the
HTML.
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 1d98d3a. 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: .DS_Store
Ignored: analysis/.DS_Store
Ignored: analysis/.Rhistory
Ignored: analysis/assets/.DS_Store
Ignored: code/.DS_Store
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/.DS_Store
Ignored: figures/generated/Figure 5/
Ignored: figures/generated/Figure 7/
Ignored: figures/generated/Figure 8/
Ignored: figures/generated/Figure 9/
Untracked files:
Untracked: tables/
Unstaged changes:
Modified: README.md
Modified: analysis/TableS1.Rmd
Modified: code/README.md
Modified: code/pipeline/02_compute_auc.R
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 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/Supplementary_Table1_GP_summary.csv
Modified: script/Figure4.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 | 8f0198e | Ziang Zhang | 2026-07-03 | Build site. |
| Rmd | 9944479 | Ziang Zhang | 2026-07-03 | Drop Condition column from TableS1 (would require healthy-only |
| html | 8b50a78 | Ziang Zhang | 2026-07-03 | Build site. |
| html | 92021bf | Ziang Zhang | 2026-07-03 | Build site. |
| 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/organ categories it predicts well
# (AUC > 0.8, driven by high loading), plus its top positive and negative
# signature genes. Unlike Figure2.R (2A) and Figure4.R, these three AUC
# computations are restricted to non-thymocyte cells only, WITHOUT an
# additional healthy-only restriction (see code/pipeline/02_compute_auc.R) --
# confirmed against the published Table S1.xlsx, whose Organ column includes
# disease-specific sites (SLO, prostate, pancreas, synovial fluid) that only
# exist in this broader, non-healthy-restricted population.
#
# GAP: the published table also has a Condition column (per-GP AUC against
# condition_detailed, same non-thymocyte-only restriction) that isn't
# reproduced here -- recomputing it takes ~3 hours, deferred for now (see
# code/pipeline/02_compute_auc.R's header for detail).
#
# Source: ported from Supplement_Table1.R (unchanged apart from the output
# path, the AUC-file family used, the GP naming fix below, and the
# still-missing condition column, see above).
#
# 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_no_thymocytes.rds")) # code/pipeline/02_compute_auc.R
level_2_AUC_list <- readRDS(paste0(data_path, "level_2_AUC_list_figure_no_thymocytes.rds")) # code/pipeline/02_compute_auc.R
organ_simplified_AUC_list_figure <- readRDS(paste0(data_path, "organ_simplified_AUC_list_figure_no_thymocytes.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)
# L_pm_filtered/F_pm_filtered and the cached AUC matrices all share the raw
# "K1", "K2", ... column names (from the underlying flashier fit); rename to
# "GP1", "GP2", ... only for display, after all matching against those raw
# names is done.
gps <- colnames(F_pm_filtered)
gp_labels <- paste0("GP", seq_along(gps))
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)
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 = gp_labels,
Level1 = unlist(level1_cats),
Level2 = unlist(level2_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)
Showing the first 20 rows (of 200); download the full table at figures/generated/Supplementary_Table1_GP_summary.csv.
| GP | Level1 | Level2 | Organ | Signature_Genes_Pos | Signature_Genes_Neg |
|---|---|---|---|---|---|
| GP1 | 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 | |||
| GP2 | CD8.wM; CD4.wM; Treg.wM; gdT.E; gdT.wM; CD8aa.wM; Tz.wM; DN.wM; DP.wC; DP.wM | Arhgap15; Dock2; Mbnl1; Inpp4b; Foxp1 | Tmsb10; Tmsb4x; Fau; Pfn1; Ppia | ||
| GP3 | gdT.A; gdT.B; gdT.C; gdT.D; gdT.E; gdT.F; gdT.Z; CD8aa.C; CD8aa.D; CD8aa.E; DP.wY | small intestine epi | Gzma; Cd7; Ccl5; Fcer1g; Tyrobp | Tmsb10; Tpt1; CT010467.1; Actb; Tmsb4x | |
| GP4 | CD4.wN | SLO | Tmsb10; Fau; CT010467.1; Pfn1; Ppia | Dock2; Rack1; Arhgap15; Myh9; Ptprc | |
| GP5 | CD8.K; CD8.P; CD4.P; Treg.P; gdT.P; CD8aa.P; Tz.P; DN.P; DP.wP | H2ac8; H1f5; H1f4; H4c4; Hist1h2ap | |||
| GP6 | 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 | S100a6; Gzmb; Lgals1; Vim; Crip1 | Tmsb10; CT010467.1; Eef1a1; Cmss1; Cdk8 | ||
| GP7 | gdT.X; gdT.Z; DP.wG | CT010467.1; Ccl5; Cmss1; Cdk8; Crip1 | Igfbp4; Ccr7; Limd2 | ||
| GP8 | gdT.Z | Fth1; S100a6; Thy1; Ctla2a; Gem | Ccl5; Gzma; Gzmb; AW112010; Tyrobp | ||
| GP9 | CD8.wU; CD8.wV; DP.wC; DP.wD; DP.wE | Cdk8; Cmss1; CT010467.1; Eef2; Myh9 | Tmsb10; Fau; Tmsb4x; Cd52 | ||
| GP10 | CD8.G; CD8.H; CD8.I; CD8.J; CD8.K; CD8.wU; CD8.wY; CD4.S; DN.F | Ccl5; Gzma; Lgals1; Nkg7; Ly6c2 | |||
| GP11 | placenta; kidney | Vps37b; Gramd3; Dusp10; Junb; Ccr7 | Cd52; Ltb; Ptprcap | ||
| GP12 | 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 | ||
| GP13 | CD4.X; CD4.Y; gdT.Q; gdT.R; gdT.S; gdT.T; gdT.U; gdT.V; Tz.D | Tmem176b; Tmem176a; Il7r; CT010467.1; Cd163l1 | Ms4a4b; Inpp4b; Ctla4; Ifi27l2a; Cd2 | ||
| GP14 | DP.wF; DP.wG | Cd8b1; Cd8a; Satb1; Rag1; Themis | H2-K1; Crip1; H2-D1; B2m; Eef1a1 | ||
| GP15 | 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 | ||
| GP16 | CD8.F; CD4.D; DN.I; DN.J | Ifi27l2a; Isg15; Ly6a; Bst2; Stat1 | |||
| GP17 | Ifi27l2a; Atp5e; Tmsb4x; Ripor2; Lef1 | Actg1; Ubb; Hspa8; Eef1a1; Il31ra | |||
| GP18 | Cpa3; CT010467.1; Crip1; Ccl5; Tmsb10 | Ifi27l2a; Ccr7; Ly6d; Rgcc | |||
| GP19 | Prl8a9; Tpbpa; Psg21; Prl3b1; Creg1 | Cts6; Ccr10 | |||
| GP20 | CD8.K | 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), and organ categories it predicts well
(AUC > 0.8, driven by high loading, restricted to non-thymocyte cells
– healthy and diseased together, unlike Figure2/Figure4’s healthy-only
restriction), plus its top 5 positive and negative signature genes
(|score| > 0.25). A Condition column (per-GP AUC against detailed
condition) is not yet reproduced here – see code/pipeline/02_compute_auc.R
for why.
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