Last updated: 2024-08-02

Checks: 7 0

Knit directory: 5_Treg_uNK/1_analysis/

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(12345) 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 73ae14f. 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:    .Rhistory
    Ignored:    .Rproj.user/

Untracked files:
    Untracked:  .DS_Store
    Untracked:  .gitignore
    Untracked:  cellChat.Rmd

Unstaged changes:
    Modified:   0_data/rds_plots/deHmap_plots.rds
    Modified:   0_data/rds_plots/go_combined_parTerm_dotPlot.rds
    Modified:   0_data/rds_plots/go_parTerm_dotPlot.rds
    Modified:   0_data/rds_plots/kegg_path_Hmap.rds
    Deleted:    1_analysis/cellChat.Rmd
    Modified:   3_output/GO_sig.xlsx
    Modified:   3_output/KEGG_all.xlsx
    Modified:   3_output/KEGG_sig.xlsx
    Modified:   3_output/de_genes_all.xlsx
    Modified:   3_output/de_genes_sig.xlsx
    Modified:   3_output/reactome_all.xlsx
    Modified:   3_output/reactome_sig.xlsx
    Modified:   sampleHeatmap.rds

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 (1_analysis/kegg.Rmd) and HTML (docs/kegg.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 73ae14f Ha Tran 2024-08-02 Large update with final visualisations
html 73ae14f Ha Tran 2024-08-02 Large update with final visualisations
Rmd a5cdd4e git 2024-03-25 switching os
Rmd d0ea132 Ha Manh Tran 2024-02-15 windows crashed
html e9e7671 tranmanhha135 2024-02-08 Build site.
Rmd 8da2e31 tranmanhha135 2024-02-08 workflowr::wflow_publish(here::here("1_analysis/*.Rmd"))
html d8d23ee tranmanhha135 2024-01-13 im on holiday
html 36aeb85 Ha Manh Tran 2024-01-13 Build site.
Rmd a957cff Ha Manh Tran 2024-01-13 workflowr::wflow_publish(here::here("1_analysis/*Rmd"))
Rmd c78dfac tranmanhha135 2024-01-12 remote from ipad
Rmd 221e2fa tranmanhha135 2024-01-10 fixed error
html 762020e tranmanhha135 2024-01-09 Build site.
Rmd c6d389f tranmanhha135 2024-01-09 workflowr::wflow_publish(here::here("1_analysis/*.Rmd"))
Rmd 05fa0b3 tranmanhha135 2024-01-06 added description

# working with data
library(dplyr)
library(magrittr)
library(readr)
library(tibble)
library(reshape2)
library(tidyverse)
library(KEGGREST)
library(data.table)
library(KEGGREST)
# Visualisation:
library(VennDiagram)
library(kableExtra)
library(ggplot2)
library(grid)
library(pander)
library(viridis)
library(cowplot)
library(pheatmap)
library(DT)
library(extrafont)

# Custom ggplot
library(ggplotify)
library(ggpubr)
library(ggbiplot)
library(ggrepel)

# Bioconductor packages:
library(edgeR)
library(limma)
library(Glimma)
library(clusterProfiler)
library(org.Mm.eg.db)
library(enrichplot)
library(pathview)

library(pandoc)
library(knitr)
opts_knit$set(progress = FALSE, verbose = FALSE)
opts_chunk$set(warning=FALSE, message=FALSE, echo=FALSE)

KEGG Analysis

KEGG pathway images reproduced by permission from Kanehisa Laboratories, September 2023

KEGG analysis, or Kyoto Encyclopedia of Genes and Genomes analysis, is a method that involves the mapping of molecular datasets, such as DE genes or proteins, to the reference pathways in the KEGG database. The KEGG database provides a comprehensive resource for understanding the molecular interaction and reaction networks within biological systems. KEGG pathways encompass a wide range of biological processes, including metabolism, cellular processes, environmental information processing, and human diseases.

More information about KEGG

The KEGG database is organized into several classes:

  • Pathway Maps (PATH): This class includes diagrams of molecular interactions and reactions in various biological pathways. Each pathway map is associated with specific biological processes or functions.

  • BRITE (B): BRITE is a hierarchical classification of biological entities, such as genes, proteins, and compounds. It provides a functional hierarchy and relationships between different biological components.

  • Module (M): Modules are sets of manually defined functional units, which can represent functional modules of genes or proteins in specific pathways.

  • Orthology (KO): The Orthology class provides information about orthologous gene groups, which are genes in different species that evolved from a common ancestral gene. This class is particularly useful for comparative genomics.

For this analysis, only KEGG pathway database will be used. This database is further sub-categorised into several classes:

  1. Metabolism
  2. Genetic Information Processing
  3. Environmental Information Processing
  4. Cellular Processes
  5. Organismal Systems
    1. Immune system (i.e. T cell receptor signaling pathway , Th1 and Th2 cell differentiation & etc.)
    2. Endocrine system (i.e. Estrogen signaling pathway , Progesterone-mediated oocyte maturation & etc.)
  6. Human Diseases
  7. Drug Development

Visualisation

The following visualisations are KEGG enrichment analysis performed with set of DE genes significantly below FDR < 0.1 without FC threshold (TREAT). IMPORTANTLY, these KEGG terms are significantly enriched with FDR < 0.2.

  • Dot plot: illustrates the top 7 enriched KEGG pathways

    • \(Gene ratio =\) the number of significant DE gene in the term / the total of number of genes in the term as indicated by the size
  • Table: list of all the significant KEGG pathways

    • NOTE: To keep this a readable table, the full pathway description were removed, check the exported Excel spreadsheet for full details on pathways class, descriptions, related pathways, and references
  • Upset: illustrate the overlap of gene between different pathways

I recommend reading through the full list of significant KEGG pathways and selecting the most biologically relevant for better visualisation

DT vs veh

Dot plot

Version Author Date
73ae14f Ha Tran 2024-08-02
e9e7671 tranmanhha135 2024-02-08
36aeb85 Ha Manh Tran 2024-01-13
762020e tranmanhha135 2024-01-09

Table

Upset Plot

Version Author Date
73ae14f Ha Tran 2024-08-02
e9e7671 tranmanhha135 2024-02-08
36aeb85 Ha Manh Tran 2024-01-13
762020e tranmanhha135 2024-01-09

DT+Treg vs veh

Dot plot

Version Author Date
73ae14f Ha Tran 2024-08-02
e9e7671 tranmanhha135 2024-02-08
36aeb85 Ha Manh Tran 2024-01-13
762020e tranmanhha135 2024-01-09

Table

Upset plot

Version Author Date
73ae14f Ha Tran 2024-08-02
e9e7671 tranmanhha135 2024-02-08
36aeb85 Ha Manh Tran 2024-01-13
762020e tranmanhha135 2024-01-09

DT+Treg vs DT

Dot plot

Version Author Date
73ae14f Ha Tran 2024-08-02
e9e7671 tranmanhha135 2024-02-08
36aeb85 Ha Manh Tran 2024-01-13
762020e tranmanhha135 2024-01-09

Table

Upset plot

Version Author Date
73ae14f Ha Tran 2024-08-02
e9e7671 tranmanhha135 2024-02-08
36aeb85 Ha Manh Tran 2024-01-13
762020e tranmanhha135 2024-01-09

Combined

Venn diagram

Dot plot

Version Author Date
73ae14f Ha Tran 2024-08-02
e9e7671 tranmanhha135 2024-02-08
36aeb85 Ha Manh Tran 2024-01-13

Pathway specific heatmaps

Here the top 4 most interesting KEGG pathways were selected for further visualisations.

These visualisations are similarly performed with set of DE genes significantly below FDR < 0.1 or < 0.05 with and without FC threshold (TREAT). IMPORTANTLY, these KEGG terms are all significantly enriched but only with P-value < 0.05 and no P-value correction method.

  • Heatmap: illustrates the expression of genes in specific KEGG pathways.

    • The genes (rows) and samples (columns) are heirachirally clusterd based on their expression profile.
  • Table: list of all the significant DE genes in the specified KEGG pathway

  • Pathview: maps gene expression data onto the specified KEGG pathways, allowing users to see where genes in their dataset are located within specific pathways, and potential upstream and downstream elements.

Antigen processing and presentation

Heatmap

Version Author Date
73ae14f Ha Tran 2024-08-02
e9e7671 tranmanhha135 2024-02-08

Table

Pathview

Natural killer cell mediated cytotoxicity

Heatmap

Version Author Date
73ae14f Ha Tran 2024-08-02
e9e7671 tranmanhha135 2024-02-08

Table

Pathview

Epstein-Barr virus infection

Heatmap

Version Author Date
73ae14f Ha Tran 2024-08-02
e9e7671 tranmanhha135 2024-02-08

Table

Pathview

Phagosome

Heatmap

Version Author Date
73ae14f Ha Tran 2024-08-02
e9e7671 tranmanhha135 2024-02-08

Table

Pathview

Export Data

The following are exported:

  • KEGG_all.xlsx - This spreadsheet contains all KEGG pathways

  • KEGG_sig.xlsx - This spreadsheet contains all significant (P value < 0.05) KEGG pathways


R version 4.4.1 (2024-06-14)
Platform: aarch64-apple-darwin20
Running under: macOS Sonoma 14.5

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRblas.0.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: Australia/Adelaide
tzcode source: internal

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

other attached packages:
 [1] knitr_1.48             pandoc_0.2.0           pathview_1.44.0       
 [4] enrichplot_1.24.2      org.Mm.eg.db_3.19.1    AnnotationDbi_1.66.0  
 [7] IRanges_2.38.1         S4Vectors_0.42.1       Biobase_2.64.0        
[10] BiocGenerics_0.50.0    clusterProfiler_4.12.2 Glimma_2.14.0         
[13] edgeR_4.2.1            limma_3.60.4           ggrepel_0.9.5.9999    
[16] ggbiplot_0.6.2         ggpubr_0.6.0           ggplotify_0.1.2       
[19] extrafont_0.19         DT_0.33                pheatmap_1.0.12       
[22] cowplot_1.1.3          viridis_0.6.5          viridisLite_0.4.2     
[25] pander_0.6.5           kableExtra_1.4.0       VennDiagram_1.7.3     
[28] futile.logger_1.4.3    data.table_1.15.4      KEGGREST_1.44.1       
[31] lubridate_1.9.3        forcats_1.0.0          stringr_1.5.1         
[34] purrr_1.0.2            tidyr_1.3.1            ggplot2_3.5.1         
[37] tidyverse_2.0.0        reshape2_1.4.4         tibble_3.2.1          
[40] readr_2.1.5            magrittr_2.0.3         dplyr_1.1.4           

loaded via a namespace (and not attached):
  [1] fs_1.6.4                    matrixStats_1.3.0          
  [3] bitops_1.0-8                HDO.db_0.99.1              
  [5] httr_1.4.7                  RColorBrewer_1.1-3         
  [7] doParallel_1.0.17           Rgraphviz_2.48.0           
  [9] tools_4.4.1                 backports_1.5.0            
 [11] utf8_1.2.4                  R6_2.5.1                   
 [13] lazyeval_0.2.2              GetoptLong_1.0.5           
 [15] withr_3.0.1                 gridExtra_2.3              
 [17] cli_3.6.3                   textshaping_0.4.0          
 [19] formatR_1.14                scatterpie_0.2.3           
 [21] labeling_0.4.3              sass_0.4.9                 
 [23] KEGGgraph_1.64.0            systemfonts_1.1.0          
 [25] yulab.utils_0.1.5           gson_0.1.0                 
 [27] ggupset_0.4.0               DOSE_3.30.2                
 [29] svglite_2.1.3               rstudioapi_0.16.0          
 [31] RSQLite_2.3.7               generics_0.1.3             
 [33] gridGraphics_0.5-1          shape_1.4.6.1              
 [35] crosstalk_1.2.1             car_3.1-2                  
 [37] GO.db_3.19.1                Matrix_1.7-0               
 [39] fansi_1.0.6                 abind_1.4-5                
 [41] lifecycle_1.0.4             whisker_0.4.1              
 [43] yaml_2.3.10                 carData_3.0-5              
 [45] SummarizedExperiment_1.34.0 qvalue_2.36.0              
 [47] SparseArray_1.4.8           blob_1.2.4                 
 [49] promises_1.3.0              crayon_1.5.3               
 [51] lattice_0.22-6              magick_2.8.4               
 [53] pillar_1.9.0                ComplexHeatmap_2.20.0      
 [55] fgsea_1.30.0                GenomicRanges_1.56.1       
 [57] rjson_0.2.21                codetools_0.2-20           
 [59] fastmatch_1.1-4             glue_1.7.0                 
 [61] ggfun_0.1.5                 vctrs_0.6.5                
 [63] png_0.1-8                   treeio_1.28.0              
 [65] gtable_0.3.5                cachem_1.1.0               
 [67] xfun_0.46                   S4Arrays_1.4.1             
 [69] tidygraph_1.3.1             iterators_1.0.14           
 [71] statmod_1.5.0               nlme_3.1-165               
 [73] ggtree_3.12.0               bit64_4.0.5                
 [75] GenomeInfoDb_1.40.1         rprojroot_2.0.4            
 [77] bslib_0.8.0                 colorspace_2.1-1           
 [79] DBI_1.2.3                   DESeq2_1.44.0              
 [81] tidyselect_1.2.1            bit_4.0.5                  
 [83] compiler_4.4.1              extrafontdb_1.0            
 [85] curl_5.2.1                  git2r_0.33.0               
 [87] graph_1.82.0                xml2_1.3.6                 
 [89] DelayedArray_0.30.1         shadowtext_0.1.4           
 [91] scales_1.3.0                rappdirs_0.3.3             
 [93] digest_0.6.36               rmarkdown_2.27             
 [95] XVector_0.44.0              htmltools_0.5.8.1          
 [97] pkgconfig_2.0.3             MatrixGenerics_1.16.0      
 [99] highr_0.11                  fastmap_1.2.0              
[101] rlang_1.1.4                 GlobalOptions_0.1.2        
[103] htmlwidgets_1.6.4           UCSC.utils_1.0.0           
[105] farver_2.1.2                jquerylib_0.1.4            
[107] jsonlite_1.8.8              BiocParallel_1.38.0        
[109] GOSemSim_2.30.0             RCurl_1.98-1.16            
[111] GenomeInfoDbData_1.2.12     patchwork_1.2.0            
[113] munsell_0.5.1               Rcpp_1.0.13                
[115] ape_5.8                     stringi_1.8.4              
[117] ggraph_2.2.1                zlibbioc_1.50.0            
[119] MASS_7.3-61                 plyr_1.8.9                 
[121] org.Hs.eg.db_3.19.1         parallel_4.4.1             
[123] Biostrings_2.72.1           graphlayouts_1.1.1         
[125] splines_4.4.1               hms_1.1.3                  
[127] circlize_0.4.16             locfit_1.5-9.10            
[129] igraph_2.0.3                ggsignif_0.6.4             
[131] futile.options_1.0.1        XML_3.99-0.17              
[133] evaluate_0.24.0             lambda.r_1.2.4             
[135] tzdb_0.4.0                  foreach_1.5.2              
[137] tweenr_2.0.3                httpuv_1.6.15              
[139] Rttf2pt1_1.3.12             polyclip_1.10-7            
[141] clue_0.3-65                 ggforce_0.4.2              
[143] broom_1.0.6                 tidytree_0.4.6             
[145] rstatix_0.7.2               later_1.3.2                
[147] ragg_1.3.2                  aplot_0.2.3                
[149] memoise_2.0.1               writexl_1.5.0              
[151] cluster_2.1.6               workflowr_1.7.1            
[153] timechange_0.3.0            here_1.0.1