WGCNA on CTL04.

1. Environment Set Up

1.1 Values of RMarkdown parameters

knitr::opts_chunk$set(echo = TRUE, warning=FALSE, collapse = TRUE)
for (i in 1:length(params))
  print(paste('Parameter:', names(params)[i], ' - Value:', params[[i]], '- Class:', class(params[[i]])))
## [1] "Parameter: Dataset  - Value: CTL04 - Class: character"
## [1] "Parameter: OutputFolder  - Value: ~/DataDir/bulkRNASeq/8.WGCNA/CTL04/2_ModuleCharacterization/ - Class: character"
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(DT)

library(viridis)
## Loading required package: viridisLite
library(sechm)
library(WGCNA)
## Loading required package: dynamicTreeCut
## Loading required package: fastcluster
## 
## Attaching package: 'fastcluster'
## The following object is masked from 'package:stats':
## 
##     hclust
## 
## 
## Attaching package: 'WGCNA'
## The following object is masked from 'package:stats':
## 
##     cor
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 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
Dataset <- params$Dataset
OutputFolder <- params$OutputFolder

if (dir.exists(OutputFolder) == FALSE) {
 dir.create(OutputFolder, recursive=TRUE)
}

1.2 Helper functions

source('WGCNAHelper.R')

2. Data Upload

2.1 Objects from first step

load('~/DataDir/bulkRNASeq/8.WGCNA/CTL04/1_NetworkGeneration/NetworkGeneration.RData')
DummyTotal <- DummyTraits

Objects generated from first step:

  • SE_Bio: starting SE
  • adjacency: adjacency matrix
  • dissTOM: TOM distance matrix
  • DummyTraits: phenotypic traits
  • ModuleAssignment: assignment for each gene to a module
  • FinalMEs: module eigengenes
  • VstSel: selected, transformed, transposed expression matrix

2.2 Settings

metadata(SE_WGCNA)$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')
CorrCols <- c('darkblue', "blue","white","forestgreen", 'green')

3. Module correlation with phenotypic traits

3.1 Correlation between module eigengenes and phenotypic traits

DummyTraits <- DummyTotal[,-c(1:4, 21)]

nGenes <- ncol(VstSel) 
nSamples <- nrow(VstSel)

# spearman correlation
SpearmanCor <- WGCNA::cor(FinalMEs, DummyTraits, use = 'p', method='spearman')
SpearmanPvalue <- WGCNA::corPvalueStudent(SpearmanCor, nSamples)

# pearson correlation
PearsonCor <- WGCNA::cor(FinalMEs, DummyTraits, use = 'p', method='pearson')
PearsonPvalue <- WGCNA::corPvalueStudent(PearsonCor, nSamples)

3.2 Visualize correlation matrix

Spearman

textMatrix <- paste(signif(SpearmanCor,2), '\n(', signif(SpearmanPvalue, 1), ')', sep = '')
dim(textMatrix) <- dim(SpearmanCor)
WGCNA::labeledHeatmap(Matrix = SpearmanCor, xLabels=names(DummyTraits), yLabels=names(FinalMEs), ySymbols=names(FinalMEs), 
                      colorLabels=FALSE, colors=viridis(50)[15:50], textMatrix = textMatrix, setStdMargins = FALSE, 
                      cex.text = 0.5, zlim = c(-1,1), main = paste('Module-trait relationships'))

Pearson

textMatrix <- paste(signif(PearsonCor,2), '\n(', signif(PearsonPvalue, 1), ')', sep = '')
dim(textMatrix) <- dim(PearsonCor)
WGCNA::labeledHeatmap(Matrix = PearsonCor, xLabels=names(DummyTraits), yLabels=names(FinalMEs), ySymbols=names(FinalMEs), 
                      colorLabels=FALSE, colors=viridis(50)[15:50], textMatrix = textMatrix, setStdMargins = FALSE, 
                      cex.text = 0.5, zlim = c(-1,1), main = paste('Module-trait relationships'))

5. Turquoise Module

5.1 Module definition

