Last updated: 2024-05-22

Checks: 7 0

Knit directory: lung_lymph_scMultiomics/

This reproducible R Markdown analysis was created with workflowr (version 1.7.1). 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(20221229) 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 5c6b22f. 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/.RData
    Ignored:    analysis/.Rhistory

Untracked files:
    Untracked:  analysis/.ipynb_checkpoints/
    Untracked:  analysis/U19_motif_analysis.ipynb
    Untracked:  analysis/identify_regulatory_programs_u19_GRN.Rmd
    Untracked:  analysis/test_GO_enrichment.ipynb
    Untracked:  output/fastTopics

Unstaged changes:
    Modified:   analysis/index.Rmd
    Modified:   analysis/rank_TFs_from_pairwise_comparison.ipynb
    Deleted:    code/run_fastTopic.R
    Deleted:    lung_immune_fine_mapping.Rproj

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/cross_tissue_DE_u19_fastTopics.Rmd) and HTML (docs/cross_tissue_DE_u19_fastTopics.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
Rmd 5c6b22f Jing Gu 2024-05-22 updated GSEA results
html 3d73252 Jing Gu 2024-05-13 Build site.
Rmd f26e8ad Jing Gu 2024-05-13 wflow_publish("analysis/cross_tissue_DE_u19_fastTopics.Rmd")
html 95bfdff Jing Gu 2024-05-13 Build site.
Rmd 3e4f015 Jing Gu 2024-05-13 wflow_publish("analysis/cross_tissue_DE_u19_fastTopics.Rmd")
html 2e475c9 Jing Gu 2024-05-13 Build site.
Rmd 306ddb1 Jing Gu 2024-05-13 wflow_publish("analysis/cross_tissue_DE_u19_fastTopics.Rmd")
html f812a40 Jing Gu 2024-05-09 Build site.
html 68d9e18 Jing Gu 2024-05-09 Build site.
Rmd 7ca45f6 Jing Gu 2024-05-09 cross-tissue comparison
Rmd 7a45261 Jing Gu 2024-05-08 cross-tissue comparison with topic modeling

GoM DE analysis on u19 dataset

Model fitting

Parameters:

N_updates = 150 N_topics = 12

Model evaluation

check the convergence

Version Author Date
68d9e18 Jing Gu 2024-05-09
Model overview:
  Number of data rows, n: 53647
  Number of data cols, m: 17420
  Rank/number of topics, k: 12
Evaluation of model fit (170 updates performed):
  Poisson NMF log-likelihood: -1.997995557900e+08
  Multinomial topic model log-likelihood: -1.995509032083e+08
  Poisson NMF deviance: +2.634951598369e+08
  Max KKT residual: +1.430262e-02
Set show.size.factors = TRUE, show.mixprops = TRUE and/or show.topic.reps = TRUE in print(...) for more information

Version Author Date
68d9e18 Jing Gu 2024-05-09
Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
ℹ Please use `linewidth` instead.
This warning is displayed once every 8 hours.
Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
generated.

Version Author Date
68d9e18 Jing Gu 2024-05-09

Visualize topics with structural plots

  • plot by cell-types

Version Author Date
68d9e18 Jing Gu 2024-05-09
  • plot by tissue

Version Author Date
68d9e18 Jing Gu 2024-05-09
  • plot by tissue and cell-type

Version Author Date
68d9e18 Jing Gu 2024-05-09

Validate topics with enrichment test

GO enrichemnt test on top 500 genes ranked by loadings

GO enrichemnt test on GoM DE analysis

Volcano plots for GoM DE results

The z-scores for posterior mean log-fold change estimates vs. log-fold change

Version Author Date
3d73252 Jing Gu 2024-05-13
95bfdff Jing Gu 2024-05-13
2e475c9 Jing Gu 2024-05-13

Version Author Date
95bfdff Jing Gu 2024-05-13
2e475c9 Jing Gu 2024-05-13

Version Author Date
95bfdff Jing Gu 2024-05-13
2e475c9 Jing Gu 2024-05-13

Version Author Date
95bfdff Jing Gu 2024-05-13
2e475c9 Jing Gu 2024-05-13

Version Author Date
95bfdff Jing Gu 2024-05-13
2e475c9 Jing Gu 2024-05-13

Version Author Date
2e475c9 Jing Gu 2024-05-13

Version Author Date
2e475c9 Jing Gu 2024-05-13

Version Author Date
3d73252 Jing Gu 2024-05-13
2e475c9 Jing Gu 2024-05-13

Version Author Date
3d73252 Jing Gu 2024-05-13
2e475c9 Jing Gu 2024-05-13

Version Author Date
2e475c9 Jing Gu 2024-05-13

Version Author Date
3d73252 Jing Gu 2024-05-13
95bfdff Jing Gu 2024-05-13
2e475c9 Jing Gu 2024-05-13

Version Author Date
95bfdff Jing Gu 2024-05-13
2e475c9 Jing Gu 2024-05-13

GO Enrichemnt results for upregulated genes with local false sign rates < 0.01

Topic 3,4,5,6 show strong enrichment for the GO terms of T-cell activation, leukocyte differentiation, positive regulation of cell adhesion, adaptive immune response.

From volcano plots, we see topic 6 has high LFC in genes such as IL17A, IL22, which are mainly produced by Th17 cells.

Topic 11 is strongly enriched for GO terms related to regulation of innate or adaptive immune response.

Topic 12 shows strong enrichment for the GO term of B cell activation.

Identify topics correlated with differences between tissue

  1. test whether any topic is associated with transcriptional differences across tissue \[ L = \beta X_{\text{tissue}} + \text{Covariates} + \epsilon \]
  2. perform T-test to see whether topic proportions between two tissues are significantly different

Density plot for topic proportions between tissue across cell types

X-axis denotes the percentage format of topic proportion.
Y-axis represents the density of cells with respect to topic proportions.

Topic 1 is specific to cell types other than lymphocytes.

Topic 3 is highly represented in NK and \(CD8^+\) T cells.

Topic 4-5 are T-cell specific, with clear separation between tissue in \(CD8^+\) T for topic 4 and Treg for topic 5.

Topic 6 is specific to Th17 cells and lungs has a longer tail of distribution compared to spleens.

Topic 2,7,8,9 show similar distributions across cell types without clear separation between tissue.

Topic 10-12 show higher density in B cells. Topic 11 captures tissue difference mainly in Memory B cells, while topic 12 displays some separation between tissue in Naive B cells.

Version Author Date
95bfdff Jing Gu 2024-05-13
2e475c9 Jing Gu 2024-05-13

Version Author Date
95bfdff Jing Gu 2024-05-13
2e475c9 Jing Gu 2024-05-13

Version Author Date
95bfdff Jing Gu 2024-05-13
2e475c9 Jing Gu 2024-05-13

Version Author Date
95bfdff Jing Gu 2024-05-13
2e475c9 Jing Gu 2024-05-13

Version Author Date
95bfdff Jing Gu 2024-05-13
2e475c9 Jing Gu 2024-05-13

Version Author Date
95bfdff Jing Gu 2024-05-13
2e475c9 Jing Gu 2024-05-13

Version Author Date
95bfdff Jing Gu 2024-05-13
2e475c9 Jing Gu 2024-05-13

Version Author Date
95bfdff Jing Gu 2024-05-13
2e475c9 Jing Gu 2024-05-13

Version Author Date
95bfdff Jing Gu 2024-05-13
2e475c9 Jing Gu 2024-05-13

Version Author Date
95bfdff Jing Gu 2024-05-13
2e475c9 Jing Gu 2024-05-13

Version Author Date
95bfdff Jing Gu 2024-05-13
2e475c9 Jing Gu 2024-05-13

Version Author Date
95bfdff Jing Gu 2024-05-13
2e475c9 Jing Gu 2024-05-13

Barplot for topic proportions in cell types

  • The topic proportion for k10 is higher in spleens than lungs in both naive B and memory B cells.
  • The topic proportions for k11 is higher in spleens than lungs in memory B cells only.
  • The topic proportions for k4 is higher in spleens than lungs across cell types.
  • The topic proportions for k6 is higher in lungs than spleens across cell types.
  • The topic proportions for k5 is higher in lungs than spleens across T cell subsets.
         
             NK other Memory_B Naive_B  Treg CD4_T CD8_T  Th17
  lungs    8067  1654     5287    1174  1336  6980 12210  2732
  spleens   464   104    10507    1710    47   886   421    68
`summarise()` has grouped output by 'tissue', 'celltype'. You can override
using the `.groups` argument.
# A tibble: 192 × 4
# Groups:   tissue, celltype [16]
   tissue celltype topic topic_prop_sum
   <chr>  <fct>    <chr>          <dbl>
 1 lungs  NK       k1              56.9
 2 lungs  NK       k10             17.8
 3 lungs  NK       k11             70.0
 4 lungs  NK       k12             30.6
 5 lungs  NK       k2             555. 
 6 lungs  NK       k3            3886. 
 7 lungs  NK       k4             314. 
 8 lungs  NK       k5             695. 
 9 lungs  NK       k6             613. 
10 lungs  NK       k7             681. 
# ℹ 182 more rows
`summarise()` has grouped output by 'tissue', 'celltype'. You can override
using the `.groups` argument.
`summarise()` has grouped output by 'tissue', 'celltype'. You can override
using the `.groups` argument.

All k4 terms included in k5.

    k
1  k5
2  k5
3  k5
4  k5
5  k5
6  k5
7  k5
8  k5
9  k5
10 k5
11 k5
12 k5
13 k5
14 k5
15 k5
16 k5
17 k5
18 k5
19 k5
20 k5
21 k5
22 k5
23 k5
24 k5
25 k5
26 k5
27 k5
28 k5
29 k5
30 k5
31 k5
32 k5
33 k5
34 k5
35 k5
36 k5
37 k5
38 k5
39 k5
40 k5
41 k5
42 k5
43 k5
44 k5
45 k5
46 k5
47 k5
48 k5
49 k5
50 k5
51 k5
52 k5
53 k5
54 k5
55 k5
56 k5
57 k5
58 k5
59 k5
                                                                  description
1                                immune response-regulating signaling pathway
2                           stress-activated protein kinase signaling cascade
3                                    intracellular receptor signaling pathway
4                                             covalent chromatin modification
5                                                   regulation of hemopoiesis
6                               protein modification by small protein removal
7                                                peptidyl-serine modification
8                                           response to tumor necrosis factor
9                                       activation of protein kinase activity
10                                       regulation of multi-organism process
11                                       regulation of innate immune response
12                                cellular response to environmental stimulus
13                                             homeostasis of number of cells
14                       positive regulation of cellular protein localization
15                                  regulation of apoptotic signaling pathway
16                                               myeloid cell differentiation
17                                                   fat cell differentiation
18                                               peptidyl-lysine modification
19                                       regulation of mRNA metabolic process
20                     regulation of protein serine/threonine kinase activity
21                                                                coagulation
22                          posttranscriptional regulation of gene expression
23                                                           face development
24                                   negative regulation of catabolic process
25 regulation of protein modification by small protein conjugation or removal
26                                                           viral life cycle
27              vascular endothelial growth factor receptor signaling pathway
28                                                 cell-cell signaling by wnt
29                                                          response to virus
30                             regulation of protein localization to membrane
31                                         hormone-mediated signaling pathway
32                                    positive regulation of defense response
33                                 positive regulation of cytokine production
34                              establishment or maintenance of cell polarity
35                                          epithelial cell apoptotic process
36                                                        response to peptide
37                                        I-kappaB kinase/NF-kappaB signaling
38                                         positive regulation of proteolysis
39                                                     ERBB signaling pathway
40                                           endomembrane system organization
41                                                               phagocytosis
42                                      extrinsic apoptotic signaling pathway
43                                            regulation of body fluid levels
44                                            Ras protein signal transduction
45                                                     platelet morphogenesis
46                    regulation of small GTPase mediated signal transduction
47                                  regulation of gene expression, epigenetic
48                                               type I interferon production
49                                            response to mechanical stimulus
50                                                      interaction with host
51                                      protein localization to mitochondrion
52                                                      ERK1 and ERK2 cascade
53                                   positive regulation of catabolic process
54               positive regulation of establishment of protein localization
55                                                 maintenance of cell number
56                                                           neuron migration
57                                     cellular response to external stimulus
58                                                          nuclear transport
59                                  regulation of cell cycle phase transition
            FDR
1  3.492289e-06
2  9.634677e-06
3  2.410475e-05
4  2.015496e-04
5  1.122854e-03
6  1.122854e-03
7  1.122854e-03
8  1.122854e-03
9  1.122854e-03
10 1.599627e-03
11 1.691464e-03
12 2.125044e-03
13 2.125044e-03
14 2.125044e-03
15 2.749721e-03
16 2.749721e-03
17 2.749721e-03
18 2.749721e-03
19 3.516024e-03
20 3.516024e-03
21 3.839176e-03
22 5.894825e-03
23 5.894825e-03
24 6.999863e-03
25 6.999863e-03
26 8.081150e-03
27 9.224868e-03
28 1.097745e-02
29 1.216695e-02
30 1.231576e-02
31 1.334113e-02
32 1.344643e-02
33 1.344936e-02
34 1.344936e-02
35 1.437995e-02
36 1.437995e-02
37 1.502224e-02
38 1.502224e-02
39 1.582629e-02
40 1.582629e-02
41 1.601051e-02
42 1.958226e-02
43 2.037542e-02
44 2.457071e-02
45 2.685611e-02
46 2.685611e-02
47 2.823422e-02
48 2.966939e-02
49 2.974703e-02
50 2.974703e-02
51 3.236806e-02
52 3.383944e-02
53 3.664705e-02
54 3.939417e-02
55 4.209289e-02
56 4.326526e-02
57 4.326526e-02
58 4.798100e-02
59 4.911061e-02
                                        description
1      immune response-regulating signaling pathway
2 stress-activated protein kinase signaling cascade
3          intracellular receptor signaling pathway
4                   covalent chromatin modification
5                      peptidyl-serine modification
6             activation of protein kinase activity
    k                                             description          FDR
1  k6                                   RNA catabolic process 0.000000e+00
2  k6       establishment of protein localization to membrane 0.000000e+00
3  k6                                translational initiation 0.000000e+00
4  k6           protein localization to endoplasmic reticulum 0.000000e+00
5  k6                                       protein targeting 8.179679e-12
6  k6                                 cytoplasmic translation 2.553424e-06
7  k6                                         cell chemotaxis 1.309663e-04
8  k6                                adaptive immune response 2.404495e-04
9  k6                                            cell killing 2.404495e-04
10 k6                   regulation of immune effector process 3.429156e-04
11 k6                     regulation of inflammatory response 4.284072e-04
12 k6                             response to toxic substance 9.748643e-04
13 k6                      defense response to other organism 9.904442e-04
14 k6                            lymphocyte mediated immunity 1.241181e-03
15 k6                                  rRNA metabolic process 1.241181e-03
16 k6              negative regulation of cytokine production 3.300686e-03
17 k6                                   regulation of binding 3.796800e-03
18 k6             negative regulation of transferase activity 4.316427e-03
19 k6                    positive regulation of cell motility 4.343224e-03
20 k6                response to molecule of bacterial origin 4.451778e-03
21 k6                               response to interleukin-1 4.584415e-03
22 k6               reactive oxygen species metabolic process 5.205687e-03
23 k6                                     leukocyte migration 6.552090e-03
24 k6                            response to interferon-gamma 1.182491e-02
25 k6            negative regulation of immune system process 1.215541e-02
26 k6                           response to type I interferon 1.215541e-02
27 k6                        negative regulation of transport 1.372321e-02
28 k6                    positive regulation of ion transport 1.432155e-02
29 k6                                interleukin-2 production 1.518603e-02
30 k6                                 maintenance of location 1.550851e-02
31 k6                             response to interferon-beta 1.551577e-02
32 k6                cellular response to inorganic substance 1.605400e-02
33 k6                    ribonucleoprotein complex biogenesis 2.164148e-02
34 k6                                   response to metal ion 2.299810e-02
35 k6       lymphocyte activation involved in immune response 2.307944e-02
36 k6   tumor necrosis factor superfamily cytokine production 2.324505e-02
37 k6                    cellular response to biotic stimulus 2.414756e-02
38 k6                                               cytolysis 2.422372e-02
39 k6                                 leukocyte proliferation 2.586724e-02
40 k6                               interleukin-12 production 2.601286e-02
41 k6                           negative regulation of growth 2.910712e-02
42 k6 regulation of DNA-binding transcription factor activity 3.470785e-02
43 k6                       regulation of metal ion transport 4.227634e-02
44 k6                                     tolerance induction 4.227634e-02
45 k6                             interferon-gamma production 4.228501e-02
46 k6    positive regulation of response to external stimulus 4.614297e-02
47 k6                                     positive chemotaxis 4.731393e-02

All k10 terms included in k11.

     k                                             description          FDR
1  k11            immune response-regulating signaling pathway 0.0002769325
2  k11                                   RNA catabolic process 0.0008400905
3  k11                                translational initiation 0.0009933375
4  k11           protein modification by small protein removal 0.0026623734
5  k11                                adaptive immune response 0.0105244395
6  k11                   intrinsic apoptotic signaling pathway 0.0105244395
7  k11                    regulation of mRNA metabolic process 0.0115369438
8  k11                         covalent chromatin modification 0.0182460356
9  k11                                 cytoplasmic translation 0.0281927311
10 k11       stress-activated protein kinase signaling cascade 0.0323421456
11 k11                    regulation of innate immune response 0.0405294541
12 k11                         regulation of protein stability 0.0405294541
13 k11          ribonucleoprotein complex subunit organization 0.0405294541
14 k11       establishment of protein localization to membrane 0.0414053094
15 k11                    ribonucleoprotein complex biogenesis 0.0414053094
16 k11       posttranscriptional regulation of gene expression 0.0414107071
17 k11                                   interaction with host 0.0456587986
18 k11                            leukocyte cell-cell adhesion 0.0456587986
19 k11 regulation of DNA-binding transcription factor activity 0.0468421506
20 k11                    cellular response to biotic stimulus 0.0483566047

Perform t-test while adjusting for confounders

Procedure

Test mean difference between tissue one donor at a time and then do meta-analysis with Fisher’s method

Results

X-axis denotes cell types and y-axis denotes the topics. For major cell types, we saw majority of topics have significant differences in proportions between tissue.


R version 4.2.0 (2022-04-22)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS/LAPACK: /software/openblas-0.3.13-el7-x86_64/lib/libopenblas_haswellp-r0.3.13.so

locale:
 [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C         LC_TIME=C           
 [4] LC_COLLATE=C         LC_MONETARY=C        LC_MESSAGES=C       
 [7] LC_PAPER=C           LC_NAME=C            LC_ADDRESS=C        
[10] LC_TELEPHONE=C       LC_MEASUREMENT=C     LC_IDENTIFICATION=C 

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

other attached packages:
 [1] ComplexHeatmap_2.14.0 colorRamp2_0.1.0      tidyr_1.3.1          
 [4] dplyr_1.1.4           poolr_1.1-1           cowplot_1.1.3        
 [7] ggplot2_3.5.1         fastTopics_0.6-175    Matrix_1.6-5         
[10] workflowr_1.7.1      

loaded via a namespace (and not attached):
  [1] matrixStats_1.2.0   fs_1.6.4            RColorBrewer_1.1-3 
  [4] doParallel_1.0.17   progress_1.2.3      httr_1.4.7         
  [7] rprojroot_2.0.4     tools_4.2.0         bslib_0.7.0        
 [10] DT_0.33             utf8_1.2.4          R6_2.5.1           
 [13] irlba_2.3.5.1       BiocGenerics_0.44.0 uwot_0.2.2         
 [16] lazyeval_0.2.2      colorspace_2.1-0    GetoptLong_1.0.5   
 [19] withr_3.0.0         tidyselect_1.2.1    prettyunits_1.2.0  
 [22] processx_3.8.3      compiler_4.2.0      git2r_0.33.0       
 [25] cli_3.6.2           Cairo_1.6-2         plotly_4.10.4      
 [28] labeling_0.4.3      sass_0.4.9          scales_1.3.0       
 [31] SQUAREM_2021.1      quadprog_1.5-8      callr_3.7.3        
 [34] pbapply_1.7-2       mixsqp_0.3-54       stringr_1.5.1      
 [37] digest_0.6.35       rmarkdown_2.26      RhpcBLASctl_0.23-42
 [40] pkgconfig_2.0.3     htmltools_0.5.8.1   highr_0.10         
 [43] fastmap_1.1.1       invgamma_1.1        GlobalOptions_0.1.2
 [46] htmlwidgets_1.6.4   rlang_1.1.3         rstudioapi_0.15.0  
 [49] farver_2.1.1        shape_1.4.6         jquerylib_0.1.4    
 [52] generics_0.1.3      jsonlite_1.8.8      crosstalk_1.2.1    
 [55] gtools_3.9.5        magrittr_2.0.3      S4Vectors_0.36.2   
 [58] Rcpp_1.0.12         munsell_0.5.1       fansi_1.0.6        
 [61] lifecycle_1.0.4     stringi_1.7.6       whisker_0.4.1      
 [64] yaml_2.3.8          mathjaxr_1.6-0      Rtsne_0.17         
 [67] parallel_4.2.0      promises_1.3.0      ggrepel_0.9.5      
 [70] crayon_1.5.2        lattice_0.22-5      circlize_0.4.15    
 [73] hms_1.1.3           knitr_1.46          ps_1.7.6           
 [76] pillar_1.9.0        rjson_0.2.21        stats4_4.2.0       
 [79] codetools_0.2-19    glue_1.7.0          evaluate_0.23      
 [82] getPass_0.2-2       data.table_1.15.4   RcppParallel_5.1.7 
 [85] vctrs_0.6.5         png_0.1-8           httpuv_1.6.14      
 [88] foreach_1.5.2       gtable_0.3.5        purrr_1.0.2        
 [91] clue_0.3-65         ashr_2.2-63         cachem_1.0.8       
 [94] xfun_0.43           later_1.3.2         viridisLite_0.4.2  
 [97] truncnorm_1.0-9     tibble_3.2.1        iterators_1.0.14   
[100] IRanges_2.32.0      cluster_2.1.6