Purpose

Heatmaps of DEGs in common among CTL04 samples.

1. Environment SetUp

knitr::opts_chunk$set(echo = TRUE, warning=FALSE, collapse = TRUE)
library(tidyr)
library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(ggplot2)
library(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: GenomicRanges
## 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 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
## Loading required package: S4Vectors
## 
## Attaching package: 'S4Vectors'
## The following objects are masked from 'package:dplyr':
## 
##     first, rename
## The following object is masked from 'package:tidyr':
## 
##     expand
## 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: GenomeInfoDb
## 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
library(sechm)
library(ashr)
library(sva)
## Loading required package: mgcv
## Loading required package: nlme
## 
## Attaching package: 'nlme'
## The following object is masked from 'package:IRanges':
## 
##     collapse
## The following object is masked from 'package:dplyr':
## 
##     collapse
## This is mgcv 1.8-41. For overview type 'help("mgcv-package")'.
## Loading required package: genefilter
## 
## Attaching package: 'genefilter'
## The following objects are masked from 'package:MatrixGenerics':
## 
##     rowSds, rowVars
## The following objects are masked from 'package:matrixStats':
## 
##     rowSds, rowVars
## Loading required package: BiocParallel
library(DESeq2)

OutputFolder <- params$OutputFolder
if (dir.exists(OutputFolder) == FALSE) {
 dir.create(OutputFolder, recursive=FALSE)
}

2. Data Upload and Preparation

DEA <- readRDS(paste0(params$InputFolder, 'DEARes.rds'))
SE_Bio <- readRDS(params$SE)
colData(SE_Bio)$Condition <- as.factor(colData(SE_Bio)$Condition)
colData(SE_Bio)$Condition <- factor(colData(SE_Bio)$Condition, levels = c("DMSO", setdiff(levels(colData(SE_Bio)$Condition), "DMSO")))
SE_Bio <- SE_Bio[!duplicated(rowData(SE_Bio)$GeneName), ]
rownames(SE_Bio) <- rowData(SE_Bio)$GeneName

SE_Bio
## class: SummarizedExperiment 
## dim: 19892 66 
## metadata(0):
## assays(1): counts
## rownames(19892): TSPAN6 TNMD ... AC114402.3 AC084756.2
## rowData names(9): Gene EnsGene ... Start End
## colnames(66): MTR_044_S1_CTL MTR_045_S2_CTL ... MTR_108_S63_DMSO
##   MTR_109_S64_DMSO
## colData names(20): InternalUniqueID HRID ... SeqPlatform lib.size

SE object containing information about 19892 genes in 66 samples.

SE_DEA <- SE_Bio
SE_DEA
## class: SummarizedExperiment 
## dim: 19892 66 
## metadata(0):
## assays(1): counts
## rownames(19892): TSPAN6 TNMD ... AC114402.3 AC084756.2
## rowData names(9): Gene EnsGene ... Start End
## colnames(66): MTR_044_S1_CTL MTR_045_S2_CTL ... MTR_108_S63_DMSO
##   MTR_109_S64_DMSO
## colData names(20): InternalUniqueID HRID ... SeqPlatform lib.size

Vst Transformation

assays(SE_DEA)$vst <- vst(as.matrix(assays(SE_DEA)$counts), blind=TRUE)
## converting counts to integer mode
SE_DEA
## class: SummarizedExperiment 
## dim: 19892 66 
## metadata(0):
## assays(2): counts vst
## rownames(19892): TSPAN6 TNMD ... AC114402.3 AC084756.2
## rowData names(9): Gene EnsGene ... Start End
## colnames(66): MTR_044_S1_CTL MTR_045_S2_CTL ... MTR_108_S63_DMSO
##   MTR_109_S64_DMSO
## colData names(20): InternalUniqueID HRID ... SeqPlatform lib.size

Setting Metadata

metadata(SE_DEA)$anno_colors <- list(
  Condition = c('DMSO' = 'grey30', 'CTL' = 'azure3', 

                 'AhHyd_Ag'='#F8766D', 'AhHyd_Inh'='#F8766D50',

                 'Andr_Ag'='#fccb17', 'Andr_Inh'='#C49A0050',  

                 "Estr_Ag"= '#53B400', "Estr_Inh"= '#53B40050', 

                 'GC_Ag' = '#00C094', 'GC_Inh' = '#00C09450',

                 'LivX_Ag' = '#00B6EB', 'LivX_Inh' = '#00B6EB50', 

                 'Ret_Ag' = '#A58AFF', 'Ret_Inh' = '#A58AFF50', 

                 'Thyr_Ag' = '#FB61D7', 'Thyr_Inh' = '#FB61D750'

                 ))

ScaledCols <- c('darkblue', "purple","white","lightgoldenrod1", 'goldenrod1')

3. Comparison across pathways: Agonist and Inhibitor

3.1 Heatmaps for Agonist

DEGs_Agonist <- list(
  
  Thyr_Ag_Up= row.names(DEA$Thyr$Agonist$DEGs[DEA$Thyr$Agonist$DEGs$log2FoldChange > 0, ]), 
  Thyr_Ag_Down= row.names(DEA$Thyr$Agonist$DEGs[DEA$Thyr$Agonist$DEGs$log2FoldChange < 0, ]),
  
  Ret_Ag_Up= row.names(DEA$Ret$Agonist$DEGs[DEA$Ret$Agonist$DEGs$log2FoldChange > 0, ]), 
  Ret_Ag_Down= row.names(DEA$Ret$Agonist$DEGs[DEA$Ret$Agonist$DEGs$log2FoldChange < 0, ]),
  
  Estr_Ag_Up= row.names(DEA$Estr$Agonist$DEGs[DEA$Estr$Agonist$DEGs$log2FoldChange > 0, ]),
  Estr_Ag_Down= row.names(DEA$Estr$Agonist$DEGs[DEA$Estr$Agonist$DEGs$log2FoldChange < 0, ]),
  
  Andr_Ag_Up= row.names(DEA$Andr$Agonist$DEGs[DEA$Andr$Agonist$DEGs$log2FoldChange > 0, ]), 
  Andr_Ag_Down= row.names(DEA$Andr$Agonist$DEGs[DEA$Andr$Agonist$DEGs$log2FoldChange < 0, ]), 
  
  GC_Ag_Up= row.names(DEA$GC$Agonist$DEGs[DEA$GC$Agonist$DEGs$log2FoldChange > 0, ]),
  GC_Ag_Down= row.names(DEA$GC$Agonist$DEGs[DEA$GC$Agonist$DEGs$log2FoldChange < 0, ]),
  
  LivX_Ag_Up= row.names(DEA$LivX$Agonist$DEGs[DEA$LivX$Agonist$DEGs$log2FoldChange > 0, ]), 
  LivX_Ag_Down= row.names(DEA$LivX$Agonist$DEGs[DEA$LivX$Agonist$DEGs$log2FoldChange < 0, ]), 
  
  AhHyd_Ag_Up= row.names(DEA$AhHyd$Agonist$DEGs[DEA$AhHyd$Agonist$DEGs$log2FoldChange > 0, ]), 
  AhHyd_Ag_Down= row.names(DEA$AhHyd$Agonist$DEGs[DEA$AhHyd$Agonist$DEGs$log2FoldChange < 0, ])
  
            )

3.1.1 Up-regulated genes

Heatmap Up-regulated DEGs in common between Retinoic Acid agonist and Thyroid agonist

S <- colData(SE_DEA)[, "Condition"] %in% c("DMSO", "Ret_Ag", "Thyr_Ag")

DEGs <- intersect(DEGs_Agonist$Ret_Ag_Up, DEGs_Agonist$Thyr_Ag_Up)

sechm(SE_DEA[,S], features=DEGs, assayName="vst",
      gaps_at="Condition",
      top_annotation=c('Condition'), hmcols=ScaledCols, anno_colors = metadata(SE_DEA)$anno_colors,
      do.scale=TRUE, breaks=0.8)

48 genes in common.


Heatmap Up-regulated DEGs in common between Retinoic Acid agonist and Androgen agonist

S <- colData(SE_DEA)[, "Condition"] %in% c("DMSO", "Ret_Ag", "Andr_Ag")

DEGs <- intersect(DEGs_Agonist$Ret_Ag_Up, DEGs_Agonist$Andr_Ag_Up)

sechm(SE_DEA[,S], features=DEGs, assayName="vst",
      gaps_at="Condition",
      top_annotation=c('Condition'), hmcols=ScaledCols, anno_colors = metadata(SE_DEA)$anno_colors,
      do.scale=TRUE, breaks=0.8)

58 genes in common.


Heatmap Up-regulated DEGs in common between GC agonist and LivX agonist

No overlap with these conditions

S <- colData(SE_DEA)[, "Condition"] %in% c("DMSO","LivX_Ag", "GC_Ag")

DEGs <- intersect(DEGs_Agonist$LivX_Ag_Up, DEGs_Agonist$GC_Ag_Up)

# sechm(SE_DEA[,S], features=DEGs, assayName="vst",
#       gaps_at="Condition",
#       top_annotation=c('Condition'), hmcols=ScaledCols, anno_colors = metadata(SE_DEA)$anno_colors,
#       do.scale=TRUE, breaks=0.8)

1 genes in common.


3.1.2 Down-regulated genes

Heatmap Down-regulated DEGs in common between Retinoic agonist and Thyroid agonist

S <- colData(SE_DEA)[, "Condition"] %in% c("DMSO", "Ret_Ag", "Thyr_Ag")

DEGs <- intersect(DEGs_Agonist$Ret_Ag_Down, DEGs_Agonist$Thyr_Ag_Down)

sechm(SE_DEA[,S], features=DEGs, assayName="vst",
      gaps_at="Condition",
      top_annotation=c('Condition'), hmcols=ScaledCols, anno_colors = metadata(SE_DEA)$anno_colors,
      do.scale=TRUE, breaks=0.8)

36 genes in common.


Heatmap Down-regulated DEGs in common between GC agonist and LivX agonist

S <- colData(SE_DEA)[, "Condition"] %in% c("DMSO","LivX_Ag", "GC_Ag")

DEGs <- intersect(DEGs_Agonist$LivX_Ag_Down, DEGs_Agonist$GC_Ag_Down)

sechm(SE_DEA[,S], features=DEGs, assayName="vst",
      gaps_at="Condition",
      top_annotation=c('Condition'), hmcols=ScaledCols, anno_colors = metadata(SE_DEA)$anno_colors,
      do.scale=TRUE, breaks=0.8)

3 genes in common.


3.2 Heatmaps for Inhibitor

DEGs_Inh <- list(
  
  Thyr_Inh_Up= row.names(DEA$Thyr$Inhibitor$DEGs[DEA$Thyr$Inhibitor$DEGs$log2FoldChange > 0, ]), 
  Thyr_Inh_Down= row.names(DEA$Thyr$Inhibitor$DEGs[DEA$Thyr$Inhibitor$DEGs$log2FoldChange < 0, ]),
  
  Ret_Inh_Up= row.names(DEA$Ret$Inhibitor$DEGs[DEA$Ret$Inhibitor$DEGs$log2FoldChange > 0, ]), 
  Ret_Inh_Down= row.names(DEA$Ret$Inhibitor$DEGs[DEA$Ret$Inhibitor$DEGs$log2FoldChange < 0, ]),
  
  Estr_Inh_Up= row.names(DEA$Estr$Inhibitor$DEGs[DEA$Estr$Inhibitor$DEGs$log2FoldChange > 0, ]), 
  Estr_Inh_Down= row.names(DEA$Estr$Inhibitor$DEGs[DEA$Estr$Inhibitor$DEGs$log2FoldChange < 0, ]),
  
  Andr_Inh_Up= row.names(DEA$Andr$Inhibitor$DEGs[DEA$Andr$Inhibitor$DEGs$log2FoldChange > 0, ]), 
  Andr_Inh_Down= row.names(DEA$Andr$Inhibitor$DEGs[DEA$Andr$Inhibitor$DEGs$log2FoldChange < 0, ]), 
  
  GC_Inh_Up= row.names(DEA$GC$Inhibitor$DEGs[DEA$GC$Inhibitor$DEGs$log2FoldChange > 0, ]),
  GC_Inh_Down= row.names(DEA$GC$Inhibitor$DEGs[DEA$GC$Inhibitor$DEGs$log2FoldChange < 0, ]),
  
  LivX_Inh_Up= row.names(DEA$LivX$Inhibitor$DEGs[DEA$LivX$Inhibitor$DEGs$log2FoldChange > 0, ]), 
  LivX_Inh_Down= row.names(DEA$LivX$Inhibitor$DEGs[DEA$LivX$Inhibitor$DEGs$log2FoldChange < 0, ]), 
  
  AhHyd_Inh_Up= row.names(DEA$AhHyd$Inhibitor$DEGs[DEA$AhHyd$Inhibitor$DEGs$log2FoldChange > 0, ]), 
  AhHyd_Inh_Down= row.names(DEA$AhHyd$Inhibitor$DEGs[DEA$AhHyd$Inhibitor$DEGs$log2FoldChange < 0, ])
  
            )

3.2.1 Up-regulated genes

Heatmap Up-regulated DEGs in common between LiverX inhibitor and GC inhibitor

S <- colData(SE_DEA)[, "Condition"] %in% c("DMSO","LivX_Inh", "GC_Inh", "Thyr_Inh")

DEGs <- intersect(DEGs_Inh$LivX_Inh_Up, DEGs_Inh$GC_Inh_Up)

sechm(SE_DEA[,S], features=DEGs, assayName="vst",
      gaps_at="Condition",
      top_annotation=c('Condition'), hmcols=ScaledCols, anno_colors = metadata(SE_DEA)$anno_colors,
      do.scale=TRUE, breaks=0.8)

93 genes in common.

Heatmap Up-regulated DEGs in common between Thyroid inhibitor and LiverX inhibitor

S <- colData(SE_DEA)[, "Condition"] %in% c("DMSO","LivX_Inh", "GC_Inh", "Thyr_Inh")

DEGs <- intersect(DEGs_Inh$Thyr_Inh_Up, DEGs_Inh$LivX_Inh_Up)

sechm(SE_DEA[,S], features=DEGs, assayName="vst",
      gaps_at="Condition",
      top_annotation=c('Condition'), hmcols=ScaledCols, anno_colors = metadata(SE_DEA)$anno_colors,
      do.scale=TRUE, breaks=0.8)

Heatmap Up-regulated DEGs in common between GC inhibitor and Thyroid inhibitor

S <- colData(SE_DEA)[, "Condition"] %in% c("DMSO","LivX_Inh", "GC_Inh", "Thyr_Inh")

DEGs <- intersect(DEGs_Inh$GC_Inh_Up, DEGs_Inh$Thyr_Inh_Up)

sechm(SE_DEA[,S], features=DEGs, assayName="vst",
      gaps_at="Condition",
      top_annotation=c('Condition'), hmcols=ScaledCols, anno_colors = metadata(SE_DEA)$anno_colors,
      do.scale=TRUE, breaks=0.8)

Heatmap Up-regulated DEGs in common between LiverX inhibitor, Thyroid inhibitor and GC inhibitor

S <- colData(SE_DEA)[, "Condition"] %in% c("DMSO","LivX_Inh", "GC_Inh", "Thyr_Inh")

DEGs <- Reduce(intersect, list(DEGs_Inh$GC_Inh_Up, DEGs_Inh$Thyr_Inh_Up, DEGs_Inh$LivX_Inh_Up))

sechm(SE_DEA[,S], features=DEGs, assayName="vst",
      gaps_at="Condition",
      top_annotation=c('Condition'), hmcols=ScaledCols, anno_colors = metadata(SE_DEA)$anno_colors,
      do.scale=TRUE, breaks=0.8)

3.2.2 Down-regulated genes

Heatmap Down-regulated DEGs in common between LiverX inhibitor and GC inhibitor

S <- colData(SE_DEA)[, "Condition"] %in% c("DMSO","LivX_Inh", "GC_Inh", "Thyr_Inh")

DEGs <- intersect(DEGs_Inh$LivX_Inh_Down, DEGs_Inh$GC_Inh_Down)

sechm(SE_DEA[,S], features=DEGs, assayName="vst",
      gaps_at="Condition",
      top_annotation=c('Condition'), hmcols=ScaledCols, anno_colors = metadata(SE_DEA)$anno_colors,
      do.scale=TRUE, breaks=0.8)

155 genes in common.

Heatmap Down-regulated DEGs in common between Thyroid inhibitor and LiverX inhibitor

S <- colData(SE_DEA)[, "Condition"] %in% c("DMSO","LivX_Inh", "GC_Inh", "Thyr_Inh")

DEGs <- intersect(DEGs_Inh$Thyr_Inh_Down, DEGs_Inh$LivX_Inh_Down)

sechm(SE_DEA[,S], features=DEGs, assayName="vst",
      gaps_at="Condition",
      top_annotation=c('Condition'), hmcols=ScaledCols, anno_colors = metadata(SE_DEA)$anno_colors,
      do.scale=TRUE, breaks=0.8)

Heatmap Down-regulated DEGs in common between GC inhibitor and Thyroid inhibitor

S <- colData(SE_DEA)[, "Condition"] %in% c("DMSO","LivX_Inh", "GC_Inh", "Thyr_Inh")

DEGs <- intersect(DEGs_Inh$GC_Inh_Down, DEGs_Inh$Thyr_Inh_Down)

sechm(SE_DEA[,S], features=DEGs, assayName="vst",
      gaps_at="Condition",
      top_annotation=c('Condition'), hmcols=ScaledCols, anno_colors = metadata(SE_DEA)$anno_colors,
      do.scale=TRUE, breaks=0.8)

Heatmap Down-regulated DEGs in common between LiverX inhibitor, Thyroid inhibitor and GC inhibitor

S <- colData(SE_DEA)[, "Condition"] %in% c("DMSO","LivX_Inh", "GC_Inh", "Thyr_Inh")

DEGs <- Reduce(intersect, list(DEGs_Inh$GC_Inh_Down, DEGs_Inh$Thyr_Inh_Down, DEGs_Inh$LivX_Inh_Down))

sechm(SE_DEA[,S], features=DEGs, assayName="vst",
      gaps_at="Condition",
      top_annotation=c('Condition'), hmcols=ScaledCols, anno_colors = metadata(SE_DEA)$anno_colors,
      do.scale=TRUE, breaks=0.8)

3.3 Heatmaps for AgvsInh

DEGs_AgvsInh <- list(
  
  Thyr_AgvsInh_Up= row.names(DEA$Thyr$AgvsInh$DEGs[DEA$Thyr$AgvsInh$DEGs$log2FoldChange > 0, ]), 
  Thyr_AgvsInh_Down= row.names(DEA$Thyr$AgvsInh$DEGs[DEA$Thyr$AgvsInh$DEGs$log2FoldChange < 0, ]),
  
  Ret_AgvsInh_Up= row.names(DEA$Ret$AgvsInh$DEGs[DEA$Ret$AgvsInh$DEGs$log2FoldChange > 0, ]), 
  Ret_AgvsInh_Down= row.names(DEA$Ret$AgvsInh$DEGs[DEA$Ret$AgvsInh$DEGs$log2FoldChange < 0, ]),
  
  Estr_AgvsInh_Up= row.names(DEA$Estr$AgvsInh$DEGs[DEA$Estr$AgvsInh$DEGs$log2FoldChange > 0, ]),
  Estr_AgvsInh_Down= row.names(DEA$Estr$AgvsInh$DEGs[DEA$Estr$AgvsInh$DEGs$log2FoldChange < 0, ]),
  
  Andr_AgvsInh_Up= row.names(DEA$Andr$AgvsInh$DEGs[DEA$Andr$AgvsInh$DEGs$log2FoldChange > 0, ]), 
  Andr_AgvsInh_Down= row.names(DEA$Andr$AgvsInh$DEGs[DEA$Andr$AgvsInh$DEGs$log2FoldChange < 0, ]), 
  
  GC_AgvsInh_Up= row.names(DEA$GC$AgvsInh$DEGs[DEA$GC$AgvsInh$DEGs$log2FoldChange > 0, ]),
  GC_AgvsInh_Down= row.names(DEA$GC$AgvsInh$DEGs[DEA$GC$AgvsInh$DEGs$log2FoldChange < 0, ]),
  
  LivX_AgvsInh_Up= row.names(DEA$LivX$AgvsInh$DEGs[DEA$LivX$AgvsInh$DEGs$log2FoldChange > 0, ]), 
  LivX_AgvsInh_Down= row.names(DEA$LivX$AgvsInh$DEGs[DEA$LivX$AgvsInh$DEGs$log2FoldChange < 0, ]), 
  
  AhHyd_AgvsInh_Up= row.names(DEA$AhHyd$AgvsInh$DEGs[DEA$AhHyd$AgvsInh$DEGs$log2FoldChange > 0, ]), 
  AhHyd_AgvsInh_Down= row.names(DEA$AhHyd$AgvsInh$DEGs[DEA$AhHyd$AgvsInh$DEGs$log2FoldChange < 0, ])
  
            )

3.3.1 Up-regulated genes

Heatmap Up-regulated DEGs in common between LiverX AgvsInh and GC AgvsInh

S <- colData(SE_DEA)[, "Condition"] %in% c("LivX_Inh", "GC_Inh", "LivX_Ag", "GC_Ag")

DEGs <- intersect(DEGs_AgvsInh$GC_AgvsInh_Up, DEGs_AgvsInh$LivX_AgvsInh_Up)

sechm(SE_DEA[,S], features=DEGs, assayName="vst",
      gaps_at="Condition",
      top_annotation=c('Condition'), hmcols=ScaledCols, anno_colors = metadata(SE_DEA)$anno_colors,
      do.scale=TRUE, breaks=0.8)

Heatmap Up-regulated DEGs in common between LiverX AgvsInh and Thyr AgvsInh

S <- colData(SE_DEA)[, "Condition"] %in% c("LivX_Inh", "Thyr_Inh", "LivX_Ag", "Thyr_Ag")

DEGs <- intersect(DEGs_AgvsInh$Thyr_AgvsInh_Up, DEGs_AgvsInh$LivX_AgvsInh_Up)

sechm(SE_DEA[,S], features=DEGs, assayName="vst",
      gaps_at="Condition",
      top_annotation=c('Condition'), hmcols=ScaledCols, anno_colors = metadata(SE_DEA)$anno_colors,
      do.scale=TRUE, breaks=0.8)

Heatmap Up-regulated DEGs in common between GC AgvsInh and Thyr AgvsInh

S <- colData(SE_DEA)[, "Condition"] %in% c("GC_Inh", "Thyr_Inh", "GC_Ag", "Thyr_Ag")

DEGs <- intersect(DEGs_AgvsInh$Thyr_AgvsInh_Up, DEGs_AgvsInh$GC_AgvsInh_Up)

sechm(SE_DEA[,S], features=DEGs, assayName="vst",
      gaps_at="Condition",
      top_annotation=c('Condition'), hmcols=ScaledCols, anno_colors = metadata(SE_DEA)$anno_colors,
      do.scale=TRUE, breaks=0.8)

Heatmap Up-regulated DEGs in common between GC AgvsInh, Thyr AgvsInh and LivX AgvsInh

S <- colData(SE_DEA)[, "Condition"] %in% c("Thyr_Inh", "LivX_Inh", "Thyr_Ag", "LivX_Ag", "GC_Ag", "GC_Inh")

DEGs <- Reduce(intersect, list(DEGs_AgvsInh$LivX_AgvsInh_Up, DEGs_AgvsInh$Thyr_AgvsInh_Up, DEGs_AgvsInh$GC_AgvsInh_Up))

sechm(SE_DEA[,S], features=DEGs, assayName="vst",
      gaps_at="Condition",
      top_annotation=c('Condition'), hmcols=ScaledCols, anno_colors = metadata(SE_DEA)$anno_colors, show_rownames = T,
      do.scale=TRUE, breaks=0.8)

***

3.3.2 Down-regulated genes

Heatmap Down-regulated DEGs in common between LiverX AgvsInh and GC AgvsInh

S <- colData(SE_DEA)[, "Condition"] %in% c("LivX_Inh", "GC_Inh", "LivX_Ag", "GC_Ag")

DEGs <- intersect(DEGs_AgvsInh$GC_AgvsInh_Down, DEGs_AgvsInh$LivX_AgvsInh_Down)

sechm(SE_DEA[,S], features=DEGs, assayName="vst",
      gaps_at="Condition",
      top_annotation=c('Condition'), hmcols=ScaledCols, anno_colors = metadata(SE_DEA)$anno_colors,
      do.scale=TRUE, breaks=0.8)

Heatmap Down-regulated DEGs in common between Thyr AgvsInh and GC AgvsInh

S <- colData(SE_DEA)[, "Condition"] %in% c("Thyr_Inh", "GC_Inh", "Thyr_Ag", "GC_Ag")

DEGs <- intersect(DEGs_AgvsInh$GC_AgvsInh_Down, DEGs_AgvsInh$Thyr_AgvsInh_Down)

sechm(SE_DEA[,S], features=DEGs, assayName="vst",
      gaps_at="Condition",
      top_annotation=c('Condition'), hmcols=ScaledCols, anno_colors = metadata(SE_DEA)$anno_colors,
      do.scale=TRUE, breaks=0.8)

Heatmap Down-regulated DEGs in common between Thyr AgvsInh and LivX AgvsInh

S <- colData(SE_DEA)[, "Condition"] %in% c("Thyr_Inh", "LivX_Inh", "Thyr_Ag", "LivX_Ag")

DEGs <- intersect(DEGs_AgvsInh$LivX_AgvsInh_Down, DEGs_AgvsInh$Thyr_AgvsInh_Down)

sechm(SE_DEA[,S], features=DEGs, assayName="vst",
      gaps_at="Condition",
      top_annotation=c('Condition'), hmcols=ScaledCols, anno_colors = metadata(SE_DEA)$anno_colors,
      do.scale=TRUE, breaks=0.8)

Heatmap Down-regulated DEGs in common between Thyr AgvsInh, LivX AgvsInh and GC AgvsInh

S <- colData(SE_DEA)[, "Condition"] %in% c("Thyr_Inh", "LivX_Inh", "Thyr_Ag", "LivX_Ag", "GC_Ag", "GC_Inh")

DEGs <- Reduce(intersect, list(DEGs_AgvsInh$LivX_AgvsInh_Down, DEGs_AgvsInh$Thyr_AgvsInh_Down, DEGs_AgvsInh$GC_AgvsInh_Down))

sechm(SE_DEA[,S], features=DEGs, assayName="vst",
      gaps_at="Condition",
      top_annotation=c('Condition'), hmcols=ScaledCols, anno_colors = metadata(SE_DEA)$anno_colors, show_rownames = T,
      do.scale=TRUE, breaks=0.8)

4. Session info

SessionInfo <- sessionInfo()
Date <- date()
Date
## [1] "Wed Aug 13 12:55:52 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               sva_3.46.0                 
##  [3] BiocParallel_1.32.5         genefilter_1.80.3          
##  [5] mgcv_1.8-41                 nlme_3.1-162               
##  [7] ashr_2.2-54                 sechm_1.6.0                
##  [9] SummarizedExperiment_1.28.0 Biobase_2.58.0             
## [11] GenomicRanges_1.50.2        GenomeInfoDb_1.34.9        
## [13] IRanges_2.32.0              S4Vectors_0.36.1           
## [15] BiocGenerics_0.44.0         MatrixGenerics_1.10.0      
## [17] matrixStats_0.63.0          ggplot2_3.4.1              
## [19] dplyr_1.1.0                 tidyr_1.3.0                
## 
## loaded via a namespace (and not attached):
##  [1] Rtsne_0.16             colorspace_2.1-0       rjson_0.2.21          
##  [4] circlize_0.4.15        XVector_0.38.0         GlobalOptions_0.1.2   
##  [7] clue_0.3-64            rstudioapi_0.14        bit64_4.0.5           
## [10] AnnotationDbi_1.60.0   fansi_1.0.4            codetools_0.2-19      
## [13] splines_4.2.1          doParallel_1.0.17      cachem_1.0.7          
## [16] geneplotter_1.76.0     knitr_1.42             jsonlite_1.8.4        
## [19] annotate_1.76.0        cluster_2.1.4          png_0.1-8             
## [22] compiler_4.2.1         httr_1.4.5             Matrix_1.5-3          
## [25] fastmap_1.1.1          limma_3.54.1           cli_3.6.1             
## [28] htmltools_0.5.4        tools_4.2.1            gtable_0.3.1          
## [31] glue_1.6.2             GenomeInfoDbData_1.2.9 V8_4.2.2              
## [34] Rcpp_1.0.10            jquerylib_0.1.4        vctrs_0.6.2           
## [37] Biostrings_2.66.0      iterators_1.0.14       xfun_0.37             
## [40] stringr_1.5.0          lifecycle_1.0.3        irlba_2.3.5.1         
## [43] XML_3.99-0.13          ca_0.71.1              edgeR_3.40.2          
## [46] zlibbioc_1.44.0        scales_1.2.1           TSP_1.2-2             
## [49] parallel_4.2.1         RColorBrewer_1.1-3     ComplexHeatmap_2.14.0 
## [52] yaml_2.3.7             curl_5.0.0             memoise_2.0.1         
## [55] sass_0.4.5             stringi_1.7.12         RSQLite_2.3.0         
## [58] SQUAREM_2021.1         highr_0.10             randomcoloR_1.1.0.1   
## [61] foreach_1.5.2          seriation_1.4.1        truncnorm_1.0-8       
## [64] shape_1.4.6            rlang_1.1.1            pkgconfig_2.0.3       
## [67] bitops_1.0-7           evaluate_0.20          lattice_0.20-45       
## [70] invgamma_1.1           purrr_1.0.1            bit_4.0.5             
## [73] tidyselect_1.2.0       magrittr_2.0.3         R6_2.5.1              
## [76] generics_0.1.3         DelayedArray_0.24.0    DBI_1.1.3             
## [79] pillar_1.8.1           withr_2.5.0            survival_3.5-3        
## [82] KEGGREST_1.38.0        RCurl_1.98-1.10        mixsqp_0.3-48         
## [85] tibble_3.2.1           crayon_1.5.2           utf8_1.2.3            
## [88] rmarkdown_2.20         GetoptLong_1.0.5       locfit_1.5-9.7        
## [91] grid_4.2.1             blob_1.2.3             digest_0.6.31         
## [94] xtable_1.8-4           munsell_0.5.0          registry_0.5-1        
## [97] bslib_0.4.2