ModName <- 'turquoise'
TopGenes <- ifelse(dim(dplyr::filter(GeneMetrics, Module==ModName))[1] > 250, 250,
                   dim(dplyr::filter(GeneMetrics, Module==ModName))[1])

The module contains 2404 genes: 2087 protein-coding and 317 lncRNAs (15 %) .

The top-250 genes according to intramodular connectivity will be shown in interactive scatterplot and table.

5.2 Module eigengene boxplot

boxME(METraits=METraits, module=ModName, ascisse='Condition', title=NULL, 
      lines='Yes', reference='DMSO')

5.3 Module membership boxplot

boxMM(GeneMM=GeneMetrics, module=ModName, title=NULL)

5.4 Module heatmap

sechm(SE_WGCNA, features=GeneMetrics[GeneMetrics$Module==ModName, ]$Gene, assayName="vst", gaps_at="Condition",
      top_annotation='Condition', hmcols=ScaledCols,  do.scale=TRUE, breaks=0.8, 
      anno_colors = metadata(SE_WGCNA)$anno_colors)
## `use_raster` is automatically set to TRUE for a matrix with more than
## 2000 rows. You can control `use_raster` argument by explicitly setting
## TRUE/FALSE to it.
## 
## Set `ht_opt$message = FALSE` to turn off this message.
## 'magick' package is suggested to install to give better rasterization.
## 
## Set `ht_opt$message = FALSE` to turn off this message.

5.5 Interactive Scatterplot

plotGeneMetrics(GeneMetrics, module=ModName, title=NULL, top=TopGenes)

5.6 Interactive table

interactiveMetrics(GeneMetrics, Module=ModName)

6. Blue Module

6.1 Module definition

ModName <- 'blue'
TopGenes <- ifelse(dim(dplyr::filter(GeneMetrics, Module==ModName))[1] > 250, 250,
                   dim(dplyr::filter(GeneMetrics, Module==ModName))[1])

The module contains 1308 genes: 947 protein-coding and 361 lncRNAs (38 %).

The top-250 genes according to intramodular connectivity will be shown in interactive scatterplot and table.

6.2 Module eigengene boxplot

boxME(METraits=METraits, module=ModName, ascisse='Condition', title=NULL, 
      lines='Yes', reference='DMSO')

6.3 Module membership boxplot

boxMM(GeneMM=GeneMetrics, module=ModName, title=NULL)

6.4 Module heatmap

sechm(SE_WGCNA, features=GeneMetrics[GeneMetrics$Module==ModName, ]$Gene, assayName="vst", gaps_at="Condition",
      top_annotation='Condition', hmcols=ScaledCols,  do.scale=TRUE, breaks=0.8, 
      anno_colors = metadata(SE_WGCNA)$anno_colors)

6.5 Interactive Scatterplot

plotGeneMetrics(GeneMetrics, module=ModName, title=NULL, top=TopGenes)

6.6 Interactive table

interactiveMetrics(GeneMetrics, Module=ModName)

7. Green Module

7.1 Module definition

ModName <- 'green'
TopGenes <- ifelse(dim(dplyr::filter(GeneMetrics, Module==ModName))[1] > 250, 250,
                   dim(dplyr::filter(GeneMetrics, Module==ModName))[1])

The module contains 906 genes: 826 protein-coding and 80 lncRNAs (10 %).

The top-250 genes according to intramodular connectivity will be shown in interactive scatterplot and table.

7.2 Module eigengene boxplot

boxME(METraits=METraits, module=ModName, ascisse='Condition', title=NULL, 
      lines='Yes', reference='DMSO')

7.3 Module membership boxplot

boxMM(GeneMM=GeneMetrics, module=ModName, title=NULL)

7.4 Module heatmap

sechm(SE_WGCNA, features=GeneMetrics[GeneMetrics$Module==ModName, ]$Gene, assayName="vst", gaps_at="Condition",
      top_annotation='Condition', hmcols=ScaledCols,  do.scale=TRUE, breaks=0.8, 
      anno_colors = metadata(SE_WGCNA)$anno_colors)

7.5 Interactive Scatterplot

plotGeneMetrics(GeneMetrics, module=ModName, title=NULL, top=TopGenes)

