Introduction and Data files

This dataset contains nine tissues (heart, hippocampus, hypothalamus, kidney, liver, prefrontal cortex, skeletal muscle, small intestine, and spleen) from C57BL/6J mice that were fed 2-deoxyglucose (6g/L) through their drinking water for 96hrs or 4wks. 96hr mice were given their 2DG treatment 2 weeks after the other cohort started the 4 week treatment. The organs from the mice were harvested and processed for metabolomics and transcriptomics. The data in this document pertains to the transcriptomics data only. The counts that were used were FPKM normalized before being log transformed. It was determined that sample A113 had low RNAseq quality and through further analyses with PCA, MA plots, and clustering was an outlier and will be removed for the rest of the analyses performed. This document will determine the contribution of each main effect or their combination to each module identified, as well as the relationship of each gene within the module and its significance.

needed.packages <- c("tidyverse", "here", "functional", "gplots", "dplyr", "GeneOverlap", "R.utils", "reshape2","magrittr","data.table", "RColorBrewer","preprocessCore", "ARTool","emmeans", "phia", "gProfileR", "WGCNA","plotly", "pheatmap","ppcor", "pander","downloadthis")
for(i in 1:length(needed.packages)){library(needed.packages[i], character.only = TRUE)}

source(here("source_files","WGCNA_source.R"))
source(here("source_files","WGCNA_contribution_source.R"))
tdata.FPKM.sample.info <- readRDS(here("Data","20190406_RNAseq_B6_4wk_2DG_counts_phenotypes.RData"))

tdata.FPKM <- readRDS(here("Data","20190406_RNAseq_B6_4wk_2DG_counts_numeric.RData"))

log.tdata.FPKM <- log(tdata.FPKM + 1)
log.tdata.FPKM <- as.data.frame(log.tdata.FPKM)

log.tdata.FPKM.sample.info <- cbind(log.tdata.FPKM, tdata.FPKM.sample.info[,27238:27240])

log.tdata.FPKM.sample.info <- log.tdata.FPKM.sample.info %>% rownames_to_column() %>% filter(rowname != "A113") %>% column_to_rownames()

log.tdata.FPKM.subset <- log.tdata.FPKM[,colMeans(log.tdata.FPKM != 0) > 0.5] 

log.tdata.FPKM.subset <- log.tdata.FPKM.subset %>% rownames_to_column() %>% filter(rowname != "A113") %>% column_to_rownames()

log.tdata.FPKM.sample.info.subset.prefrontal.cortex <- log.tdata.FPKM.sample.info %>% rownames_to_column() %>% filter(Tissue == "Pre-frontal Cortex") %>% column_to_rownames()

log.tdata.FPKM.subset <- subset(log.tdata.FPKM.sample.info.subset.prefrontal.cortex, select = -c(Time,Treatment,Tissue))
  
WGCNA.pathway <-readRDS(here("Data","Prefrontal Cortex","Chang_B6_96hr_4wk_gprofiler_pathway_annotation_list_prefrontal_cortex_WGCNA.RData"))

Matched<-readRDS(here("Data","Prefrontal Cortex","Annotated_genes_in_prefrontal_cortex_WGCNA_Chang_B6_96hr_4wk.RData"))


module.names <- Matched$X..Module.
name <- str_split(module.names,"_")
samples <-c()
for(i in 1:length(name)){
samples[[i]] <- name[[i]][2]
}  
name <- str_split(samples,"\"")
name <- unlist(name)

Treatment <- unclass(as.factor(log.tdata.FPKM.sample.info.subset.prefrontal.cortex[,27238]))
Time <- unclass(as.factor(log.tdata.FPKM.sample.info.subset.prefrontal.cortex[,27237]))
Treat.Time <- paste0(Treatment, Time)
phenotype <- data.frame(cbind(Treatment, Time, Treat.Time))

nSamples <- nrow(log.tdata.FPKM.sample.info.subset.prefrontal.cortex)

