The purpose of this script it to utilize module scoring to compare the gene expression profile of canine ALL, CD4 PTCL, and T-zone lymphoma to the gene signatures of normal canine thymocytes and nodal T cells at various stages of development derived from a single-cell transcriptomic atlas.
library(DESeq2)
library(RColorBrewer)
library(pheatmap)
library(dplyr)
library(readr)
library(knitr)
library(ggplot2)
library(Seurat)
# seurat object for thymus and lymph node atlas
seu <- readRDS(file = "C:/Users/edlarsen/Documents/240828_scRNAseq/T_Cells/IntegThymAndLN_Annotated.Rdata")
# deseq2 results of ALL vs bone marrow
df1 = read.csv("C:/Users/edlarsen/Downloads/DGE_Unsupervised.Signature.Ward_Lymphoid_vs_BMCNTRL_results.csv", header=TRUE)
# deseq2 results of CD4 PTCL vs CD4 control nodal T cells
df2 = read.csv("C:/Users/edlarsen/Documents/PTCLRNASeq/Cohort_2/Output/CD4_PTCLvsCD4_LN_CTRL_DESeq2res.csv")
# deseq2 results of TZL vs CD4 control nodal T cells
df3 = read.csv("C:/Users/edlarsen/Documents/TZL_DESeq/T_zonevsCTRL_CD4_DESeq2res.csv")
# omit entries with log2fc of 'NA'
df1 <- df1[!is.na(df1$log2FoldChange),]
df2 <- df2[!is.na(df2$log2FoldChange),]
df3 <- df3[!is.na(df3$log2FoldChange),]
# filter out cell cycle genes
df1_filtered <- df1 %>%
filter(!Symbol %in% cc.genes$s.genes)
df1_filtered <- df1 %>%
filter(!Symbol %in% cc.genes$g2m.genes)
df1_filtered <- df1 %>%
filter(!Symbol %in% cc.genes.updated.2019$s.genes)
df1_filtered <- df1 %>%
filter(!Symbol %in% cc.genes.updated.2019$g2m.genes)
df2_filtered <- df2 %>%
filter(!gene_name %in% cc.genes$s.genes)
df2_filtered <- df2 %>%
filter(!gene_name %in% cc.genes$g2m.genes)
df2_filtered <- df2 %>%
filter(!gene_name %in% cc.genes.updated.2019$s.genes)
df2_filtered <- df2 %>%
filter(!gene_name %in% cc.genes.updated.2019$g2m.genes)
df3_filtered <- df3 %>%
filter(!gene_name %in% cc.genes$s.genes)
df3_filtered <- df3 %>%
filter(!gene_name %in% cc.genes$g2m.genes)
df3_filtered <- df3 %>%
filter(!gene_name %in% cc.genes.updated.2019$s.genes)
df3_filtered <- df3 %>%
filter(!gene_name %in% cc.genes.updated.2019$g2m.genes)
# take only significantly upregulated genes (log2fc > 1, padj < 0.05)
df1_filtered_up <- df1_filtered %>%
filter(log2FoldChange >= 1) %>%
filter(padj < 0.05)
df2_filtered_up <- df2_filtered %>%
filter(log2FoldChange >= 1) %>%
filter(padj < 0.05)
df3_filtered_up <- df3_filtered %>%
filter(log2FoldChange >= 1) %>%
filter(padj < 0.05)
genes_up_ALL <- list(df1_filtered_up$Symbol)
genes_up_PTCL <- list(df2_filtered_up$gene_name)
genes_up_TZL <- list(df3_filtered_up$gene_name)
seu <- AddModuleScore(seu, features = genes_up_ALL, name = "ALL_Score")
seu <- AddModuleScore(seu, features = genes_up_PTCL, name = "PTCL_Score")
seu <- AddModuleScore(seu, features = genes_up_TZL, name = "TZL_Score")
DimPlot(seu,
reduction = "umap",
label = TRUE,
label.size = 3,
label.box = TRUE) + ggtitle("Single-cell Atlas of Canine T-cell Development") + NoLegend()
FeaturePlot(seu, features = "ALL_Score1") + scale_color_gradientn(colours = rev(brewer.pal(name = "Spectral", n=11))) + ggtitle("Expression of Genes Upregulated in ALL \nin an Atlas of Canine T-cell Development")
FeaturePlot(seu, features = "PTCL_Score1") + scale_color_gradientn(colours = rev(brewer.pal(name = "Spectral", n=11))) + ggtitle("Genes Upregulated in PTCL\nin an Atlas of Canine T-cell Development")
FeaturePlot(seu, features = "TZL_Score1") + scale_color_gradientn(colours = rev(brewer.pal(name = "Spectral", n=11))) + ggtitle("Genes Upregulated in T-zone Lymphoma\nin an Atlas of Canine T-cell Development")
sessionInfo()
## R version 4.4.0 (2024-04-24 ucrt)
## Platform: x86_64-w64-mingw32/x64
## Running under: Windows 11 x64 (build 22631)
##
## Matrix products: default
##
##
## locale:
## [1] LC_COLLATE=English_United States.utf8
## [2] LC_CTYPE=English_United States.utf8
## [3] LC_MONETARY=English_United States.utf8
## [4] LC_NUMERIC=C
## [5] LC_TIME=English_United States.utf8
##
## time zone: America/Denver
## tzcode source: internal
##
## attached base packages:
## [1] stats4 stats graphics grDevices utils datasets methods
## [8] base
##
## other attached packages:
## [1] Seurat_5.2.1 SeuratObject_5.0.2
## [3] sp_2.1-4 ggplot2_3.5.1
## [5] knitr_1.49 readr_2.1.5
## [7] dplyr_1.1.4 pheatmap_1.0.12
## [9] RColorBrewer_1.1-3 DESeq2_1.44.0
## [11] SummarizedExperiment_1.34.0 Biobase_2.64.0
## [13] MatrixGenerics_1.16.0 matrixStats_1.5.0
## [15] GenomicRanges_1.56.2 GenomeInfoDb_1.40.1
## [17] IRanges_2.38.1 S4Vectors_0.42.1
## [19] BiocGenerics_0.50.0
##
## loaded via a namespace (and not attached):
## [1] rstudioapi_0.17.1 jsonlite_1.8.9 magrittr_2.0.3
## [4] spatstat.utils_3.1-2 farver_2.1.2 rmarkdown_2.29
## [7] zlibbioc_1.50.0 vctrs_0.6.5 ROCR_1.0-11
## [10] spatstat.explore_3.3-4 htmltools_0.5.8.1 S4Arrays_1.4.1
## [13] SparseArray_1.4.8 sass_0.4.9 sctransform_0.4.1
## [16] parallelly_1.42.0 KernSmooth_2.23-22 bslib_0.8.0
## [19] htmlwidgets_1.6.4 ica_1.0-3 plyr_1.8.9
## [22] plotly_4.10.4 zoo_1.8-12 cachem_1.1.0
## [25] igraph_2.1.4 mime_0.12 lifecycle_1.0.4
## [28] pkgconfig_2.0.3 Matrix_1.7-0 R6_2.5.1
## [31] fastmap_1.2.0 GenomeInfoDbData_1.2.12 fitdistrplus_1.2-2
## [34] future_1.34.0 shiny_1.10.0 digest_0.6.35
## [37] colorspace_2.1-1 patchwork_1.3.0 tensor_1.5
## [40] RSpectra_0.16-2 irlba_2.3.5.1 labeling_0.4.3
## [43] progressr_0.15.1 spatstat.sparse_3.1-0 polyclip_1.10-7
## [46] httr_1.4.7 abind_1.4-8 compiler_4.4.0
## [49] withr_3.0.2 BiocParallel_1.38.0 fastDummies_1.7.5
## [52] MASS_7.3-60.2 DelayedArray_0.30.1 tools_4.4.0
## [55] lmtest_0.9-40 httpuv_1.6.15 future.apply_1.11.3
## [58] goftest_1.2-3 glue_1.8.0 nlme_3.1-164
## [61] promises_1.3.2 grid_4.4.0 Rtsne_0.17
## [64] cluster_2.1.6 reshape2_1.4.4 generics_0.1.3
## [67] spatstat.data_3.1-4 gtable_0.3.6 tzdb_0.4.0
## [70] tidyr_1.3.1 data.table_1.16.4 hms_1.1.3
## [73] XVector_0.44.0 spatstat.geom_3.3-5 RcppAnnoy_0.0.22
## [76] ggrepel_0.9.6 RANN_2.6.2 pillar_1.10.1
## [79] stringr_1.5.1 spam_2.11-1 RcppHNSW_0.6.0
## [82] later_1.4.1 splines_4.4.0 lattice_0.22-6
## [85] deldir_2.0-4 survival_3.5-8 tidyselect_1.2.1
## [88] locfit_1.5-9.10 miniUI_0.1.1.1 pbapply_1.7-2
## [91] gridExtra_2.3 scattermore_1.2 xfun_0.49
## [94] stringi_1.8.4 UCSC.utils_1.0.0 lazyeval_0.2.2
## [97] yaml_2.3.10 evaluate_1.0.3 codetools_0.2-20
## [100] tibble_3.2.1 cli_3.6.2 uwot_0.2.2
## [103] xtable_1.8-4 reticulate_1.40.0 munsell_0.5.1
## [106] jquerylib_0.1.4 Rcpp_1.0.14 spatstat.random_3.3-2
## [109] globals_0.16.3 png_0.1-8 spatstat.univar_3.1-1
## [112] parallel_4.4.0 dotCall64_1.2 listenv_0.9.1
## [115] viridisLite_0.4.2 scales_1.3.0 ggridges_0.5.6
## [118] purrr_1.0.2 crayon_1.5.3 rlang_1.1.3
## [121] cowplot_1.1.3
citation()
## To cite R in publications use:
##
## R Core Team (2024). _R: A Language and Environment for Statistical
## Computing_. R Foundation for Statistical Computing, Vienna, Austria.
## <https://www.R-project.org/>.
##
## A BibTeX entry for LaTeX users is
##
## @Manual{,
## title = {R: A Language and Environment for Statistical Computing},
## author = {{R Core Team}},
## organization = {R Foundation for Statistical Computing},
## address = {Vienna, Austria},
## year = {2024},
## url = {https://www.R-project.org/},
## }
##
## We have invested a lot of time and effort in creating R, please cite it
## when using it for data analysis. See also 'citation("pkgname")' for
## citing R packages.