7.6 Interactive table

interactiveMetrics(GeneMetrics, Module=ModName)

8. Brown Module

8.1 Module definition

ModName <- 'brown'
TopGenes <- ifelse(dim(dplyr::filter(GeneMetrics, Module==ModName))[1] > 250, 250,
                   dim(dplyr::filter(GeneMetrics, Module==ModName))[1])

The module contains 871 genes: 715 protein-coding and 156 lncRNAs (22 %).

The top-250 genes according to intramodular connectivity will be shown in interactive scatterplot and table.

8.2 Module eigengene boxplot

boxME(METraits=METraits, module=ModName, ascisse='Condition', title=NULL, 
      lines='Yes', reference='DMSO')

8.3 Module membership boxplot

boxMM(GeneMM=GeneMetrics, module=ModName, title=NULL)

8.4 Module heatmap

sechm(SE_WGCNA, features=GeneMetrics[GeneMetrics$Module==ModName, ]$Gene, assayName="vst", gaps_at="Condition",
      top_annotation='Condition', hmcols=ScaledCols,  do.scale=TRUE, breaks=0.8, 
      anno_colors = metadata(SE_WGCNA)$anno_colors)

8.5 Interactive Scatterplot

plotGeneMetrics(GeneMetrics, module=ModName, title=NULL, top=TopGenes)

8.6 Interactive table

interactiveMetrics(GeneMetrics, Module=ModName)

9. Red Module

9.1 Module definition

ModName <- 'red'
TopGenes <- ifelse(dim(dplyr::filter(GeneMetrics, Module==ModName))[1] > 250, 250,
                   dim(dplyr::filter(GeneMetrics, Module==ModName))[1])

The module contains 668 genes: 541 protein-coding and 127 lncRNAs (23 %).

The top-250 genes according to intramodular connectivity will be shown in interactive scatterplot and table.

9.2 Module eigengene boxplot

boxME(METraits=METraits, module=ModName, ascisse='Condition', title=NULL, 
      lines='Yes', reference='DMSO')

9.3 Module membership boxplot

boxMM(GeneMM=GeneMetrics, module=ModName, title=NULL)

9.4 Module heatmap

sechm(SE_WGCNA, features=GeneMetrics[GeneMetrics$Module==ModName, ]$Gene, assayName="vst", gaps_at="Condition",
      top_annotation='Condition', hmcols=ScaledCols,  do.scale=TRUE, breaks=0.8, 
      anno_colors = metadata(SE_WGCNA)$anno_colors)

9.5 Interactive Scatterplot

plotGeneMetrics(GeneMetrics, module=ModName, title=NULL, top=TopGenes)

9.6 Interactive table

interactiveMetrics(GeneMetrics, Module=ModName)

10. Midnightblue Module

10.1 Module definition

ModName <- 'midnightblue'
TopGenes <- ifelse(dim(dplyr::filter(GeneMetrics, Module==ModName))[1] > 250, 250,
                   dim(dplyr::filter(GeneMetrics, Module==ModName))[1])

The module contains 592 genes: 460 protein-coding and 132 lncRNAs (29 %).

The top-250 genes according to intramodular connectivity will be shown in interactive scatterplot and table.

10.2 Module eigengene boxplot

boxME(METraits=METraits, module=ModName, ascisse='Condition', title=NULL, 
      lines='Yes', reference='DMSO')

10.3 Module membership boxplot

boxMM(GeneMM=GeneMetrics, module=ModName, title=NULL)

10.4 Module heatmap

sechm(SE_WGCNA, features=GeneMetrics[GeneMetrics$Module==ModName, ]$Gene, assayName="vst", gaps_at="Condition",
      top_annotation='Condition', hmcols=ScaledCols,  do.scale=TRUE, breaks=0.8, 
      anno_colors = metadata(SE_WGCNA)$anno_colors)

10.5 Interactive Scatterplot

plotGeneMetrics(GeneMetrics, module=ModName, title=NULL, top=TopGenes)

10.6 Interactive table

interactiveMetrics(GeneMetrics, Module=ModName)

11. Black Module

11.1 Module definition