MEs0 <- read.csv(here("Data","Prefrontal Cortex","log.tdata.FPKM.sample.info.subset.prefrontal.cortex.WGCNA.module.eigens.csv"),header = T, row.names = 1)
name <- str_split(names(MEs0),"_")
samples <-c()
for(i in 1:length(name)){
samples[[i]] <- name[[i]][2]
}  
name <- str_split(samples,"\"")
name <- unlist(name)
colnames(MEs0) <-name
MEs <- orderMEs(MEs0)
moduleTraitCor <- cor(MEs, phenotype, use = "p");
moduleTraitPvalue <- corPvalueStudent(moduleTraitCor, nSamples)

Relationship between Modules and Traits

#sizeGrWindow(10,6)
# Will display correlations and their p-values
textMatrix = paste(signif(moduleTraitCor, 2), "\n(",
                        signif(moduleTraitPvalue, 1), ")", sep = "");
dim(textMatrix) = dim(moduleTraitCor)

# Display the correlation values within a heatmap plot
heat <- pheatmap(moduleTraitCor, main = paste("Module-trait relationships"), color=colorRampPalette(brewer.pal(n = 12, name = "Paired"))(10), cluster_rows = F, cluster_cols = F, fontsize_number = 4, angle_col = 45, number_color = "black", border_color = "white")
heat

DT::datatable(moduleTraitPvalue, extensions = 'Buttons',
                  rownames = TRUE, 
                  filter="top",
                  options = list(dom = 'Blfrtip',
                                 buttons = c('copy', 'csv', 'excel'),
                                 lengthMenu = list(c(10,25,50,-1),
                                                   c(10,25,50,"All")), 
                                 scrollX= TRUE), class = "display")

Partial Correlation

phenotype$Treatment <- as.numeric(phenotype$Treatment)
phenotype$Time <- as.numeric(phenotype$Time)
phenotype$Treat.Time <- as.numeric(phenotype$Treat.Time)

Sigmodules <- as.data.frame(cbind(MEs$limegreen,MEs$rosybrown2, MEs$lavenderblush2,MEs$antiquewhite,MEs$pink,MEs$lightpink1,MEs$goldenrod3,MEs$aquamarine,MEs$mistyrose))
colnames(Sigmodules) <- c("limegreen","rosybrown2","lavenderblush2","antiquewhite","pink","lightpink1","goldenrod3","aquamarine","mistyrose")

for(i in 1:length(Sigmodules)){
   cat("\n##",colnames(Sigmodules[i]),"{.tabset .tabset-fade .tabset-pills}","\n")
   for(j in 1:length(phenotype)){
      cat("\n###", colnames(phenotype[j]),"{.tabset .tabset-fade .tabset-pills}","\n")
      for(k in 1:length(phenotype)){
         cat("\n####", "Partial Correlation", colnames(phenotype[k]),"\n")
         partial <- pcor.test(Sigmodules[,i], phenotype[,j],phenotype[,k])
         panderOptions('knitr.auto.asis', FALSE)
         print(pander(partial))
         cat("\n \n")
      }
      cat("\n \n")
   }
   cat("\n \n")
}

limegreen

Treatment

Partial Correlation Treatment

estimate p.value statistic n gp Method
0.4881 0.06493 2.016 16 1 pearson

NULL

Partial Correlation Time

estimate p.value statistic n gp Method
0.505 0.05486 2.11 16 1 pearson

NULL

Partial Correlation Treat.Time

estimate p.value statistic n gp Method
0.3424 0.2115 1.314 16 1 pearson

NULL

Time

Partial Correlation Treatment

estimate p.value statistic n gp Method
-0.2942 0.2872 -1.11 16 1 pearson

NULL

Partial Correlation Time

estimate p.value statistic n gp Method
-0.2567 0.3556 -0.9578 16 1 pearson

NULL

Partial Correlation Treat.Time

estimate p.value statistic n gp Method
-0.3424 0.2115 -1.314 16 1 pearson

NULL

Treat.Time

Partial Correlation Treatment

estimate p.value statistic n gp Method
-0.2942 0.2872 -1.11 16 1 pearson

NULL

Partial Correlation Time

estimate p.value statistic n gp Method
0.505 0.05486 2.11 16 1 pearson

NULL

Partial Correlation Treat.Time

