Values of RMarkdown parameters
::opts_chunk$set(echo = TRUE, warning=FALSE, collapse = TRUE) knitr
for (i in 1:length(params))
print(paste('Parameter:', names(params)[i], ' - Value:', params[[i]], '- Class:', class(params[[i]])))
## [1] "Parameter: DEA_CTL04 - Value: ~/DataDir/bulkRNASeq/5.DifferentialExpression/CTL04/DEARes.rds - Class: character"
## [1] "Parameter: DEA_CTL08 - Value: ~/DataDir/bulkRNASeq/5.DifferentialExpression/CTL08/DEARes.rds - Class: character"
## [1] "Parameter: OutputFolder - Value: ~/DataDir/bulkRNASeq/9.DEGsCharacterization/BothLines/ - Class: character"
library(RNASeqBulkExploratory) #Our Package
library(ggplot2)
library(gridExtra)
library(dplyr)
##
## Attaching package: 'dplyr'
## The following object is masked from 'package:gridExtra':
##
## combine
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
<- readRDS(params$DEA_CTL08)
DEA_CTL08 <- readRDS(params$DEA_CTL04) DEA_CTL04
Saving DEGs into excel files with DEGs from each comparison (AgvsInh) in separate sheets (ordered by adjusted p-value).
<- vector("list", length(names(DEA_CTL04))) %>% setNames(names(DEA_CTL04))
list_DEGs_CTL04
for (Cond in names(list_DEGs_CTL04)) {
<- DEA_CTL04[[Cond]]$AgvsInh$DEGs %>% arrange(padj)
list_DEGs_CTL04[[Cond]]
}
<- list_DEGs_CTL04 %>% setNames(paste0("DEGs_", names(list_DEGs_CTL04), "_AgvsInh"))
list_DEGs_CTL04
::write.xlsx(list_DEGs_CTL04, paste0(params$OutputFolder, "DEGs_CTL04_AgvsInh.xlsx"), rowNames = TRUE, headerStyle = openxlsx::createStyle(textDecoration = "Bold")) openxlsx
<- vector("list", length(names(DEA_CTL04))) %>% setNames(names(DEA_CTL04)) #keep CTL04 to have the same order in the final file
list_DEGs_CTL08
for (Cond in names(list_DEGs_CTL08)[names(list_DEGs_CTL08) != "Estr"]) {
<- DEA_CTL08[[Cond]]$AgvsInh$DEGs %>% arrange(padj)
list_DEGs_CTL08[[Cond]]
}
<- list_DEGs_CTL08 %>% setNames(paste0("DEGs_", names(list_DEGs_CTL08), "_AgvsInh"))
list_DEGs_CTL08
#We do not have Estr Inh so we will save only DEGs AgvsDMSO
grep("Estr", names(list_DEGs_CTL08))]] <- DEA_CTL08[["Estr"]]$Agonist$DEGs %>% arrange(padj)
list_DEGs_CTL08[[names(list_DEGs_CTL08)[[grep("Estr", names(list_DEGs_CTL08))]] <- "DEGs_Estr_AgvsDMSO"
::write.xlsx(list_DEGs_CTL08, paste0(params$OutputFolder, "DEGs_CTL08_AgvsInh.xlsx"), rowNames = TRUE, headerStyle = openxlsx::createStyle(textDecoration = "Bold")) openxlsx
computeCompResFC(DEA_CTL08$Ret$Agonist$Res, DEA_CTL04$Ret$Agonist$Res, LogFCth = 1, padjth = 0.01, LogFCceil = 1000, padjceil = 0)$topGenes
## Loading required package: DESeq2
## Loading required package: S4Vectors
## Loading required package: stats4
## Loading required package: BiocGenerics
##
## Attaching package: 'BiocGenerics'
## The following objects are masked from 'package:dplyr':
##
## combine, intersect, setdiff, union
## The following object is masked from 'package:gridExtra':
##
## combine
## The following objects are masked from 'package:stats':
##
## IQR, mad, sd, var, xtabs
## The following objects are masked from 'package:base':
##
## anyDuplicated, aperm, append, as.data.frame, basename, cbind,
## colnames, dirname, do.call, duplicated, eval, evalq, Filter, Find,
## get, grep, grepl, intersect, is.unsorted, lapply, Map, mapply,
## match, mget, order, paste, pmax, pmax.int, pmin, pmin.int,
## Position, rank, rbind, Reduce, rownames, sapply, setdiff, sort,
## table, tapply, union, unique, unsplit, which.max, which.min
##
## Attaching package: 'S4Vectors'
## The following objects are masked from 'package:dplyr':
##
## first, rename
## The following objects are masked from 'package:base':
##
## expand.grid, I, unname
## Loading required package: IRanges
##
## Attaching package: 'IRanges'
## The following objects are masked from 'package:dplyr':
##
## collapse, desc, slice
## Loading required package: GenomicRanges
## Loading required package: GenomeInfoDb
## Loading required package: SummarizedExperiment
## Loading required package: MatrixGenerics
## Loading required package: matrixStats
##
## Attaching package: 'matrixStats'
## The following object is masked from 'package:dplyr':
##
## count
##
## Attaching package: 'MatrixGenerics'
## The following objects are masked from 'package:matrixStats':
##
## colAlls, colAnyNAs, colAnys, colAvgsPerRowSet, colCollapse,
## colCounts, colCummaxs, colCummins, colCumprods, colCumsums,
## colDiffs, colIQRDiffs, colIQRs, colLogSumExps, colMadDiffs,
## colMads, colMaxs, colMeans2, colMedians, colMins, colOrderStats,
## colProds, colQuantiles, colRanges, colRanks, colSdDiffs, colSds,
## colSums2, colTabulates, colVarDiffs, colVars, colWeightedMads,
## colWeightedMeans, colWeightedMedians, colWeightedSds,
## colWeightedVars, rowAlls, rowAnyNAs, rowAnys, rowAvgsPerColSet,
## rowCollapse, rowCounts, rowCummaxs, rowCummins, rowCumprods,
## rowCumsums, rowDiffs, rowIQRDiffs, rowIQRs, rowLogSumExps,
## rowMadDiffs, rowMads, rowMaxs, rowMeans2, rowMedians, rowMins,
## rowOrderStats, rowProds, rowQuantiles, rowRanges, rowRanks,
## rowSdDiffs, rowSds, rowSums2, rowTabulates, rowVarDiffs, rowVars,
## rowWeightedMads, rowWeightedMeans, rowWeightedMedians,
## rowWeightedSds, rowWeightedVars
## Loading required package: Biobase
## Welcome to Bioconductor
##
## Vignettes contain introductory material; view with
## 'browseVignettes()'. To cite Bioconductor, see
## 'citation("Biobase")', and for packages 'citation("pkgname")'.
##
## Attaching package: 'Biobase'
## The following object is masked from 'package:MatrixGenerics':
##
## rowMedians
## The following objects are masked from 'package:matrixStats':
##
## anyMissing, rowMedians
## The number of genes in the first data set is 14850
## The number of genes in the second data set is 14305
## The number of common genes that will be examined is 14150
## $Up_Up
## [1] "HOPX" "HOXB3" "NXPH2" "SKAP2" "SLC6A5" "CDH1" "RASGRP3"
## [8] "HTR2C" "SLC30A3" "DMRT3"
##
## $Down_Down
## [1] "LHX9" "RSPO1" "ZIC5" "BMP5" "ZIC2" "ZIC4" "EN2" "ZIC3" "CNPY1"
## [10] "GSX1"
##
## $Up_Down
## [1] "FOXA1" "COL21A1" "HK2"
##
## $Down_Up
## [1] "APOE" "PGAM2" "PYGM"
compResFScatter(DEA_CTL08$Ret$Agonist$Res, DEA_CTL04$Ret$Agonist$Res, LogFCth = 1, padjth = 0.01, LogFCceil = 8, padjceil = 0, Interactive = TRUE)
## The number of genes in the first data set is 14850
## The number of genes in the second data set is 14305
## The number of common genes that will be examined is 14150
computeCompResFC(DEA_CTL08$Ret$AgvsInh$Res, DEA_CTL04$Ret$AgvsInh$Res, LogFCth = 1, padjth = 0.01 , LogFCceil = 1000, padjceil = 0)$topGenes
## The number of genes in the first data set is 14850
## The number of genes in the second data set is 14305
## The number of common genes that will be examined is 14150
## $Up_Up
## [1] "HOPX" "HTR2C" "CSMD1" "VSNL1" "NXPH2" "SPHKAP"
## [7] "NOS1" "SYTL5" "PLPP4" "SYNDIG1L"
##
## $Down_Down
## [1] "RSPO1" "ZIC5" "ZIC2" "EN2" "ZIC3" "ZIC4" "BMP5" "GSX1"
## [9] "CNPY1" "TFAP2B"
##
## $Up_Down
## character(0)
##
## $Down_Up
## [1] "C1QL3"
compResFScatter(DEA_CTL08$Ret$AgvsInh$Res, DEA_CTL04$Ret$AgvsInh$Res, LogFCth = 1, padjth = 0.01 , LogFCceil = 8, padjceil = 0, Interactive = TRUE)
## The number of genes in the first data set is 14850
## The number of genes in the second data set is 14305
## The number of common genes that will be examined is 14150
computeCompResFC(DEA_CTL08$Thyr$Agonist$Res, DEA_CTL04$Thyr$Agonist$Res, LogFCth = 1, padjth = 0.01, LogFCceil = 1000,padjceil = 0)$topGenes
## The number of genes in the first data set is 14850
## The number of genes in the second data set is 14305
## The number of common genes that will be examined is 14150
## $Up_Up
## [1] "HTR2C" "WFIKKN2" "OTX1" "C11orf87" "SPARCL1" "RGS6"
## [7] "DRGX" "HCN1" "ISLR2" "SPOCK1"
##
## $Down_Down
## [1] "HSPA6"
##
## $Up_Down
## [1] "SP5"
##
## $Down_Up
## character(0)
compResFScatter(DEA_CTL08$Thyr$Agonist$Res, DEA_CTL04$Thyr$Agonist$Res, LogFCth = 1, padjth = 0.01, padjceil = 0, Interactive = TRUE)
## The number of genes in the first data set is 14850
## The number of genes in the second data set is 14305
## The number of common genes that will be examined is 14150
computeCompResFC(DEA_CTL08$Thyr$AgvsInh$Res, DEA_CTL04$Thyr$AgvsInh$Res, LogFCth = 1, padjth = 0.01, LogFCceil = 1000,padjceil = 0)$topGenes
## The number of genes in the first data set is 14850
## The number of genes in the second data set is 14305
## The number of common genes that will be examined is 14150
## $Up_Up
## [1] "TREX1" "CABCOCO1" "APLN" "TNC" "SLA"
## [6] "PBLD" "MATN2" "ZSCAN1" "RGS6" "CSGALNACT1"
##
## $Down_Down
## [1] "HSPA6" "NPC1L1" "CPT1A" "H2BC8" "H4C8"
## [6] "SNX31" "AL031777.2" "HSPA1B" "H1-2" "TNFRSF14"
##
## $Up_Down
## character(0)
##
## $Down_Up
## character(0)
compResFScatter(DEA_CTL08$Thyr$AgvsInh$Res, DEA_CTL04$Thyr$AgvsInh$Res, LogFCth = 1, padjth = 0.01, padjceil = 0, Interactive = TRUE)
## The number of genes in the first data set is 14850
## The number of genes in the second data set is 14305
## The number of common genes that will be examined is 14150
computeCompResFC(DEA_CTL08$Estr$Agonist$Res, DEA_CTL04$Estr$Agonist$Res, LogFCth = 1, padjth = 0.01, LogFCceil = 1000,padjceil = 0)$topGenes
## The number of genes in the first data set is 14850
## The number of genes in the second data set is 14305
## The number of common genes that will be examined is 14150
## $Up_Up
## character(0)
##
## $Down_Down
## character(0)
##
## $Up_Down
## character(0)
##
## $Down_Up
## character(0)
compResFScatter(DEA_CTL08$Estr$Agonist$Res, DEA_CTL04$Estr$Agonist$Res, LogFCth = 1, padjth = 0.01, padjceil = 0, Interactive = TRUE)
## The number of genes in the first data set is 14850
## The number of genes in the second data set is 14305
## The number of common genes that will be examined is 14150
Absent/low quality samples for estrogen inhibitor CTL08
computeCompResFC(DEA_CTL08$Andr$Agonist$Res, DEA_CTL04$Andr$Agonist$Res, LogFCth = 1, padjth = 0.01, LogFCceil = 1000,padjceil = 0)$topGenes
## The number of genes in the first data set is 14850
## The number of genes in the second data set is 14305
## The number of common genes that will be examined is 14150
## $Up_Up
## character(0)
##
## $Down_Down
## character(0)
##
## $Up_Down
## character(0)
##
## $Down_Up
## [1] "SNX31"
compResFScatter(DEA_CTL08$Andr$Agonist$Res, DEA_CTL04$Andr$Agonist$Res, LogFCth = 1, padjth = 0.01, padjceil = 0, Interactive = TRUE)
## The number of genes in the first data set is 14850
## The number of genes in the second data set is 14305
## The number of common genes that will be examined is 14150
computeCompResFC(DEA_CTL08$Andr$AgvsInh$Res, DEA_CTL04$Andr$AgvsInh$Res, LogFCth = 1, padjth = 0.01, LogFCceil = 1000, padjceil = 0)$topGenes
## The number of genes in the first data set is 14850
## The number of genes in the second data set is 14305
## The number of common genes that will be examined is 14150
## $Up_Up
## [1] "H3C6"
##
## $Down_Down
## character(0)
##
## $Up_Down
## character(0)
##
## $Down_Up
## character(0)
compResFScatter(DEA_CTL08$Andr$AgvsInh$Res, DEA_CTL04$Andr$AgvsInh$Res, LogFCth = 1, padjth = 0.01, padjceil = 0, Interactive = TRUE)
## The number of genes in the first data set is 14850
## The number of genes in the second data set is 14305
## The number of common genes that will be examined is 14150
computeCompResFC(DEA_CTL08$GC$Agonist$Res, DEA_CTL04$GC$Agonist$Res, LogFCth = 1, padjth = 0.01, LogFCceil = 1000, padjceil = 0)$topGenes
## The number of genes in the first data set is 14850
## The number of genes in the second data set is 14305
## The number of common genes that will be examined is 14150
## $Up_Up
## character(0)
##
## $Down_Down
## character(0)
##
## $Up_Down
## character(0)
##
## $Down_Up
## character(0)
compResFScatter(DEA_CTL08$GC$Agonist$Res, DEA_CTL04$GC$Agonist$Res, LogFCth = 1, padjth = 0.01, padjceil = 0, Interactive = TRUE)
## The number of genes in the first data set is 14850
## The number of genes in the second data set is 14305
## The number of common genes that will be examined is 14150
computeCompResFC(DEA_CTL08$GC$AgvsInh$Res, DEA_CTL04$GC$AgvsInh$Res, LogFCth = 1, padjth = 0.01, padjceil = 0, LogFCceil = 1000)$topGenes
## The number of genes in the first data set is 14850
## The number of genes in the second data set is 14305
## The number of common genes that will be examined is 14150
## $Up_Up
## [1] "NPY" "PROKR1" "ATP1A2" "FGF1" "RHOJ" "ALDH1L1" "IFI44"
## [8] "HSD17B8" "FBLN5" "CD9"
##
## $Down_Down
## [1] "HSPE1-MOB4" "CPT1A" "HSPA1B" "HSPH1" "DNAJB1"
## [6] "CHORDC1" "HSPA6" "H2BC5" "H4C9" "AL031777.2"
##
## $Up_Down
## character(0)
##
## $Down_Up
## character(0)
compResFScatter(DEA_CTL08$GC$AgvsInh$Res, DEA_CTL04$GC$AgvsInh$Res, LogFCth = 1, padjth = 0.01, padjceil = 0, LogFCceil = 6, Interactive = TRUE)
## The number of genes in the first data set is 14850
## The number of genes in the second data set is 14305
## The number of common genes that will be examined is 14150
computeCompResFC(DEA_CTL08$AhHyd$Agonist$Res, DEA_CTL04$AhHyd$Agonist$Res, LogFCth = 1, padjth = 0.01, LogFCceil = 1000, padjceil = 0)$topGenes
## The number of genes in the first data set is 14850
## The number of genes in the second data set is 14305
## The number of common genes that will be examined is 14150
## $Up_Up
## character(0)
##
## $Down_Down
## character(0)
##
## $Up_Down
## character(0)
##
## $Down_Up
## character(0)
compResFScatter(DEA_CTL08$AhHyd$Agonist$Res, DEA_CTL04$AhHyd$Agonist$Res, LogFCth = 1, padjth = 0.01, padjceil = 0, Interactive = TRUE)
## The number of genes in the first data set is 14850
## The number of genes in the second data set is 14305
## The number of common genes that will be examined is 14150
computeCompResFC(DEA_CTL08$AhHyd$AgvsInh$Res, DEA_CTL04$AhHyd$AgvsInh$Res, LogFCth = 1, padjth = 0.01, LogFCceil = 1000, padjceil = 0)$topGenes
## The number of genes in the first data set is 14850
## The number of genes in the second data set is 14305
## The number of common genes that will be examined is 14150
## $Up_Up
## character(0)
##
## $Down_Down
## [1] "PPP1R16B" "VGF" "NKX1-2" "SPRY4" "NEFL" "C4orf50"
## [7] "CNTN1" "ONECUT2" "FRRS1L" "PABPC1L2A"
##
## $Up_Down
## character(0)
##
## $Down_Up
## [1] "HSPA6" "FLNC"
compResFScatter(DEA_CTL08$AhHyd$AgvsInh$Res, DEA_CTL04$AhHyd$AgvsInh$Res, LogFCth = 1, padjth = 0.01, padjceil = 0, Interactive = TRUE)
## The number of genes in the first data set is 14850
## The number of genes in the second data set is 14305
## The number of common genes that will be examined is 14150
computeCompResFC(DEA_CTL08$LivX$Agonist$Res, DEA_CTL04$LivX$Agonist$Res, LogFCth = 1, padjth = 0.01, LogFCceil = 1000, padjceil = 0)$topGenes
## The number of genes in the first data set is 14850
## The number of genes in the second data set is 14305
## The number of common genes that will be examined is 14150
## $Up_Up
## [1] "ABCA1" "ABCG1" "SREBF1" "MYLIP"
##
## $Down_Down
## character(0)
##
## $Up_Down
## character(0)
##
## $Down_Up
## character(0)
compResFScatter(DEA_CTL08$LivX$Agonist$Res, DEA_CTL04$LivX$Agonist$Res, LogFCth = 1, padjth = 0.01, padjceil = 0, Interactive = TRUE)
## The number of genes in the first data set is 14850
## The number of genes in the second data set is 14305
## The number of common genes that will be examined is 14150
computeCompResFC(DEA_CTL08$LivX$AgvsInh$Res, DEA_CTL04$LivX$AgvsInh$Res, LogFCth = 1, padjth = 0.01, padjceil = 0, LogFCceil = 1000)$topGenes
## The number of genes in the first data set is 14850
## The number of genes in the second data set is 14305
## The number of common genes that will be examined is 14150
## $Up_Up
## [1] "ABCA1" "ABCG1" "SREBF1" "MYLIP" "LPCAT3" "PROKR1" "ADAMTS3"
## [8] "ACSL3" "CASQ1" "SHFL"
##
## $Down_Down
## [1] "AC099489.1" "DERL3" "ARHGAP45"
##
## $Up_Down
## [1] "H4C8" "HSPH1" "SNX31" "H2BC8" "H2AC6"
## [6] "FOS" "AL031777.2" "H2BC7" "H2BC5" "H2BC6"
##
## $Down_Up
## [1] "HSD17B8" "PYCR3" "GGACT" "PRODH" "PCK2" "DNPH1" "GDF15"
## [8] "ART5" "TMEM129" "HINT2"
compResFScatter(DEA_CTL08$LivX$AgvsInh$Res, DEA_CTL04$LivX$AgvsInh$Res, LogFCth = 1, padjth = 0.01, padjceil = 0, Interactive = TRUE)
## The number of genes in the first data set is 14850
## The number of genes in the second data set is 14305
## The number of common genes that will be examined is 14150
date()
## [1] "Mon Jul 21 23:14:32 2025"
sessionInfo()
## R version 4.2.1 (2022-06-23)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 20.04.4 LTS
##
## Matrix products: default
## BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
## LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0
##
## locale:
## [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
## [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
## [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
## [7] LC_PAPER=en_US.UTF-8 LC_NAME=C
## [9] LC_ADDRESS=C LC_TELEPHONE=C
## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
##
## attached base packages:
## [1] stats4 stats graphics grDevices utils datasets methods
## [8] base
##
## other attached packages:
## [1] DESeq2_1.38.3 SummarizedExperiment_1.28.0
## [3] Biobase_2.58.0 MatrixGenerics_1.10.0
## [5] matrixStats_0.63.0 GenomicRanges_1.50.2
## [7] GenomeInfoDb_1.34.9 IRanges_2.32.0
## [9] S4Vectors_0.36.1 BiocGenerics_0.44.0
## [11] dplyr_1.1.0 gridExtra_2.3
## [13] ggplot2_3.4.1 RNASeqBulkExploratory_0.2.1
##
## loaded via a namespace (and not attached):
## [1] bitops_1.0-7 bit64_4.0.5 RColorBrewer_1.1-3
## [4] httr_1.4.5 tools_4.2.1 bslib_0.4.2
## [7] utf8_1.2.3 R6_2.5.1 DT_0.27
## [10] DBI_1.1.3 lazyeval_0.2.2 colorspace_2.1-0
## [13] withr_2.5.0 tidyselect_1.2.0 bit_4.0.5
## [16] compiler_4.2.1 cli_3.6.1 DelayedArray_0.24.0
## [19] plotly_4.10.1 labeling_0.4.2 sass_0.4.5
## [22] scales_1.2.1 digest_0.6.31 rmarkdown_2.20
## [25] XVector_0.38.0 pkgconfig_2.0.3 htmltools_0.5.4
## [28] fastmap_1.1.1 htmlwidgets_1.6.1 rlang_1.1.1
## [31] rstudioapi_0.14 RSQLite_2.3.0 jquerylib_0.1.4
## [34] generics_0.1.3 jsonlite_1.8.4 crosstalk_1.2.0
## [37] BiocParallel_1.32.5 zip_2.2.2 RCurl_1.98-1.10
## [40] magrittr_2.0.3 GenomeInfoDbData_1.2.9 Matrix_1.5-3
## [43] Rcpp_1.0.10 munsell_0.5.0 fansi_1.0.4
## [46] lifecycle_1.0.3 stringi_1.7.12 yaml_2.3.7
## [49] zlibbioc_1.44.0 grid_4.2.1 blob_1.2.3
## [52] parallel_4.2.1 crayon_1.5.2 lattice_0.20-45
## [55] Biostrings_2.66.0 annotate_1.76.0 KEGGREST_1.38.0
## [58] locfit_1.5-9.7 knitr_1.42 pillar_1.8.1
## [61] geneplotter_1.76.0 codetools_0.2-19 XML_3.99-0.13
## [64] glue_1.6.2 evaluate_0.20 data.table_1.14.8
## [67] vctrs_0.6.2 png_0.1-8 gtable_0.3.1
## [70] purrr_1.0.1 tidyr_1.3.0 cachem_1.0.7
## [73] xfun_0.37 openxlsx_4.2.5.2 xtable_1.8-4
## [76] viridisLite_0.4.1 tibble_3.2.1 AnnotationDbi_1.60.0
## [79] memoise_2.0.1 ellipsis_0.3.2