Last updated: 2026-07-05

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 is untracked by Git. 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 6d1c6c0. 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:    .claude/
    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:  analysis/ExtendedDataTable1.Rmd
    Untracked:  analysis/ExtendedDataTable2.Rmd
    Untracked:  analysis/ExtendedDataTable3.Rmd
    Untracked:  analysis/ExtendedDataTable4.Rmd
    Untracked:  analysis/ExtendedDataTable5.Rmd
    Untracked:  analysis/ExtendedDataTable6.Rmd
    Untracked:  analysis/ExtendedDataTable7.Rmd
    Untracked:  figures/generated/ExtendedDataTable1_GP_summary.csv
    Untracked:  figures/generated/ExtendedDataTable2_GP_AUC_lineage.csv
    Untracked:  figures/generated/ExtendedDataTable3_GP_AUC_tissue.csv
    Untracked:  figures/generated/ExtendedDataTable4_GP_AUC_cluster.csv
    Untracked:  figures/generated/ExtendedDataTable5_GP_during_activation.csv
    Untracked:  figures/generated/ExtendedDataTable6_protein_factor_matrix.csv
    Untracked:  figures/generated/ExtendedDataTable7_protein_gating.csv
    Untracked:  script/ExtendedDataTable1_GP_summary.R
    Untracked:  script/ExtendedDataTable2_GP_AUC_lineage.R
    Untracked:  script/ExtendedDataTable3_GP_AUC_tissue.R
    Untracked:  script/ExtendedDataTable4_GP_AUC_cluster.R
    Untracked:  script/ExtendedDataTable5_GP_during_activation.R
    Untracked:  script/ExtendedDataTable6_protein_factor_matrix.R
    Untracked:  script/ExtendedDataTable7_protein_gating.R
    Untracked:  tables/

Unstaged changes:
    Deleted:    analysis/TableS1.Rmd
    Modified:   analysis/index.Rmd
    Modified:   code/R/gated_protein_helpers.R
    Modified:   code/R/roc_auc.R
    Modified:   code/README.md
    Modified:   code/pipeline/02_compute_auc.R
    Deleted:    figures/generated/Supplementary_Table1_GP_summary.csv
    Modified:   script/README.md
    Deleted:    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.


There are no past versions. Publish this analysis with wflow_publish() to start tracking its development.


Produced by script/ExtendedDataTable5_GP_during_activation.R:

# Extended Data Table 5: GP during activation.
#
# One row per GP (GP1..GP200) summarizing how each GP's loading changes with
# T-cell activation, computed separately in CD4 and CD8: the mean change in
# loading (activated minus resting), the average loading over activated+resting
# cells (AveExpr), the standardized mean difference d (= change / pooled SD),
# and the CD8/CD4 ratio of the mean loading changes. This reproduces the
# `GP_activation_summary` object built in script/Figure3.R (panel 3a) from
# code/R/activation_shared_setup.R.
#
# Note vs. the published Table S2: the mean_change_loadings / AveExpr / Ratio
# columns reproduce exactly (identical CD4/CD8 activated-vs-resting populations),
# but the published z_CD4 / z_CD8 were a large-sample z-test statistic from an
# older limma-style DGE that the analysis has since replaced with the
# standardized mean difference d_CD4 / d_CD8 (change / pooled loading SD; see
# activation_shared_setup.R::std_mean_diff) -- the same statistic Figure 3a
# plots. This table therefore carries d_CD4 / d_CD8, the current quantity, not
# the retired z.

library(dplyr)

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

source("code/R/plot_utils.R") # scale_cols(), used by activation_shared_setup.R
source("code/R/setup_data.R")

gp_data <- load_gp_data(data_path = data_path)
L_pm_filtered <- gp_data$L_pm_filtered
F_pm_filtered <- gp_data$F_pm_filtered
seurat_meta_filtered <- gp_data$seurat_meta_filtered

source("code/R/activation_shared_setup.R") # -> diff_factors_merged, d_factors_merged