estimate p.value statistic n gp Method
0.4601 0.08441 1.868 16 1 pearson

NULL

rosybrown2

Treatment

Partial Correlation Treatment

estimate p.value statistic n gp Method
0.5122 0.05092 2.15 16 1 pearson

NULL

Partial Correlation Time

estimate p.value statistic n gp Method
0.5517 0.03298 2.385 16 1 pearson

NULL

Partial Correlation Treat.Time

estimate p.value statistic n gp Method
0.4775 0.07188 1.959 16 1 pearson

NULL

Time

Partial Correlation Treatment

estimate p.value statistic n gp Method
-0.4327 0.1072 -1.731 16 1 pearson

NULL

Partial Correlation Time

estimate p.value statistic n gp Method
-0.3716 0.1726 -1.443 16 1 pearson

NULL

Partial Correlation Treat.Time

estimate p.value statistic n gp Method
-0.4775 0.07188 -1.959 16 1 pearson

NULL

Treat.Time

Partial Correlation Treatment

estimate p.value statistic n gp Method
-0.4327 0.1072 -1.731 16 1 pearson

NULL

Partial Correlation Time

estimate p.value statistic n gp Method
0.5517 0.03298 2.385 16 1 pearson

NULL

Partial Correlation Treat.Time

estimate p.value statistic n gp Method
0.4727 0.07517 1.934 16 1 pearson

NULL

lavenderblush2

Treatment

Partial Correlation Treatment

estimate p.value statistic n gp Method
0.4508 0.09169 1.821 16 1 pearson

NULL

Partial Correlation Time

estimate p.value statistic n gp Method
0.4529 0.09004 1.831 16 1 pearson

NULL

Partial Correlation Treat.Time

estimate p.value statistic n gp Method
-0.05596 0.843 -0.2021 16 1 pearson

NULL

Time

Partial Correlation Treatment

estimate p.value statistic n gp Method
0.1065 0.7056 0.3862 16 1 pearson

NULL

Partial Correlation Time

estimate p.value statistic n gp Method
0.09507 0.7361 0.3443 16 1 pearson

NULL

Partial Correlation Treat.Time

estimate p.value statistic n gp Method
0.05596 0.843 0.2021 16 1 pearson

NULL

Treat.Time

Partial Correlation Treatment

estimate p.value statistic n gp Method
0.1065 0.7056 0.3862 16 1 pearson

NULL

Partial Correlation Time

estimate p.value statistic n gp Method
0.4529 0.09004 1.831 16 1 pearson

NULL

Partial Correlation Treat.Time

estimate p.value statistic n gp Method
0.458 0.08598 1.858 16 1 pearson

NULL

antiquewhite

Treatment

Partial Correlation Treatment

estimate p.value statistic n gp Method
-0.7385 0.001666 -3.949 16 1 pearson

NULL

Partial Correlation Time

estimate p.value statistic n gp Method
-0.7386 0.001662 -3.95 16 1 pearson

NULL

Partial Correlation Treat.Time

estimate p.value statistic n gp Method
-0.08269 0.7696 -0.2992 16 1 pearson

NULL

Time

Partial Correlation Treatment

estimate p.value statistic n gp Method
-0.02616 0.9263 -0.09435 16 1 pearson

NULL

Partial Correlation Time

estimate p.value statistic n gp Method
-0.01764 0.9502 -0.06361 16 1 pearson

NULL

Partial Correlation Treat.Time

estimate p.value statistic n gp Method
0.08269 0.7696 0.2992 16 1 pearson

NULL

Treat.Time

Partial Correlation Treatment

estimate p.value statistic n gp Method
-0.02616 0.9263 -0.09435 16 1 pearson

NULL

Partial Correlation Time

estimate p.value statistic n gp Method
-0.7386 0.001662 -3.95 16 1 pearson

NULL

Partial Correlation Treat.Time

estimate p.value statistic n gp Method
-0.7366 0.001738 -3.926 16 1 pearson

NULL

pink

Treatment

Partial Correlation Treatment

estimate p.value statistic n gp Method
-0.8591 4.087e-05 -6.052 16 1 pearson

NULL

Partial Correlation Time