ModName <- 'black'
TopGenes <- ifelse(dim(dplyr::filter(GeneMetrics, Module==ModName))[1] > 250, 250,
                   dim(dplyr::filter(GeneMetrics, Module==ModName))[1])

The module contains 533 genes: 473 protein-coding and 60 lncRNAs (13 %).

The top-250 genes according to intramodular connectivity will be shown in interactive scatterplot and table.

11.2 Module eigengene boxplot

boxME(METraits=METraits, module=ModName, ascisse='Condition', title=NULL, 
      lines='Yes', reference='DMSO')

11.3 Module membership boxplot

boxMM(GeneMM=GeneMetrics, module=ModName, title=NULL)

11.4 Module heatmap

sechm(SE_WGCNA, features=GeneMetrics[GeneMetrics$Module==ModName, ]$Gene, assayName="vst", gaps_at="Condition",
      top_annotation='Condition', hmcols=ScaledCols,  do.scale=TRUE, breaks=0.8, 
      anno_colors = metadata(SE_WGCNA)$anno_colors)

11.5 Interactive Scatterplot

plotGeneMetrics(GeneMetrics, module=ModName, title=NULL, top=TopGenes)

11.6 Interactive table

interactiveMetrics(GeneMetrics, Module=ModName)

12. Pink Module

12.1 Module definition

ModName <- 'pink'
TopGenes <- ifelse(dim(dplyr::filter(GeneMetrics, Module==ModName))[1] > 250, 250,
                   dim(dplyr::filter(GeneMetrics, Module==ModName))[1])

The module contains 498 genes: 436 protein-coding and 62 lncRNAs (14 %).

The top-250 genes according to intramodular connectivity will be shown in interactive scatterplot and table.

12.2 Module eigengene boxplot

boxME(METraits=METraits, module=ModName, ascisse='Condition', title=NULL, 
      lines='Yes', reference='DMSO')

12.3 Module membership boxplot

boxMM(GeneMM=GeneMetrics, module=ModName, title=NULL)

12.4 Module heatmap

sechm(SE_WGCNA, features=GeneMetrics[GeneMetrics$Module==ModName, ]$Gene, assayName="vst", gaps_at="Condition",
      top_annotation='Condition', hmcols=ScaledCols,  do.scale=TRUE, breaks=0.8, 
      anno_colors = metadata(SE_WGCNA)$anno_colors)

12.5 Interactive Scatterplot

plotGeneMetrics(GeneMetrics, module=ModName, title=NULL, top=TopGenes)

12.6 Interactive table

interactiveMetrics(GeneMetrics, Module=ModName)

13. Magenta Module

13.1 Module definition

ModName <- 'magenta'
TopGenes <- ifelse(dim(dplyr::filter(GeneMetrics, Module==ModName))[1] > 250, 250,
                   dim(dplyr::filter(GeneMetrics, Module==ModName))[1])

The module contains 470 genes: 400 protein-coding and 70 lncRNAs (18 %).

The top-250 genes according to intramodular connectivity will be shown in interactive scatterplot and table.

13.2 Module eigengene boxplot

boxME(METraits=METraits, module=ModName, ascisse='Condition', title=NULL, 
      lines='Yes', reference='DMSO')

13.3 Module membership boxplot

boxMM(GeneMM=GeneMetrics, module=ModName, title=NULL)

13.4 Module heatmap

sechm(SE_WGCNA, features=GeneMetrics[GeneMetrics$Module==ModName, ]$Gene, assayName="vst", gaps_at="Condition",
      top_annotation='Condition', hmcols=ScaledCols,  do.scale=TRUE, breaks=0.8, 
      anno_colors = metadata(SE_WGCNA)$anno_colors)

13.5 Interactive Scatterplot

plotGeneMetrics(GeneMetrics, module=ModName, title=NULL, top=TopGenes)

13.6 Interactive table

interactiveMetrics(GeneMetrics, Module=ModName)

14. Purple Module

14.1 Module definition

ModName <- 'purple'
TopGenes <- ifelse(dim(dplyr::filter(GeneMetrics, Module==ModName))[1] > 250, 250,
                   dim(dplyr::filter(GeneMetrics, Module==ModName))[1])