GP_activation_summary <- diff_factors_merged %>%
  dplyr::inner_join(d_factors_merged %>% dplyr::select(SYMBOL, d_CD4, d_CD8), by = "SYMBOL") %>%
  dplyr::mutate(Ratio_CD8_CD4 = mean_change_loadings_CD8 / mean_change_loadings_CD4) %>%
  dplyr::select(
    GP = SYMBOL,
    mean_change_loadings_CD4, mean_change_loadings_CD8,
    AveExpr_CD4, AveExpr_CD8,
    d_CD4, d_CD8,
    Ratio_CD8_CD4
  )

write.csv(
  GP_activation_summary,
  file = paste0(output_path, "ExtendedDataTable5_GP_during_activation.csv"),
  row.names = FALSE
)

Table

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

GP mean_change_loadings_CD4 mean_change_loadings_CD8 AveExpr_CD4 AveExpr_CD8 d_CD4 d_CD8 Ratio_CD8_CD4
GP1 0.0329 0.0254 0.3501 0.3464 0.5328 0.4118 0.7728
GP2 -0.0110 -0.0108 0.0193 0.0132 -0.2758 -0.2714 0.9841
GP3 0.0046 0.0102 0.0016 0.0038 0.2100 0.4615 2.1973
GP4 0.0146 0.0378 0.1613 0.1760 0.1229 0.3171 2.5801
GP5 0.0015 0.0018 0.0008 0.0015 0.1079 0.1340 1.2421
GP6 0.0731 0.0270 0.0248 0.0106 1.1495 0.4241 0.3690
GP7 0.0000 -0.0001 0.0001 0.0001 -0.0092 -0.0235 2.5494
GP8 0.0000 0.0000 0.0000 0.0000 0.0235 0.0234 0.9958
GP9 -0.0466 -0.0422 0.1003 0.0848 -0.3301 -0.2993 0.9066
GP10 0.0128 0.1335 0.0045 0.0498 0.1353 1.4134 10.4482
GP11 -0.0293 -0.0224 0.0985 0.0801 -0.2610 -0.1993 0.7635
GP12 0.1063 0.0078 0.0641 0.0327 1.4449 0.1062 0.0735
GP13 0.0105 0.0005 0.0035 0.0003 0.6904 0.0309 0.0447
GP14 0.0000 0.0000 0.0000 0.0000 -0.0213 -0.0174 0.8166
GP15 -0.0023 -0.0217 0.0541 0.0678 -0.0366 -0.3375 9.2272
GP16 0.0034 0.0007 0.0189 0.0165 0.0616 0.0128 0.2074
GP17 -0.0006 0.0030 0.0200 0.0196 -0.0471 0.2371 -5.0291
GP18 -0.0001 -0.0002 0.0002 0.0003 -0.0077 -0.0309 4.0064
GP19 -0.0001 0.0000 0.0001 0.0000 -0.0129 -0.0039 0.3041
GP20 0.0012 0.0029 0.0005 0.0013 0.0863 0.1982 2.2969

Extended Data Table 5. One row per GP describing how its loading changes with T-cell activation, computed separately in CD4 and CD8: mean_change_loadings (activated minus resting mean loading), AveExpr (mean loading over activated + resting cells), d (standardized mean difference = change / pooled loading SD, the statistic plotted in Figure 3a), and Ratio_CD8_CD4 (ratio of the CD8 to CD4 mean loading change). This reproduces the GP_activation_summary of Figure 3a; note that the d_CD4 / d_CD8 columns replace the retired limma-style z_CD4 / z_CD8 of the earlier table version.


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 stringr_1.6.0  
[25] compiler_4.5.1  fs_1.6.6        Rcpp_1.1.1-1.1  pkgconfig_2.0.3
[29] later_1.4.4     digest_0.6.39   R6_2.6.1        pillar_1.11.1  
[33] magrittr_2.0.5  bslib_0.9.0     tools_4.5.1     cachem_1.1.0