estimate p.value statistic n gp Method
-0.9057 3.377e-06 -7.703 16 1 pearson

NULL

Partial Correlation Treat.Time

estimate p.value statistic n gp Method
-0.7057 0.003286 -3.591 16 1 pearson

NULL

Time

Partial Correlation Treatment

estimate p.value statistic n gp Method
0.6186 0.01395 2.839 16 1 pearson

NULL

Partial Correlation Time

estimate p.value statistic n gp Method
0.3166 0.2502 1.204 16 1 pearson

NULL

Partial Correlation Treat.Time

estimate p.value statistic n gp Method
0.7057 0.003286 3.591 16 1 pearson

NULL

Treat.Time

Partial Correlation Treatment

estimate p.value statistic n gp Method
0.6186 0.01395 2.839 16 1 pearson

NULL

Partial Correlation Time

estimate p.value statistic n gp Method
-0.9057 3.377e-06 -7.703 16 1 pearson

NULL

Partial Correlation Treat.Time

estimate p.value statistic n gp Method
-0.8233 0.0001624 -5.23 16 1 pearson

NULL

lightpink1

Treatment

Partial Correlation Treatment

estimate p.value statistic n gp Method
-0.3816 0.1605 -1.488 16 1 pearson

NULL

Partial Correlation Time

estimate p.value statistic n gp Method
-0.4564 0.08722 -1.85 16 1 pearson

NULL

Partial Correlation Treat.Time

estimate p.value statistic n gp Method
-0.6176 0.01416 -2.831 16 1 pearson

NULL

Time

Partial Correlation Treatment

estimate p.value statistic n gp Method
0.5937 0.01962 2.66 16 1 pearson

NULL

Partial Correlation Time

estimate p.value statistic n gp Method
0.5488 0.03412 2.367 16 1 pearson

NULL

Partial Correlation Treat.Time

estimate p.value statistic n gp Method
0.6176 0.01416 2.831 16 1 pearson

NULL

Treat.Time

Partial Correlation Treatment

estimate p.value statistic n gp Method
0.5937 0.01962 2.66 16 1 pearson

NULL

Partial Correlation Time

estimate p.value statistic n gp Method
-0.4564 0.08722 -1.85 16 1 pearson

NULL

Partial Correlation Treat.Time

estimate p.value statistic n gp Method
-0.3251 0.2371 -1.239 16 1 pearson

NULL

goldenrod3

Treatment

Partial Correlation Treatment

estimate p.value statistic n gp Method
0.08907 0.7523 0.3224 16 1 pearson

NULL

Partial Correlation Time

estimate p.value statistic n gp Method
0.1018 0.7181 0.369 16 1 pearson

NULL

Partial Correlation Treat.Time

estimate p.value statistic n gp Method
-0.4776 0.07181 -1.96 16 1 pearson

NULL

Time

Partial Correlation Treatment

estimate p.value statistic n gp Method
0.4863 0.06606 2.007 16 1 pearson

NULL

Partial Correlation Time

estimate p.value statistic n gp Method
0.4843 0.06731 1.996 16 1 pearson

NULL

Partial Correlation Treat.Time

estimate p.value statistic n gp Method
0.4776 0.07181 1.96 16 1 pearson

NULL

Treat.Time

Partial Correlation Treatment

estimate p.value statistic n gp Method
0.4863 0.06606 2.007 16 1 pearson

NULL

Partial Correlation Time

estimate p.value statistic n gp Method
0.1018 0.7181 0.369 16 1 pearson

NULL

Partial Correlation Treat.Time

estimate p.value statistic n gp Method
0.1368 0.6268 0.498 16 1 pearson

NULL

aquamarine

Treatment

Partial Correlation Treatment

estimate p.value statistic n gp Method
-0.443 0.09817 -1.782 16 1 pearson

NULL

Partial Correlation Time

estimate p.value statistic n gp Method
-0.4934 0.06162 -2.045 16 1 pearson

NULL

Partial Correlation Treat.Time

estimate p.value statistic n gp Method
-0.5254 0.0443 -2.226 16 1 pearson

NULL

Time

Partial Correlation Treatment