The module contains 413 genes: 360 protein-coding and 53 lncRNAs (15 %).

The top-250 genes according to intramodular connectivity will be shown in interactive scatterplot and table.

14.2 Module eigengene boxplot

boxME(METraits=METraits, module=ModName, ascisse='Condition', title=NULL, 
      lines='Yes', reference='DMSO')

14.3 Module membership boxplot

boxMM(GeneMM=GeneMetrics, module=ModName, title=NULL)

14.4 Module heatmap

sechm(SE_WGCNA, features=GeneMetrics[GeneMetrics$Module==ModName, ]$Gene, assayName="vst", gaps_at="Condition",
      top_annotation='Condition', hmcols=ScaledCols,  do.scale=TRUE, breaks=0.8, 
      anno_colors = metadata(SE_WGCNA)$anno_colors)

14.5 Interactive Scatterplot

plotGeneMetrics(GeneMetrics, module=ModName, title=NULL, top=TopGenes)

14.6 Interactive table

interactiveMetrics(GeneMetrics, Module=ModName)

15. Greenyellow Module

15.1 Module definition

ModName <- 'greenyellow'
TopGenes <- ifelse(dim(dplyr::filter(GeneMetrics, Module==ModName))[1] > 250, 250,
                   dim(dplyr::filter(GeneMetrics, Module==ModName))[1])

The module contains 353 genes: 307 protein-coding and 46 lncRNAs (15 %).

The top-250 genes according to intramodular connectivity will be shown in interactive scatterplot and table.

15.2 Module eigengene boxplot

boxME(METraits=METraits, module=ModName, ascisse='Condition', title=NULL, 
      lines='Yes', reference='DMSO')

15.3 Module membership boxplot

boxMM(GeneMM=GeneMetrics, module=ModName, title=NULL)

15.4 Module heatmap

sechm(SE_WGCNA, features=GeneMetrics[GeneMetrics$Module==ModName, ]$Gene, assayName="vst", gaps_at="Condition",
      top_annotation='Condition', hmcols=ScaledCols,  do.scale=TRUE, breaks=0.8, 
      anno_colors = metadata(SE_WGCNA)$anno_colors)

15.5 Interactive Scatterplot

plotGeneMetrics(GeneMetrics, module=ModName, title=NULL, top=TopGenes)

15.6 Interactive table

interactiveMetrics(GeneMetrics, Module=ModName)

16. Tan Module

16.1 Module definition

ModName <- 'tan'
TopGenes <- ifelse(dim(dplyr::filter(GeneMetrics, Module==ModName))[1] > 250, 250,
                   dim(dplyr::filter(GeneMetrics, Module==ModName))[1])

The module contains 348 genes: 297 protein-coding and 51 lncRNAs (17 %).

The top-250 genes according to intramodular connectivity will be shown in interactive scatterplot and table.

16.2 Module eigengene boxplot

boxME(METraits=METraits, module=ModName, ascisse='Condition', title=NULL, 
      lines='Yes', reference='DMSO')

16.3 Module membership boxplot

boxMM(GeneMM=GeneMetrics, module=ModName, title=NULL)

16.4 Module heatmap

sechm(SE_WGCNA, features=GeneMetrics[GeneMetrics$Module==ModName, ]$Gene, assayName="vst", gaps_at="Condition",
      top_annotation='Condition', hmcols=ScaledCols,  do.scale=TRUE, breaks=0.8, 
      anno_colors = metadata(SE_WGCNA)$anno_colors)

16.5 Interactive Scatterplot

plotGeneMetrics(GeneMetrics, module=ModName, title=NULL, top=TopGenes)

16.6 Interactive table

interactiveMetrics(GeneMetrics, Module=ModName)

17. Cyan Module

17.1 Module definition

ModName <- 'cyan'
TopGenes <- ifelse(dim(dplyr::filter(GeneMetrics, Module==ModName))[1] > 250, 250,
                   dim(dplyr::filter(GeneMetrics, Module==ModName))[1])

