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.hippocampus <- log.tdata.FPKM.sample.info %>% rownames_to_column() %>% filter(Tissue == "Hippocampus") %>% column_to_rownames()
log.tdata.FPKM.subset <- subset(log.tdata.FPKM.sample.info.subset.hippocampus, select = -c(Time,Treatment,Tissue))
WGCNA.pathway <-readRDS(here("Data","Hippocampus","Chang_B6_96hr_4wk_gprofiler_pathway_annotation_list_hippocampus_WGCNA.RData"))
Matched<-readRDS(here("Data","Hippocampus","Annotated_genes_in_hippocampus_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.hippocampus[,27238]))
Time <- unclass(as.factor(log.tdata.FPKM.sample.info.subset.hippocampus[,27237]))
Treat.Time <- paste0(Treatment, Time)
phenotype <- data.frame(cbind(Treatment, Time, Treat.Time))
nSamples <- nrow(log.tdata.FPKM.sample.info.subset.hippocampus)
MEs0 <- read.csv(here("Data","Hippocampus","log.tdata.FPKM.sample.info.subset.hippocampus.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)
#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"), display_numbers = textMatrix,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")
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$coral1,MEs$darkslateblue,MEs$green, MEs$darkolivegreen,MEs$blue1,MEs$khaki3))
colnames(Sigmodules) <- c("coral1","darkslateblue","green","darkolivegreen","blue1","khaki3")
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")
}
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| 0.5322 | 0.04112 | 2.267 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| 0.5605 | 0.02974 | 2.44 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| 0.4212 | 0.1179 | 1.675 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| -0.3706 | 0.1738 | -1.439 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| -0.3138 | 0.2547 | -1.192 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| -0.4212 | 0.1179 | -1.675 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| -0.3706 | 0.1738 | -1.439 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| 0.5605 | 0.02974 | 2.44 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| 0.4984 | 0.05866 | 2.073 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| 0.6254 | 0.01265 | 2.89 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| 0.6331 | 0.01129 | 2.949 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| 0.273 | 0.3249 | 1.023 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| -0.1993 | 0.4764 | -0.7334 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| -0.1555 | 0.5799 | -0.5677 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| -0.273 | 0.3249 | -1.023 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| -0.1993 | 0.4764 | -0.7334 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| 0.6331 | 0.01129 | 2.949 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| 0.6068 | 0.01645 | 2.753 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| -0.901 | 4.586e-06 | -7.487 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| -0.9253 | 7.799e-07 | -8.796 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| -0.6505 | 0.008646 | -3.088 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| 0.5249 | 0.04452 | 2.224 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| 0.2278 | 0.4143 | 0.8434 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| 0.6505 | 0.008646 | 3.088 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| 0.5249 | 0.04452 | 2.224 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| -0.9253 | 7.799e-07 | -8.796 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| -0.8738 | 2.068e-05 | -6.48 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| 0.517 | 0.04846 | 2.177 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| 0.5174 | 0.04822 | 2.18 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| 0.01044 | 0.9705 | 0.03766 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| 0.04991 | 0.8598 | 0.1802 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| 0.04272 | 0.8798 | 0.1542 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| -0.01044 | 0.9705 | -0.03766 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| 0.04991 | 0.8598 | 0.1802 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| 0.5174 | 0.04822 | 2.18 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| 0.5186 | 0.04761 | 2.187 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| 0.5835 | 0.02241 | 2.59 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| 0.5844 | 0.02214 | 2.597 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| 0.001643 | 0.9954 | 0.005924 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| 0.0702 | 0.8037 | 0.2537 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| 0.05701 | 0.8401 | 0.2059 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| -0.001643 | 0.9954 | -0.005924 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| 0.0702 | 0.8037 | 0.2537 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| 0.5844 | 0.02214 | 2.597 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| 0.5863 | 0.02162 | 2.609 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| -0.2452 | 0.3785 | -0.9118 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| -0.2819 | 0.3086 | -1.06 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| -0.5259 | 0.04407 | -2.229 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| 0.5094 | 0.05243 | 2.134 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| 0.4939 | 0.06134 | 2.048 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| 0.5259 | 0.04407 | 2.229 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| 0.5094 | 0.05243 | 2.134 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| -0.2819 | 0.3086 | -1.06 | 16 | 1 | pearson |
NULL
| estimate | p.value | statistic | n | gp | Method |
|---|---|---|---|---|---|
| -0.1948 | 0.4866 | -0.7161 | 16 | 1 | pearson |
NULL
time.contribution(phenotype, log.tdata.FPKM.subset, MEs)
treat.contribution(phenotype, log.tdata.FPKM.subset, MEs)
treat.time.contribution(phenotype, log.tdata.FPKM.subset, MEs)
Analysis performed by Ann Wells
The Carter Lab The Jackson Laboratory 2023
ann.wells@jax.org