estimate p.value statistic n gp Method
0.4911 0.06301 2.033 16 1 pearson

NULL

Partial Correlation Time

estimate p.value statistic n gp Method
0.4403 0.1005 1.768 16 1 pearson

NULL

Partial Correlation Treat.Time

estimate p.value statistic n gp Method
0.5254 0.0443 2.226 16 1 pearson

NULL

Treat.Time

Partial Correlation Treatment

estimate p.value statistic n gp Method
0.4911 0.06301 2.033 16 1 pearson

NULL

Partial Correlation Time

estimate p.value statistic n gp Method
-0.4934 0.06162 -2.045 16 1 pearson

NULL

Partial Correlation Treat.Time

estimate p.value statistic n gp Method
-0.397 0.1429 -1.56 16 1 pearson

NULL

mistyrose

Treatment

Partial Correlation Treatment

estimate p.value statistic n gp Method
0.3937 0.1465 1.544 16 1 pearson

NULL

Partial Correlation Time

estimate p.value statistic n gp Method
0.4098 0.1293 1.62 16 1 pearson

NULL

Partial Correlation Treat.Time

estimate p.value statistic n gp Method
-0.2604 0.3486 -0.9725 16 1 pearson

NULL

Time

Partial Correlation Treatment

estimate p.value statistic n gp Method
0.3013 0.2751 1.139 16 1 pearson

NULL

Partial Correlation Time

estimate p.value statistic n gp Method
0.277 0.3176 1.039 16 1 pearson

NULL

Partial Correlation Treat.Time

estimate p.value statistic n gp Method
0.2604 0.3486 0.9725 16 1 pearson

NULL

Treat.Time

Partial Correlation Treatment

estimate p.value statistic n gp Method
0.3013 0.2751 1.139 16 1 pearson

NULL

Partial Correlation Time

estimate p.value statistic n gp Method
0.4098 0.1293 1.62 16 1 pearson

NULL

Partial Correlation Treat.Time

estimate p.value statistic n gp Method
0.4193 0.1197 1.665 16 1 pearson

NULL

Scatterplots Module membership vs. Gene significance

Time

time.contribution(phenotype, log.tdata.FPKM.subset, MEs)

grey

limegreen

black

darkturquoise

mistyrose

lightpink1

goldenrod3

lightblue

darkolivegreen2

dodgerblue4

chocolate4

rosybrown2

lightgoldenrod3

khaki3

salmon

lavenderblush2

burlywood

mediumorchid1

blueviolet

plum

lightskyblue2

antiquewhite

chocolate2

darkseagreen4

hotpink3

bisque2

cornsilk2

cornsilk

oldlace

lightskyblue

darkolivegreen4

blanchedalmond

aquamarine

pink

blue4

Treatment

treat.contribution(phenotype, log.tdata.FPKM.subset, MEs)

grey

limegreen

black

darkturquoise

mistyrose

lightpink1

goldenrod3

lightblue

darkolivegreen2

dodgerblue4

chocolate4

rosybrown2

lightgoldenrod3

khaki3

salmon

lavenderblush2

burlywood

mediumorchid1

blueviolet

plum

lightskyblue2

antiquewhite

chocolate2

darkseagreen4

hotpink3

bisque2

cornsilk2

cornsilk

oldlace

lightskyblue

darkolivegreen4

blanchedalmond

aquamarine

pink

blue4

Treatment by Time

treat.time.contribution(phenotype, log.tdata.FPKM.subset, MEs)

grey

limegreen

black

darkturquoise

mistyrose

lightpink1

goldenrod3

lightblue

darkolivegreen2

dodgerblue4

chocolate4

rosybrown2

lightgoldenrod3

khaki3

salmon

lavenderblush2

burlywood

mediumorchid1

blueviolet

plum

lightskyblue2

antiquewhite

chocolate2

darkseagreen4

hotpink3

bisque2

cornsilk2

cornsilk

oldlace

lightskyblue

darkolivegreen4

blanchedalmond

aquamarine

pink

blue4


Analysis performed by Ann Wells

The Carter Lab The Jackson Laboratory 2023

ann.wells@jax.org