The module contains 312 genes: 263 protein-coding and 49 lncRNAs (19 %).

The top-250 genes according to intramodular connectivity will be shown in interactive scatterplot and table.

17.2 Module eigengene boxplot

boxME(METraits=METraits, module=ModName, ascisse='Condition', title=NULL, 
      lines='Yes', reference='DMSO')

17.3 Module membership boxplot

boxMM(GeneMM=GeneMetrics, module=ModName, title=NULL)

17.4 Module heatmap

sechm(SE_WGCNA, features=GeneMetrics[GeneMetrics$Module==ModName, ]$Gene, assayName="vst", gaps_at="Condition",
      top_annotation='Condition', hmcols=ScaledCols,  do.scale=TRUE, breaks=0.8, 
      anno_colors = metadata(SE_WGCNA)$anno_colors)

17.5 Interactive Scatterplot

plotGeneMetrics(GeneMetrics, module=ModName, title=NULL, top=TopGenes)

17.6 Interactive table

interactiveMetrics(GeneMetrics, Module=ModName)

18. Grey60 Module

18.1 Module definition

ModName <- 'grey60'
TopGenes <- ifelse(dim(dplyr::filter(GeneMetrics, Module==ModName))[1] > 250, 250,
                   dim(dplyr::filter(GeneMetrics, Module==ModName))[1])

The module contains 166 genes: 144 protein-coding and 22 lncRNAs (15 %).

The top-166 genes according to intramodular connectivity will be shown in interactive scatterplot and table.

18.2 Module eigengene boxplot

boxME(METraits=METraits, module=ModName, ascisse='Condition', title=NULL, 
      lines='Yes', reference='DMSO')

18.3 Module membership boxplot

boxMM(GeneMM=GeneMetrics, module=ModName, title=NULL)

18.4 Module heatmap

sechm(SE_WGCNA, features=GeneMetrics[GeneMetrics$Module==ModName, ]$Gene, assayName="vst", gaps_at="Condition",
      top_annotation='Condition', hmcols=ScaledCols,  do.scale=TRUE, breaks=0.8, 
      anno_colors = metadata(SE_WGCNA)$anno_colors)

18.5 Interactive Scatterplot

plotGeneMetrics(GeneMetrics, module=ModName, title=NULL, top=TopGenes)

18.6 Interactive table

interactiveMetrics(GeneMetrics, Module=ModName)

19. Lightgreen Module

19.1 Module definition

ModName <- 'lightgreen'
TopGenes <- ifelse(dim(dplyr::filter(GeneMetrics, Module==ModName))[1] > 250, 250,
                   dim(dplyr::filter(GeneMetrics, Module==ModName))[1])

The module contains 160 genes: 126 protein-coding and 34 lncRNAs (27 %).

The top-160 genes according to intramodular connectivity will be shown in interactive scatterplot and table.

19.2 Module eigengene boxplot

boxME(METraits=METraits, module=ModName, ascisse='Condition', title=NULL, 
      lines='Yes', reference='DMSO')

19.3 Module membership boxplot

boxMM(GeneMM=GeneMetrics, module=ModName, title=NULL)

19.4 Module heatmap

sechm(SE_WGCNA, features=GeneMetrics[GeneMetrics$Module==ModName, ]$Gene, assayName="vst", gaps_at="Condition",
      top_annotation='Condition', hmcols=ScaledCols,  do.scale=TRUE, breaks=0.8, 
      anno_colors = metadata(SE_WGCNA)$anno_colors)

19.5 Interactive Scatterplot

plotGeneMetrics(GeneMetrics, module=ModName, title=NULL, top=TopGenes)

19.6 Interactive table

interactiveMetrics(GeneMetrics, Module=ModName)

20. Lightyellow Module

20.1 Module definition

ModName <- 'lightyellow'
TopGenes <- ifelse(dim(dplyr::filter(GeneMetrics, Module==ModName))[1] > 250, 250,
                   dim(dplyr::filter(GeneMetrics, Module==ModName))[1])

The module contains 117 genes: 103 protein-coding and 14 lncRNAs (14 %).

The top-117 genes according to intramodular connectivity will be shown in interactive scatterplot and table.

20.2 Module eigengene boxplot

boxME(METraits=METraits, module=ModName, ascisse='Condition', title=NULL, 
      lines='Yes', reference='DMSO')

20.3 Module membership boxplot

boxMM(GeneMM=GeneMetrics, module=ModName, title=NULL)

20.4 Module heatmap

sechm(SE_WGCNA, features=GeneMetrics[GeneMetrics$Module==ModName, ]$Gene, assayName="vst", gaps_at="Condition",
      top_annotation='Condition', hmcols=ScaledCols,  do.scale=TRUE, breaks=0.8, 
      anno_colors = metadata(SE_WGCNA)$anno_colors)

20.5 Interactive Scatterplot

plotGeneMetrics(GeneMetrics, module=ModName, title=NULL, top=TopGenes)

20.6 Interactive table

interactiveMetrics(GeneMetrics, Module=ModName)

21. Royalblue Module

21.1 Module definition

ModName <- 'royalblue'
TopGenes <- ifelse(dim(dplyr::filter(GeneMetrics, Module==ModName))[1] > 250, 250,
                   dim(dplyr::filter(GeneMetrics, Module==ModName))[1])

The module contains 109 genes: 86 protein-coding and 23 lncRNAs (27 %).

The top-109 genes according to intramodular connectivity will be shown in interactive scatterplot and table.

21.2 Module eigengene boxplot

boxME(METraits=METraits, module=ModName, ascisse='Condition', title=NULL, 
      lines='Yes', reference='DMSO')

21.3 Module membership boxplot

boxMM(GeneMM=GeneMetrics, module=ModName, title=NULL)

21.4 Module heatmap

sechm(SE_WGCNA, features=GeneMetrics[GeneMetrics$Module==ModName, ]$Gene, assayName="vst", gaps_at="Condition",
      top_annotation='Condition', hmcols=ScaledCols,  do.scale=TRUE, breaks=0.8, 
      anno_colors = metadata(SE_WGCNA)$anno_colors)

21.5 Interactive Scatterplot

plotGeneMetrics(GeneMetrics, module=ModName, title=NULL, top=TopGenes)

21.6 Interactive table

interactiveMetrics(GeneMetrics, Module=ModName)

22. Darkred Module

22.1 Module definition

ModName <- 'darkred'
TopGenes <- ifelse(dim(dplyr::filter(GeneMetrics, Module==ModName))[1] > 250, 250,
                   dim(dplyr::filter(GeneMetrics, Module==ModName))[1])

The module contains 94 genes: 74 protein-coding and 20 lncRNAs (27 %).

The top-94 genes according to intramodular connectivity will be shown in interactive scatterplot and table.

22.2 Module eigengene boxplot

boxME(METraits=METraits, module=ModName, ascisse='Condition', title=NULL, 
      lines='Yes', reference='DMSO')

22.3 Module membership boxplot

boxMM(GeneMM=GeneMetrics, module=ModName, title=NULL)

22.4 Module heatmap

sechm(SE_WGCNA, features=GeneMetrics[GeneMetrics$Module==ModName, ]$Gene, assayName="vst", gaps_at="Condition",
      top_annotation='Condition', hmcols=ScaledCols,  do.scale=TRUE, breaks=0.8, 
      anno_colors = metadata(SE_WGCNA)$anno_colors)

22.5 Interactive Scatterplot

plotGeneMetrics(GeneMetrics, module=ModName, title=NULL, top=TopGenes)

22.6 Interactive table

interactiveMetrics(GeneMetrics, Module=ModName)

23. Savings

save(GeneMetrics, file=paste0(OutputFolder, 'GeneMetrics.RData'))
write.table(GeneMetrics, file=paste0(OutputFolder, 'GeneMetrics.txt'), sep='\t')
SessionInfo <- sessionInfo()
Date <- date()
save.image(paste0(OutputFolder, 'ModuleCharacterization.RData'))
Date
## [1] "Mon Jul 21 19:40:03 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] SummarizedExperiment_1.28.0 Biobase_2.58.0             
##  [3] GenomicRanges_1.50.2        GenomeInfoDb_1.34.9        
##  [5] IRanges_2.32.0              S4Vectors_0.36.1           
##  [7] BiocGenerics_0.44.0         MatrixGenerics_1.10.0      
##  [9] matrixStats_0.63.0          WGCNA_1.72-1               
## [11] fastcluster_1.2.3           dynamicTreeCut_1.63-1      
## [13] sechm_1.6.0                 viridis_0.6.2              
## [15] viridisLite_0.4.1           DT_0.27                    
## [17] ggplot2_3.4.1               dplyr_1.1.0                
## 
## loaded via a namespace (and not attached):
##   [1] Rtsne_0.16             colorspace_2.1-0       rjson_0.2.21          
##   [4] deldir_1.0-6           ellipsis_0.3.2         circlize_0.4.15       
##   [7] htmlTable_2.4.1        XVector_0.38.0         GlobalOptions_0.1.2   
##  [10] base64enc_0.1-3        clue_0.3-64            rstudioapi_0.14       
##  [13] farver_2.1.1           bit64_4.0.5            AnnotationDbi_1.60.0  
##  [16] fansi_1.0.4            codetools_0.2-19       splines_4.2.1         
##  [19] doParallel_1.0.17      impute_1.72.3          cachem_1.0.7          
##  [22] knitr_1.42             Formula_1.2-5          jsonlite_1.8.4        
##  [25] cluster_2.1.4          GO.db_3.16.0           png_0.1-8             
##  [28] compiler_4.2.1         httr_1.4.5             backports_1.4.1       
##  [31] lazyeval_0.2.2         Matrix_1.5-3           fastmap_1.1.1         
##  [34] cli_3.6.1              htmltools_0.5.4        tools_4.2.1           
##  [37] gtable_0.3.1           glue_1.6.2             GenomeInfoDbData_1.2.9
##  [40] V8_4.2.2               Rcpp_1.0.10            jquerylib_0.1.4       
##  [43] vctrs_0.6.2            Biostrings_2.66.0      preprocessCore_1.60.2 
##  [46] crosstalk_1.2.0        iterators_1.0.14       xfun_0.37             
##  [49] stringr_1.5.0          lifecycle_1.0.3        ca_0.71.1             
##  [52] zlibbioc_1.44.0        scales_1.2.1           TSP_1.2-2             
##  [55] parallel_4.2.1         RColorBrewer_1.1-3     ComplexHeatmap_2.14.0 
##  [58] yaml_2.3.7             curl_5.0.0             memoise_2.0.1         
##  [61] gridExtra_2.3          sass_0.4.5             rpart_4.1.19          
##  [64] latticeExtra_0.6-30    stringi_1.7.12         RSQLite_2.3.0         
##  [67] highr_0.10             randomcoloR_1.1.0.1    foreach_1.5.2         
##  [70] checkmate_2.1.0        seriation_1.4.1        shape_1.4.6           
##  [73] rlang_1.1.1            pkgconfig_2.0.3        bitops_1.0-7          
##  [76] evaluate_0.20          lattice_0.20-45        purrr_1.0.1           
##  [79] labeling_0.4.2         htmlwidgets_1.6.1      bit_4.0.5             
##  [82] tidyselect_1.2.0       magrittr_2.0.3         R6_2.5.1              
##  [85] generics_0.1.3         Hmisc_4.8-0            DelayedArray_0.24.0   
##  [88] DBI_1.1.3              pillar_1.8.1           foreign_0.8-84        
##  [91] withr_2.5.0            survival_3.5-3         KEGGREST_1.38.0       
##  [94] RCurl_1.98-1.10        nnet_7.3-18            tibble_3.2.1          
##  [97] crayon_1.5.2           interp_1.1-3           utf8_1.2.3            
## [100] plotly_4.10.1          rmarkdown_2.20         jpeg_0.1-10           
## [103] GetoptLong_1.0.5       grid_4.2.1             data.table_1.14.8     
## [106] blob_1.2.3             digest_0.6.31          tidyr_1.3.0           
## [109] munsell_0.5.0          registry_0.5-1         bslib_0.4.2