OSCR

Transcriptional Response to Chronic Long-Access Fentanyl Self-Administration in Rat Habenula and Amygdala.

Code ↔ Paper

12 matches between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

The 12 matches
  1. [1] § Materials and Methods Summary › Experiment Summary and RNA‐Seq Data Generation ↔ code/09_SRA/03_metadata.R, lines 1–55 · score 0.98 · inside sound attenuating, operant chambers housed, bilateral tissue punches, Ribosomal RNA depletion, Cayman Chemical, coronal slabs
  2. [2] § Results › Shared and Unique Gene Expression Changes in Hb and Amyg Following Chronic Fentanyl Intake ↔ code/06_GO_KEGG/01_GO_KEGG_Analyses.R, lines 548–592 · score 0.97 · gastric acid secretion, ECM receptor interaction, Parkinson disease, actin cytoskeleton, oxidative phosphorylation, glutamatergic synapse
  3. [3] § Results › Shared and Unique Gene Expression Changes in Hb and Amyg Following Chronic Fentanyl Intake ↔ code/05_DEA/01_Modeling.R, lines 477–532 · score 0.96 · Atp5mc2, Atp6v0e2, Atp6v1e1, Slc39a10, Col4a3, KEGG term
  4. [4] § Results › Shared and Unique Gene Expression Changes in Hb and Amyg Following Chronic Fentanyl Intake ↔ code/05_DEA/01_Modeling.R, lines 477–532 · score 0.91 · Cox6b1, Scn1a, Col9a3, Gria4, Grik1, Kcnj10
  5. [5] § Results › Shared and Unique Gene Expression Changes in Hb and Amyg Following Chronic Fentanyl Intake ↔ code/06_GO_KEGG/01_GO_KEGG_Analyses.R, lines 548–592 · score 0.87 · postsynaptic membrane potential, Col9a3, voltage gated, cation channels, Epha4, Gsn
  6. [6] § Materials and Methods Summary › Experiment Summary and RNA‐Seq Data Generation ↔ code/09_SRA/03_metadata.R, lines 1–55 · score 0.76 · bulk RNA sequencing, jugular catheters, house light, illumination, Drug, daily
  7. [7] § Materials and Methods Summary › Differential Gene Expression (DGE) ↔ code/06_GO_KEGG/01_GO_KEGG_Analyses.R, lines 73–188 · score 0.75 · enriched GO term, cellular components, Biological processes, molecular functions, enrichment, Amyg
  8. [8] § Results › Enrichment of Genes Associated With Fentanyl Intake in Human and Rodent Hb and Amyg Cell Types ↔ code/08_GSEA/01_enrich_DEGs_vs_cell_type_markers.R, lines 896–934 · score 0.65 · fine cell, DRD1, LAMP5, SATB2, nostrin, S14
  9. [9] § Results › Enrichment of Genes Associated With Fentanyl Intake in Human and Rodent Hb and Amyg Cell Types ↔ code/08_GSEA/01_enrich_DEGs_vs_cell_type_markers.R, lines 1295–1361 · score 0.63 · LHb.2, LHb.6, LHb.7, astrocytes, enriched, orthologous
  10. [10] § Materials and Methods Summary › Experiment Summary and RNA‐Seq Data Generation ↔ code/03_Data_preparation/01_build_objects.R, lines 47–85 · score 0.62 · tissue punches, library preparation, sequenced, RNA, brains, Amyg
  11. [11] § Materials and Methods Summary › RNA‐Seq Data Processing and Quality Control ↔ code/04_EDA/01_QCA.R, lines 2–87 · score 0.59 · quality control, expressed genes, QC metrics, RNA extraction, brain regions, filtered
  12. [12] § Materials and Methods Summary › Experiment Summary and RNA‐Seq Data Generation ↔ code/04_EDA/03_Explore_gene_level_effects.R, lines 2–55 · score 0.54 · linear regression, infusion slopes, mg, hour, RNA, intake

Paper

Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

R · 1,005 lines · 57 KB · MIT · 3 matches

  1. library(dplyr)
  2. library(tidyr)
  3. library(tibble)
  4. library(purrr)
  5. library(here)
  6. library(SummarizedExperiment)
  7. library(clusterProfiler)
  8. library(org.Rn.eg.db)
  9. library(cowplot)
  10. library(ggplot2)
  11. library(biomaRt)
  12. library(sessioninfo)
  13. ####################### Functional Enrichment Analysis #######################
  14. load(here('processed-data/05_DEA/de_genes_Substance_habenula.Rdata'), verbose = TRUE)
  15. load(here('processed-data/05_DEA/de_genes_Substance_amygdala.Rdata'), verbose = TRUE)
  16. load(here('processed-data/05_DEA/results_Substance_uncorr_vars_habenula.Rdata'), verbose = TRUE)
  17. load(here('processed-data/05_DEA/results_Substance_uncorr_vars_amygdala.Rdata'), verbose = TRUE)
  18. ## Groups of DEGs
  19. ########################
  20. ## Habenula DEGs
  21. ########################
  22. ## Up and down habenula DEGs from model with uncorrelated sample variables
  23. up_hab <- de_genes_habenula[which(de_genes_habenula$logFC>0),]
  24. down_hab <- de_genes_habenula[which(de_genes_habenula$logFC<0),]
  25. ########################
  26. ## Amygdala DEGs
  27. ########################
  28. ## Up and down amygdala DEGs from model with uncorrelated sample variables
  29. up_amy <- de_genes_amygdala[which(de_genes_amygdala$logFC>0),]
  30. down_amy <- de_genes_amygdala[which(de_genes_amygdala$logFC<0),]
  31. #########################################
  32. ## Up/Down unique/shared in Hb/Amyg
  33. #########################################
  34. only_up_hab <- de_genes_habenula[which(!de_genes_habenula$ensemblID %in% de_genes_amygdala$ensemblID & de_genes_habenula$logFC>0),]
  35. only_down_hab <- de_genes_habenula[which(!de_genes_habenula$ensemblID %in% de_genes_amygdala$ensemblID & de_genes_habenula$logFC<0),]
  36. only_up_amy <- de_genes_amygdala[which(!de_genes_amygdala$ensemblID %in% de_genes_habenula$ensemblID & de_genes_amygdala$logFC>0),]
  37. only_down_amy <- de_genes_amygdala[which(!de_genes_amygdala$ensemblID %in% de_genes_habenula$ensemblID & de_genes_amygdala$logFC<0),]
  38. shared_hab_amy <- inner_join(de_genes_habenula, de_genes_amygdala, by = colnames(de_genes_amygdala)[1:9], suffix = c(".hb", ".amyg"))
  39. shared_up_hab_up_amy <- shared_hab_amy[shared_hab_amy$logFC.hb>0 & shared_hab_amy$logFC.amyg>0, ]
  40. shared_up_hab_down_amy <- shared_hab_amy[shared_hab_amy$logFC.hb>0 & shared_hab_amy$logFC.amyg<0, ]
  41. shared_down_hab_up_amy <- shared_hab_amy[shared_hab_amy$logFC.hb<0 & shared_hab_amy$logFC.amyg>0, ]
  42. shared_down_hab_down_amy <- shared_hab_amy[shared_hab_amy$logFC.hb<0 & shared_hab_amy$logFC.amyg<0, ]
  43. ## Retrieve valid Entrez IDs
  44. only_up_hab_genes <- only_up_hab %>% dplyr::filter(!is.na(EntrezID) & !is.null(EntrezID) & EntrezID != "NULL" & EntrezID != "") %>% pull(EntrezID) %>% unique()
  45. only_down_hab_genes <- only_down_hab %>% dplyr::filter(!is.na(EntrezID) & !is.null(EntrezID) & EntrezID != "NULL" & EntrezID != "") %>% pull(EntrezID) %>% unique()
  46. only_up_amy_genes <- only_up_amy %>% dplyr::filter(!is.na(EntrezID) & !is.null(EntrezID) & EntrezID != "NULL" & EntrezID != "") %>% pull(EntrezID) %>% unique()
  47. only_down_amy_genes <- only_down_amy %>% dplyr::filter(!is.na(EntrezID) & !is.null(EntrezID) & EntrezID != "NULL" & EntrezID != "") %>% pull(EntrezID) %>% unique()
  48. shared_up_hab_up_amy_genes <- shared_up_hab_up_amy %>% dplyr::filter(!is.na(EntrezID) & !is.null(EntrezID) & EntrezID != "NULL" & EntrezID != "") %>% pull(EntrezID) %>% unique()
  49. shared_up_hab_down_amy_genes <- shared_up_hab_down_amy %>% dplyr::filter(!is.na(EntrezID) & !is.null(EntrezID) & EntrezID != "NULL" & EntrezID != "") %>% pull(EntrezID) %>% unique()
  50. shared_down_hab_up_amy_genes <- shared_down_hab_up_amy %>% dplyr::filter(!is.na(EntrezID) & !is.null(EntrezID) & EntrezID != "NULL" & EntrezID != "") %>% pull(EntrezID) %>% unique()
  51. shared_down_hab_down_amy_genes <- shared_down_hab_down_amy %>% dplyr::filter(!is.na(EntrezID) & !is.null(EntrezID) & EntrezID != "NULL" & EntrezID != "") %>% pull(EntrezID) %>% unique()
  52. ## Background genes (all genes assessed for DGE) -- same genes in Hb and Amyg DGE
  53. geneUniverse <- results_Substance_uncorr_vars_amygdala[[1]] %>%
  54. dplyr::filter(!is.na(EntrezID) & !is.null(EntrezID) & EntrezID != "NULL" & EntrezID != "") %>% pull(EntrezID) %>% unique()
  55. ## Function to find enriched GO and KEGG terms
  56. GO_KEGG<- function(sigGeneList, geneUniverse, name){
  57. ## GO terms
  58. ## Obtain biological processes
  59. goBP_Adj <- compareCluster(
  60. sigGeneList,
  61. fun = "enrichGO",
  62. universe = geneUniverse,
  63. OrgDb = org.Rn.eg.db,
  64. ont = "BP",
  65. pAdjustMethod = "BH",
  66. qvalueCutoff = 0.05,
  67. readable = TRUE
  68. )
  69. ## Save
  70. if (!is.null(goBP_Adj)){
  71. p1 <- dotplot(goBP_Adj, title="GO Enrichment Analysis: Biological processes")
  72. goBP_Adj <- as.data.frame(goBP_Adj)
  73. goBP_Adj$geneID <- sapply(goBP_Adj$geneID, function(row){gsub("/", ", ", row)})
  74. }
  75. ## Obtain molecular functions
  76. goMF_Adj <- compareCluster(
  77. sigGeneList,
  78. fun = "enrichGO",
  79. universe = geneUniverse,
  80. OrgDb = org.Rn.eg.db,
  81. ont = "MF",
  82. pAdjustMethod = "BH",
  83. qvalueCutoff = 0.05,
  84. readable = TRUE
  85. )
  86. if (!is.null(goMF_Adj)){
  87. p2 <- dotplot(goMF_Adj, title="GO Enrichment Analysis: Molecular function")
  88. goMF_Adj <- as.data.frame(goMF_Adj)
  89. goMF_Adj$geneID <- sapply(goMF_Adj$geneID, function(row){gsub("/", ", ", row)})
  90. }
  91. ## Obtain cellular components
  92. goCC_Adj <- compareCluster(
  93. sigGeneList,
  94. fun = "enrichGO",
  95. universe = geneUniverse,
  96. OrgDb = org.Rn.eg.db,
  97. ont = "CC",
  98. pAdjustMethod = "BH",
  99. qvalueCutoff = 0.05,
  100. readable = TRUE
  101. )
  102. if (!is.null(goCC_Adj)){
  103. p3 <- dotplot(goCC_Adj, title="GO Enrichment Analysis: Cellular components")
  104. goCC_Adj <- as.data.frame(goCC_Adj)
  105. goCC_Adj$geneID <- sapply(goCC_Adj$geneID, function(row){gsub("/", ", ", row)})
  106. }
  107. ## KEGG terms
  108. kegg_Adj <- compareCluster(
  109. sigGeneList,
  110. fun = "enrichKEGG",
  111. organism = 'rat',
  112. universe = geneUniverse,
  113. pAdjustMethod = "BH",
  114. qvalueCutoff = 0.05
  115. )
  116. if (!is.null(kegg_Adj)){
  117. p4 <- dotplot(kegg_Adj, title="KEGG Enrichment Analysis")
  118. ## Add symbols
  119. kegg_Adj <- as.data.frame(kegg_Adj)
  120. genes <-sapply(kegg_Adj$geneID, function(term_genes){unlist(strsplit(term_genes, "/"))})
  121. names(genes) <- kegg_Adj$ID
  122. mart = useMart("ensembl", dataset = "rnorvegicus_gene_ensembl")
  123. term_symbols <- lapply(genes, function(term_genes){
  124. symbols <- getBM(attributes = c("entrezgene_id", "external_gene_name", "ensembl_gene_id"),
  125. filters = "entrezgene_id",
  126. values = term_genes,
  127. mart = mart)
  128. symbols <- apply(symbols, 1, function(gene){if(!is.na(gene["external_gene_name"])){gene["external_gene_name"]}
  129. else if(!is.na(gene["ensembl_gene_id"])){gene["ensembl_gene_id"]}
  130. else{gene["entrezgene_id"]}})
  131. paste(symbols, collapse = ", ")
  132. })
  133. kegg_Adj$geneID <- do.call(rbind, term_symbols)
  134. }
  135. ## Plots
  136. if(name != "Hb_and_Amyg_Up_and_Down_unique_and_shared_DEGs"){
  137. h = 10
  138. w = 14
  139. } else{
  140. h = 35
  141. w = 49
  142. }
  143. plot_grid(p1, p2, p3, p4, ncol=2, align = 'vh')
  144. ggsave(paste("plots/06_GO_KEGG/GO_KEGG_", name, ".pdf", sep=""), height = h, width = w)
  145. ## Save results
  146. goList <- list(
  147. BP = goBP_Adj,
  148. MF = goMF_Adj,
  149. CC = goCC_Adj,
  150. KEGG = kegg_Adj
  151. )
  152. return(goList)
  153. }
  154. #-------------------------------------------------------------------------------
  155. ## 1. Analysis for all DEGs from each brain region
  156. ######################
  157. # Habenula
  158. ######################
  159. sigGeneList <- list("All"= unique(de_genes_habenula[which(!is.na(de_genes_habenula$EntrezID) & !de_genes_habenula$EntrezID=='NULL' & !de_genes_habenula$EntrezID==''), 'EntrezID']))
  160. goList_habenula_all_DEGs <- GO_KEGG(sigGeneList, geneUniverse, 'habenula_all_DEGs')
  161. save(goList_habenula_all_DEGs, file="processed-data/06_GO_KEGG/goList_habenula_all_DEGs.Rdata")
  162. ######################
  163. # Amygdala
  164. ######################
  165. sigGeneList <- list("All"= unique(de_genes_amygdala[which(!is.na(de_genes_amygdala$EntrezID) & !de_genes_amygdala$EntrezID=='NULL' & !de_genes_amygdala$EntrezID==''), 'EntrezID']))
  166. goList_amygdala_all_DEGs<-GO_KEGG(sigGeneList, geneUniverse, 'amygdala_all_DEGs')
  167. save(goList_amygdala_all_DEGs, file="processed-data/06_GO_KEGG/goList_amygdala_all_DEGs.Rdata")
  168. #-------------------------------------------------------------------------------
  169. ## 2. Analysis for up- and down-regulated DEGs from each brain region
  170. ######################
  171. # Habenula
  172. ######################
  173. ## List of DEG sets
  174. sigGeneList <- list("Up"=up_hab[which(!is.na(up_hab$EntrezID) & !up_hab$EntrezID=='NULL' & !up_hab$EntrezID==''), 'EntrezID'],
  175. "Down"=down_hab[which(!is.na(down_hab$EntrezID) & !down_hab$EntrezID=='NULL' & !down_hab$EntrezID==''), 'EntrezID'])
  176. goList_habenula_up_down_DEGs<-GO_KEGG(sigGeneList, geneUniverse, 'habenula_up_down_DEGs')
  177. save(goList_habenula_up_down_DEGs, file="processed-data/06_GO_KEGG/goList_habenula_up_down_DEGs.Rdata")
  178. ## Merge
  179. go_kegg_results_hab <- rbind(cbind(goList_habenula_up_down_DEGs$BP, Ontology = "BP"),
  180. cbind(goList_habenula_up_down_DEGs$MF, Ontology = "MF"),
  181. cbind(goList_habenula_up_down_DEGs$CC, Ontology = "CC"),
  182. cbind(goList_habenula_up_down_DEGs$KEGG[colnames(goList_habenula_up_down_DEGs$BP)], Ontology = "KEGG"))
  183. go_kegg_results_hab$DEGs_set <- go_kegg_results_hab$Cluster
  184. go_kegg_results_hab$Cluster <- NULL
  185. go_kegg_results_hab <- go_kegg_results_hab[, c("Ontology", "DEGs_set", "ID", "Description", "Count", "GeneRatio",
  186. "BgRatio", "FoldEnrichment", "pvalue", "p.adjust", "geneID")]
  187. go_kegg_results_hab <- go_kegg_results_hab[order(go_kegg_results_hab$Ontology, go_kegg_results_hab$DEGs_set, go_kegg_results_hab$p.adjust), ]
  188. write.table(go_kegg_results_hab, "processed-data/Supplementary_Tables/TableS8_GO_KEGG_results_hab.tsv", row.names = FALSE, col.names = TRUE, sep = '\t')
  189. ######################
  190. # Amygdala
  191. ######################
  192. sigGeneList <- list("Up"=up_amy[which(!is.na(up_amy$EntrezID) & !up_amy$EntrezID=='NULL' & !up_amy$EntrezID==''), 'EntrezID'],
  193. "Down"=down_amy[which(!is.na(down_amy$EntrezID) & !down_amy$EntrezID=='NULL' & !down_amy$EntrezID==''), 'EntrezID'])
  194. goList_amygdala_up_down_DEGs<-GO_KEGG(sigGeneList, geneUniverse, 'amygdala_up_down_DEGs')
  195. save(goList_amygdala_up_down_DEGs, file="processed-data/06_GO_KEGG/goList_amygdala_up_down_DEGs.Rdata")
  196. go_kegg_results_amy <- rbind(cbind(goList_amygdala_up_down_DEGs$BP, Ontology = "BP"),
  197. cbind(goList_amygdala_up_down_DEGs$MF, Ontology = "MF"),
  198. cbind(goList_amygdala_up_down_DEGs$CC, Ontology = "CC"),
  199. cbind(goList_amygdala_up_down_DEGs$KEGG[colnames(goList_amygdala_up_down_DEGs$BP)], Ontology = "KEGG"))
  200. go_kegg_results_amy$DEGs_set <- go_kegg_results_amy$Cluster
  201. go_kegg_results_amy$Cluster <- NULL
  202. go_kegg_results_amy <- go_kegg_results_amy[, c("Ontology", "DEGs_set", "ID", "Description", "Count", "GeneRatio",
  203. "BgRatio", "FoldEnrichment", "pvalue", "p.adjust", "geneID")]
  204. go_kegg_results_amy <- go_kegg_results_amy[order(go_kegg_results_amy$Ontology, go_kegg_results_amy$DEGs_set, go_kegg_results_amy$p.adjust), ]
  205. write.table(go_kegg_results_amy, "processed-data/Supplementary_Tables/TableS9_GO_KEGG_results_amy.tsv", row.names = FALSE, col.names = TRUE, sep = '\t')
  206. #-------------------------------------------------------------------------------
  207. ## 3. Analysis for up/down DEGs unique/shared in Hb and Amyg
  208. sigGeneList <- list("Unique in Hb - Up" = only_up_hab_genes,
  209. "Unique in Hb - Down" = only_down_hab_genes,
  210. "Unique in Amyg - Up" = only_up_amy_genes,
  211. "Unique in Amyg - Down" = only_down_amy_genes,
  212. "Shared: Up in Hb, Up in Amyg" = shared_up_hab_up_amy_genes,
  213. "Shared: Up in Hb, Down in Amyg" = shared_up_hab_down_amy_genes,
  214. "Shared: Down in Hb, Up in Amyg" = shared_down_hab_up_amy_genes,
  215. "Shared: Down in Hb, Down in Amyg" = shared_down_hab_down_amy_genes)
  216. goList_hb_and_amyg_DEGs <- GO_KEGG(sigGeneList, geneUniverse,
  217. 'Hb_and_Amyg_Up_and_Down_unique_and_shared_DEGs')
  218. save(goList_hb_and_amyg_DEGs, file="processed-data/06_GO_KEGG/goList_Hb_and_Amyg_Up_and_Down_unique_and_shared_DEGs.Rdata")
  219. ## Merge
  220. go_kegg_results <- rbind(cbind(goList_hb_and_amyg_DEGs$BP, Ontology = "BP"),
  221. cbind(goList_hb_and_amyg_DEGs$MF, Ontology = "MF"),
  222. cbind(goList_hb_and_amyg_DEGs$CC, Ontology = "CC"),
  223. cbind(goList_hb_and_amyg_DEGs$KEGG[colnames(goList_hb_and_amyg_DEGs$BP)], Ontology = "KEGG"))
  224. go_kegg_results$DEGs_set <- go_kegg_results$Cluster
  225. go_kegg_results$Cluster <- NULL
  226. go_kegg_results <- go_kegg_results[, c("Ontology", "DEGs_set", "ID", "Description", "Count", "GeneRatio",
  227. "BgRatio", "FoldEnrichment", "pvalue", "p.adjust", "geneID")]
  228. go_kegg_results <- go_kegg_results[order(go_kegg_results$Ontology, go_kegg_results$DEGs_set, go_kegg_results$p.adjust), ]
  229. write.table(go_kegg_results, "processed-data/Supplementary_Tables/TableS10_GO_KEGG_results_hab_vs_amyg.tsv", row.names = FALSE, col.names = TRUE, sep = '\t')
  230. ## ------
  231. ## Heatmap with GO & KEGG enrichment results for Hb vs Amyg
  232. ## Find enriched terms of interest (list provided by Kristen and Robin)
  233. ## For Hb:
  234. go_kegg_results %>% dplyr::filter(Ontology == "BP", Description == "regulation of synapse structure or activity") %>% .[,1:4]
  235. # Ontology DEGs_set ID Description
  236. # 1 BP Unique in Hb - Up GO:0050803 regulation of synapse structure or activity
  237. # 2 BP Unique in Amyg - Up GO:0050803 regulation of synapse structure or activity
  238. go_kegg_results %>% dplyr::filter(Ontology == "BP", Description == "regulation of presynaptic membrane potential") %>% .[,1:4]
  239. # Ontology DEGs_set ID Description
  240. # 1 BP Unique in Hb - Up GO:0099505 regulation of presynaptic membrane potential
  241. # 2 BP Shared: Up in Hb, Up in Amyg GO:0099505 regulation of presynaptic membrane potential
  242. go_kegg_results %>% dplyr::filter(Ontology == "BP", Description == "regulation of postsynaptic membrane potential") %>% .[,1:4]
  243. # Ontology DEGs_set ID Description
  244. # 1 BP Unique in Hb - Up GO:0060078 regulation of postsynaptic membrane potential
  245. go_kegg_results %>% dplyr::filter(Ontology == "BP", Description == "extracellular matrix organization") %>% .[,1:4]
  246. # Ontology DEGs_set ID Description
  247. # 1 BP Unique in Hb - Down GO:0030198 extracellular matrix organization
  248. # 2 BP Unique in Amyg - Down GO:0030198 extracellular matrix organization
  249. # 3 BP Shared: Down in Hb, Down in Amyg GO:0030198 extracellular matrix organization
  250. go_kegg_results %>% dplyr::filter(Ontology == "BP", Description == "oligodendrocyte differentiation") %>% .[,1:4]
  251. # Ontology DEGs_set ID Description
  252. # 1 BP Unique in Amyg - Down GO:0048709 oligodendrocyte differentiation
  253. # 2 BP Shared: Down in Hb, Down in Amyg GO:0048709 oligodendrocyte differentiation
  254. go_kegg_results %>% dplyr::filter(Ontology == "CC", Description == "presynaptic membrane") %>% .[,1:4]
  255. # Ontology DEGs_set ID Description
  256. # 1 CC Unique in Hb - Up GO:0042734 presynaptic membrane
  257. # 2 CC Shared: Up in Hb, Up in Amyg GO:0042734 presynaptic membrane
  258. go_kegg_results %>% dplyr::filter(Ontology == "CC", Description == "postsynaptic membrane") %>% .[,1:4]
  259. # Ontology DEGs_set ID Description
  260. # 1 CC Unique in Hb - Up GO:0045211 postsynaptic membrane
  261. # 2 CC Shared: Up in Hb, Up in Amyg GO:0045211 postsynaptic membrane
  262. go_kegg_results %>% dplyr::filter(Ontology == "CC", Description == "collagen-containing extracellular matrix") %>% .[,1:4]
  263. # Ontology DEGs_set ID Description
  264. # 1 CC Unique in Hb - Down GO:0062023 collagen-containing extracellular matrix
  265. # 2 CC Unique in Amyg - Down GO:0062023 collagen-containing extracellular matrix
  266. # 3 CC Shared: Down in Hb, Down in Amyg GO:0062023 collagen-containing extracellular matrix
  267. go_kegg_results %>% dplyr::filter(Ontology == "CC", Description == "myelin sheath") %>% .[,1:4]
  268. # Ontology DEGs_set ID Description
  269. # 1 CC Unique in Amyg - Down GO:0043209 myelin sheath
  270. # 2 CC Shared: Down in Hb, Down in Amyg GO:0043209 myelin sheath
  271. #
  272. go_kegg_results %>% dplyr::filter(Ontology == "MF", Description == "voltage-gated monoatomic cation channel activity") %>% .[,1:4]
  273. # Ontology DEGs_set ID Description
  274. # 1 MF Unique in Hb - Up GO:0022843 voltage-gated monoatomic cation channel activity
  275. # 2 MF Shared: Up in Hb, Up in Amyg GO:0022843 voltage-gated monoatomic cation channel activity
  276. go_kegg_results %>% dplyr::filter(Ontology == "MF", Description == "metal ion transmembrane transporter activity") %>% .[,1:4]
  277. # Ontology DEGs_set ID Description
  278. # 1 MF Unique in Hb - Up GO:0046873 metal ion transmembrane transporter activity
  279. go_kegg_results %>% dplyr::filter(Ontology == "KEGG", Description == "Morphine addiction") %>% .[,1:4]
  280. # Ontology DEGs_set ID Description
  281. # 1 KEGG Unique in Hb - Up rno05032 Morphine addiction
  282. go_kegg_results %>% dplyr::filter(Ontology == "KEGG", Description == "Glutamatergic synapse") %>% .[,1:4]
  283. # Ontology DEGs_set ID Description
  284. # 1 KEGG Unique in Hb - Up rno04724 Glutamatergic synapse
  285. # 2 KEGG Unique in Amyg - Up rno04724 Glutamatergic synapse
  286. # 3 KEGG Shared: Up in Hb, Down in Amyg rno04724 Glutamatergic synapse
  287. go_kegg_results %>% dplyr::filter(Ontology == "KEGG", Description == "Gastric acid secretion") %>% .[,1:4]
  288. # Ontology DEGs_set ID Description
  289. # 1 KEGG Unique in Hb - Up rno04971 Gastric acid secretion
  290. # 2 KEGG Unique in Hb - Down rno04971 Gastric acid secretion
  291. # 3 KEGG Shared: Up in Hb, Down in Amyg rno04971 Gastric acid secretion
  292. go_kegg_results %>% dplyr::filter(Ontology == "KEGG", Description == "ECM-receptor interaction") %>% .[,1:4]
  293. # Ontology DEGs_set ID Description
  294. # 1 KEGG Unique in Hb - Down rno04512 ECM-receptor interaction
  295. # 2 KEGG Unique in Amyg - Down rno04512 ECM-receptor interaction
  296. # 3 KEGG Shared: Up in Hb, Down in Amyg rno04512 ECM-receptor interaction
  297. ## For Amyg:
  298. go_kegg_results %>% dplyr::filter(Ontology == "BP", Description == "aerobic respiration") %>% .[,1:4]
  299. # Ontology DEGs_set ID Description
  300. # 1 BP Unique in Amyg - Up GO:0009060 aerobic respiration
  301. go_kegg_results %>% dplyr::filter(Ontology == "BP", Description == "vesicle-mediated transport in synapse") %>% .[,1:4]
  302. # Ontology DEGs_set ID Description
  303. # 1 BP Unique in Amyg - Up GO:0099003 vesicle-mediated transport in synapse
  304. go_kegg_results %>% dplyr::filter(Ontology == "BP", Description == "glial cell differentiation") %>% .[,1:4]
  305. # Ontology DEGs_set ID Description
  306. # 1 BP Unique in Amyg - Down GO:0010001 glial cell differentiation
  307. # 2 BP Shared: Down in Hb, Down in Amyg GO:0010001 glial cell differentiation
  308. go_kegg_results %>% dplyr::filter(Ontology == "BP", Description == "extracellular matrix organization") %>% .[,1:4]
  309. # Ontology DEGs_set ID Description
  310. # 1 BP Unique in Hb - Down GO:0030198 extracellular matrix organization
  311. # 2 BP Unique in Amyg - Down GO:0030198 extracellular matrix organization
  312. # 3 BP Shared: Down in Hb, Down in Amyg GO:0030198 extracellular matrix organization
  313. go_kegg_results %>% dplyr::filter(Ontology == "CC", Description == "mitochondrial inner membrane") %>% .[,1:4]
  314. # Ontology DEGs_set ID Description
  315. # 1 CC Unique in Amyg - Up GO:0005743 mitochondrial inner membrane
  316. go_kegg_results %>% dplyr::filter(Ontology == "CC", Description == "exocytic vesicle") %>% .[,1:4]
  317. # Ontology DEGs_set ID Description
  318. # 1 CC Unique in Amyg - Up GO:0070382 exocytic vesicle
  319. go_kegg_results %>% dplyr::filter(Ontology == "CC", Description == "extracellular matrix") %>% .[,1:4]
  320. # Ontology DEGs_set ID Description
  321. # 1 CC Unique in Hb - Down GO:0031012 extracellular matrix
  322. # 2 CC Unique in Amyg - Down GO:0031012 extracellular matrix
  323. go_kegg_results %>% dplyr::filter(Ontology == "CC", Description == "myelin sheath") %>% .[,1:4]
  324. # Ontology DEGs_set ID Description
  325. # 1 CC Unique in Amyg - Down GO:0043209 myelin sheath
  326. # 2 CC Shared: Down in Hb, Down in Amyg GO:0043209 myelin sheath
  327. go_kegg_results %>% dplyr::filter(Ontology == "MF", Description == "structural constituent of ribosome") %>% .[,1:4]
  328. # Ontology DEGs_set ID Description
  329. # 1 MF Unique in Amyg - Up GO:0003735 structural constituent of ribosome
  330. go_kegg_results %>% dplyr::filter(Ontology == "MF", Description == "proton-transporting ATP synthase activity, rotational mechanism") %>% .[,1:4]
  331. # Ontology DEGs_set ID Description
  332. # 1 MF Unique in Amyg - Up GO:0046933 proton-transporting ATP synthase activity, rotational mechanism
  333. go_kegg_results %>% dplyr::filter(Ontology == "MF", Description == "cytoskeletal motor activity") %>% .[,1:4]
  334. # Ontology DEGs_set ID Description
  335. # 1 MF Unique in Amyg - Down GO:0003774 cytoskeletal motor activity
  336. go_kegg_results %>% dplyr::filter(Ontology == "MF", Description == "extracellular matrix structural constituent") %>% .[,1:4]
  337. # Ontology DEGs_set ID Description
  338. # 1 MF Unique in Amyg - Down GO:0005201 extracellular matrix structural constituent
  339. # 2 MF Shared: Up in Hb, Down in Amyg GO:0005201 extracellular matrix structural constituent
  340. go_kegg_results %>% dplyr::filter(Ontology == "KEGG", Description == "Oxidative phosphorylation") %>% .[,1:4]
  341. # Ontology DEGs_set ID Description
  342. # 1 KEGG Unique in Amyg - Up rno00190 Oxidative phosphorylation
  343. go_kegg_results %>% dplyr::filter(Ontology == "KEGG", Description == "Parkinson disease") %>% .[,1:4]
  344. # Ontology DEGs_set ID Description
  345. # 1 KEGG Unique in Amyg - Up rno05012 Parkinson disease
  346. go_kegg_results %>% dplyr::filter(Ontology == "KEGG", Description == "ECM-receptor interaction") %>% .[,1:4]
  347. # Ontology DEGs_set ID Description
  348. # 1 KEGG Unique in Hb - Down rno04512 ECM-receptor interaction
  349. # 2 KEGG Unique in Amyg - Down rno04512 ECM-receptor interaction
  350. # 3 KEGG Shared: Up in Hb, Down in Amyg rno04512 ECM-receptor interaction
  351. go_kegg_results %>% dplyr::filter(Ontology == "KEGG", Description == "Regulation of actin cytoskeleton") %>% .[,1:4]
  352. # Ontology DEGs_set ID Description
  353. # 1 KEGG Unique in Amyg - Up rno04810 Regulation of actin cytoskeleton
  354. # 2 KEGG Unique in Amyg - Down rno04810 Regulation of actin cytoskeleton
  355. enriched_terms <- list("only_up_hab" = c("regulation of synapse structure or activity", "regulation of presynaptic membrane potential",
  356. "regulation of postsynaptic membrane potential",
  357. "presynaptic membrane", "postsynaptic membrane", "voltage-gated monoatomic cation channel activity",
  358. "metal ion transmembrane transporter activity", "Morphine addiction", "Glutamatergic synapse",
  359. "Gastric acid secretion"),
  360. "only_down_hab" = c("extracellular matrix organization", "collagen-containing extracellular matrix", "Gastric acid secretion",
  361. "ECM-receptor interaction", "extracellular matrix"),
  362. "only_up_amy" = c("regulation of synapse structure or activity", "Glutamatergic synapse", "aerobic respiration",
  363. "vesicle-mediated transport in synapse", "mitochondrial inner membrane", "exocytic vesicle",
  364. "structural constituent of ribosome", "proton-transporting ATP synthase activity, rotational mechanism",
  365. "Oxidative phosphorylation", "Parkinson disease", "Regulation of actin cytoskeleton"),
  366. "only_down_amy" = c("extracellular matrix organization", "oligodendrocyte differentiation",
  367. "collagen-containing extracellular matrix", "myelin sheath", "ECM-receptor interaction",
  368. "glial cell differentiation", "extracellular matrix", "cytoskeletal motor activity",
  369. "extracellular matrix structural constituent", "Regulation of actin cytoskeleton"),
  370. "shared_up_hab_up_amy" = c("regulation of presynaptic membrane potential", "presynaptic membrane",
  371. "postsynaptic membrane", "voltage-gated monoatomic cation channel activity"),
  372. "shared_up_hab_down_amy" = c("Glutamatergic synapse", "Gastric acid secretion", "ECM-receptor interaction",
  373. "extracellular matrix structural constituent"),
  374. "shared_down_hab_up_amy" = c(),
  375. "shared_down_hab_down_amy" = c("extracellular matrix organization", "oligodendrocyte differentiation",
  376. "collagen-containing extracellular matrix", "myelin sheath", "glial cell differentiation")
  377. )
  378. ## Annotate DEGs of interest in each term of interest (Kristen and Robin list) in specific group(s) (up/down unique/shared in Hb/Amyg)
  379. only_up_hab_genes_2_show = list()
  380. only_down_hab_genes_2_show = list()
  381. only_up_amy_genes_2_show = list()
  382. only_down_amy_genes_2_show = list()
  383. shared_up_hab_up_amy_genes_2_show = list("regulation of presynaptic membrane potential" = c("Kcnj3", "Kcnc2", "Kcnj9", "Kctd16"),
  384. "presynaptic membrane" = c("Kcnj3", "Kcnc2", "Kcnj9", "Kctd16"),
  385. "postsynaptic membrane" = c("Kcnc2", "LRRTM1", "Epha4", "Lrrtm2"),
  386. "voltage-gated monoatomic cation channel activity" = c("Kcnj3", "Kcnc2", "Kcnj9"))
  387. shared_up_hab_down_amy_genes_2_show = list("Glutamatergic synapse",
  388. "Gastric acid secretion",
  389. "extracellular matrix structural constituent" = c("Col4a3"),
  390. "ECM-receptor interaction" = c("Col4a3"))
  391. shared_down_hab_down_amy_genes_2_show = list("extracellular matrix organization" = c("Tgfbi", "Antxr1", "Col9a3", "Loxl4", "Sox9"),
  392. "oligodendrocyte differentiation" = c("Cnp", "Sox8", "Gsn", "Sox9", "Opalin"),
  393. "collagen-containing extracellular matrix" = c("Tgfbi", "Col9a3", "Loxl4", "Fgfr2"),
  394. "myelin sheath" = c("Cnp", "Tubb4a", "Gsn", "Tspan2"),
  395. "glial cell differentiation" = c("Cnp", "Gsn", "Sox9", "Opalin", "Tspan2"))
  396. ## Show additional top 5 most signif DEGs in each group
  397. only_up_hab_genes_additional_top = list("regulation of synapse structure or activity" = c(),
  398. "regulation of presynaptic membrane potential" = c(),
  399. "regulation of postsynaptic membrane potential" = c(),
  400. "presynaptic membrane" = c(),
  401. "postsynaptic membrane" = c(),
  402. "voltage-gated monoatomic cation channel activity" = c(),
  403. "metal ion transmembrane transporter activity" = c(),
  404. "Morphine addiction" = c(),
  405. "Glutamatergic synapse" = c(),
  406. "Gastric acid secretion" = c())
  407. only_down_hab_genes_additional_top = list("extracellular matrix organization" = c(),
  408. "collagen-containing extracellular matrix" = c(),
  409. "Gastric acid secretion" = c(),
  410. "ECM-receptor interaction" = c(),
  411. "extracellular matrix" = c(),
  412. "ECM-receptor interaction" = c())
  413. only_up_amy_genes_additional_top = list("regulation of synapse structure or activity" = c(),
  414. "Glutamatergic synapse" = c(),
  415. "aerobic respiration" = c(),
  416. "vesicle-mediated transport in synapse" = c(),
  417. "mitochondrial inner membrane" = c(),
  418. "exocytic vesicle" = c(),
  419. "structural constituent of ribosome" = c(),
  420. "proton-transporting ATP synthase activity, rotational mechanism" = c(),
  421. "Oxidative phosphorylation" = c(),
  422. "Parkinson disease" = c(),
  423. "Regulation of actin cytoskeleton" = c())
  424. only_down_amy_genes_2_show = list("extracellular matrix organization",
  425. "oligodendrocyte differentiation",
  426. "collagen-containing extracellular matrix",
  427. "myelin sheath",
  428. "ECM-receptor interaction",
  429. "glial cell differentiation",
  430. "extracellular matrix",
  431. "cytoskeletal motor activity",
  432. "extracellular matrix structural constituent",
  433. "ECM-receptor interaction",
  434. "Regulation of actin cytoskeleton")
  435. ## Extract DEGs of interest terms across DEG groups (include interest DEGs from Kristen and Robin list)
  436. genes_2_show_x_term_x_group <- list(list(), list(), list(), list(), list(), list(), list(), list())
  437. names(genes_2_show_x_term_x_group) <- unique(go_kegg_results$DEGs_set)
  438. ## Specific DEGs to highlight
  439. interest_genes <- unique(c("Ptpn3", "Kcnc2", "Kcnj9", "Kcnj3", "Kctd16",
  440. "LRRTM1", "Lrrtm1", "Epha4", "Lrrn3", "Fam107a", "LRRTM2", "Lrrtm2",
  441. "Loxl4", "Antxr1", "Tgfbi", "Col9a3", "Sox9",
  442. "Cnp", "Gsn", "Sox8", "Sox9", "Opalin",
  443. "Kcnc2", "Npy1r", "Kcnj9", "Epha4", "Kcnj3",
  444. "Kcnc2", "LRRTM1", "Epha4", "Kctd16", "Cdh10",
  445. "Loxl4", "Col9a3", "Tgfbi", "Fgfr2",
  446. "Cnp", "Gsn", "Tspan2", "Tubb4a",
  447. "Kcnc2", "Kcnj9", "Kcnj3",
  448. "Slc13a5", "Kcnc2", "Kcnj9", "Kcnj3",
  449. "Col9a3",
  450. "Ap3s1",
  451. "Col4a3"))
  452. ## Terms of interest
  453. terms <- c("regulation of presynaptic membrane potential", "regulation of postsynaptic membrane potential",
  454. "regulation of synapse structure or activity", "extracellular matrix organization", "oligodendrocyte differentiation",
  455. "presynaptic membrane", "postsynaptic membrane", "collagen-containing extracellular matrix", "myelin sheath",
  456. "voltage-gated monoatomic cation channel activity", "metal ion transmembrane transporter activity",
  457. "Morphine addiction", "Glutamatergic synapse", "Gastric acid secretion", "ECM-receptor interaction",
  458. "aerobic respiration", "vesicle-mediated transport in synapse", "glial cell differentiation", "extracellular matrix organization",
  459. "mitochondrial inner membrane", "exocytic vesicle", "extracellular matrix", "structural constituent of ribosome",
  460. "proton-transporting ATP synthase activity, rotational mechanism", "cytoskeletal motor activity",
  461. "extracellular matrix structural constituent", "Oxidative phosphorylation", "Parkinson disease",
  462. "Regulation of actin cytoskeleton")
  463. BP_terms <- c("regulation of presynaptic membrane potential", "regulation of postsynaptic membrane potential",
  464. "regulation of synapse structure or activity", "extracellular matrix organization",
  465. "oligodendrocyte differentiation", "aerobic respiration", "vesicle-mediated transport in synapse",
  466. "glial cell differentiation", "extracellular matrix organization")
  467. CC_terms <- c("presynaptic membrane", "postsynaptic membrane", "collagen-containing extracellular matrix", "myelin sheath", "mitochondrial inner membrane", "exocytic vesicle", "extracellular matrix")
  468. MF_terms <- c("voltage-gated monoatomic cation channel activity", "metal ion transmembrane transporter activity",
  469. "structural constituent of ribosome",
  470. "proton-transporting ATP synthase activity, rotational mechanism",
  471. "cytoskeletal motor activity", "extracellular matrix structural constituent")
  472. KEGG_terms <- c("Morphine addiction", "Glutamatergic synapse", "Gastric acid secretion", "ECM-receptor interaction",
  473. "Oxidative phosphorylation", "Parkinson disease",
  474. "Regulation of actin cytoskeleton")
  475. for(term in terms){
  476. ## Extract groups of DEGs where term is enriched
  477. DEG_groups_with_term <- go_kegg_results %>% dplyr::filter(Description == term) %>% pull(DEGs_set)
  478. for(group in DEG_groups_with_term){
  479. ## Genes in term and group
  480. intersection_genes <- strsplit(go_kegg_results %>% dplyr::filter(Description == term & DEGs_set == group) %>% pull(geneID), ", ") %>% unlist
  481. ## Subset to the specific genes of interest
  482. genes_of_interest_2_show <- intersect(intersection_genes, interest_genes)
  483. if(length(genes_of_interest_2_show) >= 3){
  484. genes_2_show_x_term_x_group[[group]][[term]] = genes_of_interest_2_show
  485. }
  486. else{
  487. ## Add top n most signif genes in group and term
  488. n = 3 - length(genes_of_interest_2_show)
  489. if(group == "Unique in Hb - Up"){
  490. top3_intersection_genes <- only_up_hab %>% dplyr::filter(Symbol %in% intersection_genes, !Symbol %in% interest_genes) %>% arrange(adj.P.Val) %>% slice(1:n) %>% pull(Symbol)
  491. }
  492. else if(group == "Unique in Hb - Down"){
  493. top3_intersection_genes <- only_down_hab %>% dplyr::filter(Symbol %in% intersection_genes, !Symbol %in% interest_genes) %>% arrange(adj.P.Val) %>% slice(1:n) %>% pull(Symbol)
  494. }
  495. else if(group == "Unique in Amyg - Up"){
  496. top3_intersection_genes <- only_up_amy %>% dplyr::filter(Symbol %in% intersection_genes, !Symbol %in% interest_genes) %>% arrange(adj.P.Val) %>% slice(1:n) %>% pull(Symbol)
  497. }
  498. else if(group == "Unique in Amyg - Down"){
  499. top3_intersection_genes <- only_down_amy %>% dplyr::filter(Symbol %in% intersection_genes, !Symbol %in% interest_genes) %>% arrange(adj.P.Val) %>% slice(1:n) %>% pull(Symbol)
  500. }
  501. else if(group == "Shared: Up in Hb, Up in Amyg"){
  502. top3_intersection_genes <- shared_up_hab_up_amy %>% dplyr::filter(Symbol %in% intersection_genes, !Symbol %in% interest_genes) %>%
  503. mutate(min_p = pmin(adj.P.Val.hb, adj.P.Val.amyg)) %>% arrange(min_p) %>% slice(1:n) %>% pull(Symbol)
  504. }
  505. else if(group == "Shared: Up in Hb, Down in Amyg"){
  506. top3_intersection_genes <- shared_up_hab_down_amy %>% dplyr::filter(Symbol %in% intersection_genes, !Symbol %in% interest_genes) %>%
  507. mutate(min_p = pmin(adj.P.Val.hb, adj.P.Val.amyg)) %>% arrange(min_p) %>% slice(1:n) %>% pull(Symbol)
  508. }
  509. else if(group == "Shared: Down in Hb, Up in Amyg"){
  510. top3_intersection_genes <- shared_down_hab_up_amy %>% dplyr::filter(Symbol %in% intersection_genes, !Symbol %in% interest_genes) %>%
  511. mutate(min_p = pmin(adj.P.Val.hb, adj.P.Val.amyg)) %>% arrange(min_p) %>% slice(1:n) %>% pull(Symbol)
  512. }
  513. else if(group == "Shared: Down in Hb, Down in Amyg"){
  514. top3_intersection_genes <- shared_down_hab_down_amy %>% dplyr::filter(Symbol %in% intersection_genes, !Symbol %in% interest_genes) %>%
  515. mutate(min_p = pmin(adj.P.Val.hb, adj.P.Val.amyg)) %>% arrange(min_p) %>% slice(1:n) %>% pull(Symbol)
  516. }
  517. genes_2_show_x_term_x_group[[group]][[term]] = c(genes_of_interest_2_show, top3_intersection_genes)
  518. }
  519. }
  520. }
  521. l <- sapply(names(genes_2_show_x_term_x_group), function(set){
  522. imap_dfr(genes_2_show_x_term_x_group[[set]], ~ enframe(.x, value = "Symbol") %>% mutate(term = .y, DEGs_set = set))
  523. })
  524. l <- do.call(rbind, l)
  525. ## Add logFC of selected genes in Hb and Amyg
  526. df <- l %>% left_join(results_Substance_uncorr_vars_habenula[[1]][, c("Symbol", "logFC", "t", "P.Value", "adj.P.Val")], by = "Symbol", multiple = "any") %>% left_join(results_Substance_uncorr_vars_amygdala[[1]][, c("Symbol", "logFC", "t", "P.Value", "adj.P.Val")], by = "Symbol", multiple = "any", suffix = c(".Hb", ".Amy"))
  527. df$DEGs_set <- factor(df$DEGs_set, levels = unique(df$DEGs_set))
  528. ## Order terms by alp order x group
  529. df <- df %>% arrange(DEGs_set, term) %>% as.data.frame()
  530. num_genes_x_term_x_group <- df %>% group_by(DEGs_set, term) %>% summarise(count = length(unique(Symbol)))
  531. term_indices <- map2(.x = c(1, head(cumsum(num_genes_x_term_x_group$count), -1)+1),
  532. .y = cumsum(num_genes_x_term_x_group$count),
  533. ~(1:dim(df)[1])[.x:.y])
  534. names(term_indices) <- num_genes_x_term_x_group$term
  535. la = rowAnnotation(Group = df$DEGs_set)
  536. ra = rowAnnotation(term = anno_block(align_to = term_indices,
  537. panel_fun = function(index, nm){
  538. grid.text(nm, rot = 0, just = "left", name = "term",
  539. gp = gpar(fontsize = 7), x = 3.2)}))
  540. h <- Heatmap(as.matrix(df[, c("logFC.Hb", "logFC.Amy")]),
  541. name = "logFC",
  542. border = T,
  543. row_labels = df$Symbol,
  544. row_names_side = "right",
  545. column_labels = c("logFC in Hb", "logFC in Amyg"),
  546. column_names_rot = 90,
  547. column_names_centered = F,
  548. column_names_gp = gpar(fontsize = 7),
  549. row_names_gp = gpar(fontsize = 5, fontface = "italic"),
  550. row_split = df[, c("DEGs_set", "term")],
  551. gap = unit(0.75, "mm"),
  552. left_annotation = la,
  553. right_annotation = ra,
  554. row_title_gp = gpar(fontsize = 0),
  555. cluster_rows = FALSE,
  556. cluster_columns = FALSE,
  557. height = unit(35, "cm"),
  558. heatmap_width = unit(5, "cm"))
  559. pdf(file = paste0("plots/06_GO_KEGG/GO_KEGG_heatmap_Hb_vs_Amyg.pdf"), height = 15, width = 10)
  560. draw(h, heatmap_legend_side = "left")
  561. dev.off()
  562. ## Tile plot
  563. df_wide <- l %>% dplyr::select(Symbol, DEGs_set, term) %>%
  564. mutate(present = 1) %>%
  565. pivot_wider(
  566. names_from = term,
  567. values_from = present,
  568. values_fill = 0
  569. )
  570. df_longer <- df_wide %>% pivot_longer(cols = setdiff(colnames(df_wide), c("Symbol", "DEGs_set")))
  571. df_longer$DEGs_set <- factor(df_longer$DEGs_set, levels = unique(l$DEGs_set))
  572. df_longer <- df_longer %>% arrange(DEGs_set, name)
  573. df_longer$Symbol <- factor(df_longer$Symbol, levels = unique(df_longer$Symbol))
  574. df_longer$name <- factor(df_longer$name, levels = rev(unique(df_longer$name)))
  575. df_longer <- df_longer %>%
  576. mutate("Ontology" = case_when(name %in% BP_terms ~ "BP",
  577. name %in% CC_terms ~ "CC",
  578. name %in% MF_terms ~ "MF",
  579. name %in% KEGG_terms ~ "KEGG"))
  580. df_longer$Ontology <- factor(df_longer$Ontology, levels = c("BP", "CC", "MF", "KEGG"))
  581. ## Add logFC in Hb and Amyg
  582. df_logFCs <- results_Substance_uncorr_vars_habenula[[1]] %>%
  583. subset(Symbol %in% df_longer$Symbol) %>%
  584. dplyr::select(Symbol, logFC) %>%
  585. left_join(subset(results_Substance_uncorr_vars_amygdala[[1]],
  586. results_Substance_uncorr_vars_amygdala[[1]]$Symbol %in% df_longer$Symbol)[, c("Symbol", "logFC")],
  587. by = "Symbol", multiple = "any", suffix = c(".Hb", ".Amyg"))
  588. df_logFCs$logFC.Hb <- df_logFCs$logFC.Hb - mean(df_logFCs$logFC.Hb)
  589. df_logFCs$logFC.Amyg <- df_logFCs$logFC.Amyg - mean(df_logFCs$logFC.Amyg)
  590. df_logFCs <- df_logFCs[-which(duplicated(df_logFCs$Symbol)),]
  591. df_logFCs <- pivot_longer(df_logFCs, cols = c("logFC.Hb", "logFC.Amyg")) %>%
  592. left_join(unique(df_longer[, c("Symbol", "DEGs_set")]), by = "Symbol") %>%
  593. mutate(Ontology = case_when(name == "logFC.Hb" ~ "LogFC in Hb",
  594. name == "logFC.Amyg" ~ "LogFC in Amyg"))
  595. df_longer <- rbind(df_longer, df_logFCs[, colnames(df_longer)])
  596. noKEGGgenes <- df_longer %>%
  597. dplyr::filter(Ontology %in% c("BP", "CC" ,"MF")) %>%
  598. dplyr::group_by(Symbol) %>%
  599. summarise(sum(value)) %>%
  600. .[.[,2]> 0, ] %>%
  601. dplyr::select(Symbol) %>% unlist()
  602. df_longer_noKEGG <- df_longer %>% dplyr::filter(Symbol %in% noKEGGgenes)
  603. toplot <- df_longer_noKEGG %>% dplyr::filter(Ontology %in% c("BP", "CC" ,"MF"))
  604. bottomplot <- df_longer_noKEGG %>% dplyr::filter(Ontology %in% c("LogFC in Hb", "LogFC in Amyg"))
  605. p1 <- ggplot(toplot, aes(x = Symbol, y = name, fill = value)) +
  606. geom_tile(color = "gray80", linewidth = 0.005) +
  607. facet_grid(rows = vars(Ontology), cols = vars(DEGs_set),
  608. scales = "free", space = "free") +
  609. scale_fill_gradient(low = "white", high = "gray40") +
  610. guides(fill = "none") +
  611. theme_bw() +
  612. labs(y = "Enriched term") +
  613. theme(axis.text.x = element_text(size = 6, angle = 90, hjust = 1, face = 3),
  614. axis.text.y = element_text(size = 7),
  615. strip.text.x = element_blank(),
  616. strip.background = element_rect(fill="white", color = "white"),
  617. panel.spacing = unit(0.1, "lines"))
  618. p2 <- ggplot(bottomplot, aes(x = Symbol, y = name, fill = value)) +
  619. geom_tile(color = "gray80", linewidth = 0.00) +
  620. facet_grid(cols = vars(DEGs_set),
  621. scale = "free", space = "free") +
  622. scale_x_discrete(expand=c(0,0)) +
  623. scale_y_discrete(expand=c(0,0)) +
  624. scale_fill_gradient2(low = "blue3",
  625. mid = "gray90",
  626. high = "red3") +
  627. theme(axis.title.x = element_blank(),
  628. axis.text.x = element_blank(),
  629. axis.ticks.x = element_blank(),
  630. axis.text.y = element_text(size = 7),
  631. strip.text.x = element_text(size = 8, angle = 90, hjust = 0, face = 3),
  632. strip.background = element_rect(fill="white", color = "white"),
  633. panel.spacing = unit(0.1, "lines"))
  634. plot_grid(p2, p1, nrow = 2, align = "v", axis = "tblr", rel_heights = c(0.7, 1))
  635. ggsave("plots/06_GO_KEGG/GO_tile_Hb_vs_Amyg.pdf", height = 6, width = 10)
  636. ## Supp table for KEGG
  637. KEGGgenes <- df_longer %>%
  638. dplyr::filter(Ontology %in% c("KEGG")) %>%
  639. dplyr::group_by(Symbol) %>%
  640. summarise(sum(value)) %>%
  641. .[.[,2]> 0, ] %>%
  642. dplyr::select(Symbol) %>% unlist()
  643. df_longer_KEGGgenes <- df_longer %>% dplyr::filter(Symbol %in% KEGGgenes)
  644. toplot <- df_longer_KEGGgenes %>% dplyr::filter(Ontology %in% c("KEGG"))
  645. bottomplot <- df_longer_KEGGgenes %>% dplyr::filter(Ontology %in% c("LogFC in Hb", "LogFC in Amyg"))
  646. p1 <- ggplot(toplot, aes(x = Symbol, y = name, fill = value)) +
  647. geom_tile(color = "gray80", linewidth = 0.005) +
  648. facet_grid(rows = vars(Ontology), cols = vars(DEGs_set),
  649. scales = "free", space = "free") +
  650. scale_fill_gradient(low = "white", high = "gray40") +
  651. guides(fill = "none") +
  652. theme_bw() +
  653. labs(y = "Enriched term") +
  654. theme(axis.text.x = element_text(size = 6, angle = 90, hjust = 1, face = 3),
  655. axis.text.y = element_text(size = 7),
  656. strip.text.x = element_blank(),
  657. strip.background = element_rect(fill="white", color = "white"),
  658. panel.spacing = unit(0.1, "lines"))
  659. p2 <- ggplot(bottomplot, aes(x = Symbol, y = name, fill = value)) +
  660. geom_tile(color = "gray80", linewidth = 0.00) +
  661. facet_grid(cols = vars(DEGs_set),
  662. scale = "free", space = "free") +
  663. scale_x_discrete(expand=c(0,0)) +
  664. scale_y_discrete(expand=c(0,0)) +
  665. scale_fill_gradient2(low = "blue3",
  666. mid = "gray90",
  667. high = "red3") +
  668. theme(axis.title.x = element_blank(),
  669. axis.text.x = element_blank(),
  670. axis.ticks.x = element_blank(),
  671. axis.text.y = element_text(size = 7),
  672. strip.text.x = element_text(size = 8, angle = 90, hjust = 0, face = 3),
  673. strip.background = element_rect(fill="white", color = "white"),
  674. panel.spacing = unit(0.1, "lines"))
  675. plot_grid(p2, p1, nrow = 2, align = "v", axis = "tblr", rel_heights = c(0.9, 1))
  676. ggsave("plots/06_GO_KEGG/KEGG_tile_Hb_vs_Amyg.pdf", height = 5, width = 6)
  677. ## Reproducibility information
  678. options(width = 120)
  679. session_info()
  680. # ─ Session info ───────────────────────────────────────────────────────────────────────────────────────────────────────
  681. # setting value
  682. # version R version 4.3.2 (2023-10-31)
  683. # os macOS Monterey 12.5.1
  684. # system aarch64, darwin20
  685. # ui RStudio
  686. # language (EN)
  687. # collate en_US.UTF-8
  688. # ctype en_US.UTF-8
  689. # tz America/Mexico_City
  690. # date 2024-04-23
  691. # rstudio 2023.12.1+402 Ocean Storm (desktop)
  692. # pandoc 3.1.1 @ /Applications/RStudio.app/Contents/Resources/app/quarto/bin/tools/ (via rmarkdown)
  693. #
  694. # ─ Packages ───────────────────────────────────────────────────────────────────────────────────────────────────────────
  695. # package * version date (UTC) lib source
  696. # abind 1.4-5 2016-07-21 [1] CRAN (R 4.3.0)
  697. # AnnotationDbi * 1.64.1 2023-11-02 [1] Bioconductor
  698. # AnnotationHub 3.10.0 2023-10-26 [1] Bioconductor
  699. # ape 5.7-1 2023-03-13 [1] CRAN (R 4.3.0)
  700. # aplot 0.2.2 2023-10-06 [1] CRAN (R 4.3.1)
  701. # Biobase * 2.62.0 2023-10-26 [1] Bioconductor
  702. # BiocFileCache 2.10.1 2023-10-26 [1] Bioconductor
  703. # BiocGenerics * 0.48.1 2023-11-02 [1] Bioconductor
  704. # BiocManager 1.30.22 2023-08-08 [1] CRAN (R 4.3.0)
  705. # BiocParallel 1.36.0 2023-10-26 [1] Bioconductor
  706. # BiocVersion 3.18.1 2023-11-18 [1] Bioconductor 3.18 (R 4.3.2)
  707. # Biostrings 2.70.2 2024-01-30 [1] Bioconductor 3.18 (R 4.3.2)
  708. # bit 4.0.5 2022-11-15 [1] CRAN (R 4.3.0)
  709. # bit64 4.0.5 2020-08-30 [1] CRAN (R 4.3.0)
  710. # bitops 1.0-7 2021-04-24 [1] CRAN (R 4.3.0)
  711. # blob 1.2.4 2023-03-17 [1] CRAN (R 4.3.0)
  712. # cachem 1.0.8 2023-05-01 [1] CRAN (R 4.3.0)
  713. # cli 3.6.2 2023-12-11 [1] CRAN (R 4.3.1)
  714. # clusterProfiler * 4.10.0 2023-11-06 [1] Bioconductor
  715. # codetools 0.2-19 2023-02-01 [1] CRAN (R 4.3.2)
  716. # colorspace 2.1-0 2023-01-23 [1] CRAN (R 4.3.0)
  717. # cowplot 1.1.3 2024-01-22 [1] CRAN (R 4.3.1)
  718. # crayon 1.5.2 2022-09-29 [1] CRAN (R 4.3.0)
  719. # curl 5.2.1 2024-03-01 [1] CRAN (R 4.3.1)
  720. # data.table 1.15.2 2024-02-29 [1] CRAN (R 4.3.1)
  721. # DBI 1.2.2 2024-02-16 [1] CRAN (R 4.3.2)
  722. # dbplyr 2.4.0 2023-10-26 [1] CRAN (R 4.3.1)
  723. # DelayedArray 0.28.0 2023-11-06 [1] Bioconductor
  724. # digest 0.6.34 2024-01-11 [1] CRAN (R 4.3.1)
  725. # DOSE 3.28.2 2023-12-12 [1] Bioconductor 3.18 (R 4.3.2)
  726. # dplyr 1.1.4 2023-11-17 [1] CRAN (R 4.3.1)
  727. # ellipsis 0.3.2 2021-04-29 [1] CRAN (R 4.3.0)
  728. # enrichplot 1.22.0 2023-11-06 [1] Bioconductor
  729. # evaluate 0.23 2023-11-01 [1] CRAN (R 4.3.1)
  730. # fansi 1.0.6 2023-12-08 [1] CRAN (R 4.3.1)
  731. # farver 2.1.1 2022-07-06 [1] CRAN (R 4.3.0)
  732. # fastmap 1.1.1 2023-02-24 [1] CRAN (R 4.3.0)
  733. # fastmatch 1.1-4 2023-08-18 [1] CRAN (R 4.3.0)
  734. # fgsea 1.28.0 2023-10-26 [1] Bioconductor
  735. # filelock 1.0.3 2023-12-11 [1] CRAN (R 4.3.1)
  736. # fs 1.6.3 2023-07-20 [1] CRAN (R 4.3.0)
  737. # generics 0.1.3 2022-07-05 [1] CRAN (R 4.3.0)
  738. # GenomeInfoDb * 1.38.6 2024-02-10 [1] Bioconductor 3.18 (R 4.3.2)
  739. # GenomeInfoDbData 1.2.11 2024-02-17 [1] Bioconductor
  740. # GenomicRanges * 1.54.1 2023-10-30 [1] Bioconductor
  741. # ggforce 0.4.2 2024-02-19 [1] CRAN (R 4.3.1)
  742. # ggfun 0.1.4 2024-01-19 [1] CRAN (R 4.3.1)
  743. # ggplot2 3.5.0 2024-02-23 [1] CRAN (R 4.3.1)
  744. # ggplotify 0.1.2 2023-08-09 [1] CRAN (R 4.3.0)
  745. # ggraph 2.2.0 2024-02-27 [1] CRAN (R 4.3.1)
  746. # ggrepel 0.9.5 2024-01-10 [1] CRAN (R 4.3.1)
  747. # ggtree 3.10.1 2024-02-27 [1] Bioconductor 3.18 (R 4.3.2)
  748. # glue 1.7.0 2024-01-09 [1] CRAN (R 4.3.1)
  749. # GO.db 3.18.0 2024-02-17 [1] Bioconductor
  750. # GOSemSim 2.28.1 2024-01-20 [1] Bioconductor 3.18 (R 4.3.2)
  751. # graphlayouts 1.1.0 2024-01-19 [1] CRAN (R 4.3.1)
  752. # gridExtra 2.3 2017-09-09 [1] CRAN (R 4.3.0)
  753. # gridGraphics 0.5-1 2020-12-13 [1] CRAN (R 4.3.0)
  754. # gson 0.1.0 2023-03-07 [1] CRAN (R 4.3.0)
  755. # gtable 0.3.4 2023-08-21 [1] CRAN (R 4.3.0)
  756. # HDO.db 0.99.1 2023-05-28 [1] Bioconductor
  757. # here * 1.0.1 2020-12-13 [1] CRAN (R 4.3.0)
  758. # htmltools 0.5.7 2023-11-03 [1] CRAN (R 4.3.1)
  759. # httpuv 1.6.14 2024-01-26 [1] CRAN (R 4.3.1)
  760. # httr 1.4.7 2023-08-15 [1] CRAN (R 4.3.0)
  761. # igraph 2.0.2 2024-02-17 [1] CRAN (R 4.3.1)
  762. # interactiveDisplayBase 1.40.0 2023-10-26 [1] Bioconductor
  763. # IRanges * 2.36.0 2023-10-26 [1] Bioconductor
  764. # jsonlite 1.8.8 2023-12-04 [1] CRAN (R 4.3.1)
  765. # KEGGREST 1.42.0 2023-10-26 [1] Bioconductor
  766. # knitr 1.45 2023-10-30 [1] CRAN (R 4.3.1)
  767. # labeling 0.4.3 2023-08-29 [1] CRAN (R 4.3.0)
  768. # later 1.3.2 2023-12-06 [1] CRAN (R 4.3.1)
  769. # lattice 0.22-5 2023-10-24 [1] CRAN (R 4.3.1)
  770. # lazyeval 0.2.2 2019-03-15 [1] CRAN (R 4.3.0)
  771. # lifecycle 1.0.4 2023-11-07 [1] CRAN (R 4.3.1)
  772. # magrittr 2.0.3 2022-03-30 [1] CRAN (R 4.3.0)
  773. # MASS 7.3-60.0.1 2024-01-13 [1] CRAN (R 4.3.1)
  774. # Matrix 1.6-5 2024-01-11 [1] CRAN (R 4.3.1)
  775. # MatrixGenerics * 1.14.0 2023-10-26 [1] Bioconductor
  776. # matrixStats * 1.2.0 2023-12-11 [1] CRAN (R 4.3.1)
  777. # memoise 2.0.1 2021-11-26 [1] CRAN (R 4.3.0)
  778. # mime 0.12 2021-09-28 [1] CRAN (R 4.3.0)
  779. # munsell 0.5.0 2018-06-12 [1] CRAN (R 4.3.0)
  780. # nlme 3.1-164 2023-11-27 [1] CRAN (R 4.3.1)
  781. # org.Rn.eg.db * 3.18.0 2024-02-17 [1] Bioconductor
  782. # patchwork 1.2.0 2024-01-08 [1] CRAN (R 4.3.1)
  783. # pillar 1.9.0 2023-03-22 [1] CRAN (R 4.3.0)
  784. # pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.3.0)
  785. # plyr 1.8.9 2023-10-02 [1] CRAN (R 4.3.1)
  786. # png 0.1-8 2022-11-29 [1] CRAN (R 4.3.0)
  787. # polyclip 1.10-6 2023-09-27 [1] CRAN (R 4.3.1)
  788. # promises 1.2.1 2023-08-10 [1] CRAN (R 4.3.0)
  789. # purrr 1.0.2 2023-08-10 [1] CRAN (R 4.3.0)
  790. # qvalue 2.34.0 2023-10-26 [1] Bioconductor
  791. # R6 2.5.1 2021-08-19 [1] CRAN (R 4.3.0)
  792. # rappdirs 0.3.3 2021-01-31 [1] CRAN (R 4.3.0)
  793. # RColorBrewer 1.1-3 2022-04-03 [1] CRAN (R 4.3.0)
  794. # Rcpp 1.0.12 2024-01-09 [1] CRAN (R 4.3.1)
  795. # RCurl 1.98-1.14 2024-01-09 [1] CRAN (R 4.3.1)
  796. # reshape2 1.4.4 2020-04-09 [1] CRAN (R 4.3.0)
  797. # rlang 1.1.3 2024-01-10 [1] CRAN (R 4.3.1)
  798. # rmarkdown 2.26 2024-03-05 [1] CRAN (R 4.3.1)
  799. # rprojroot 2.0.4 2023-11-05 [1] CRAN (R 4.3.1)
  800. # RSQLite 2.3.5 2024-01-21 [1] CRAN (R 4.3.1)
  801. # rstudioapi 0.15.0 2023-07-07 [1] CRAN (R 4.3.0)
  802. # S4Arrays 1.2.0 2023-10-26 [1] Bioconductor
  803. # S4Vectors * 0.40.2 2023-11-25 [1] Bioconductor 3.18 (R 4.3.2)
  804. # scales 1.3.0 2023-11-28 [1] CRAN (R 4.3.1)
  805. # scatterpie 0.2.1 2023-06-07 [1] CRAN (R 4.3.0)
  806. # sessioninfo * 1.2.2 2021-12-06 [1] CRAN (R 4.3.0)
  807. # shadowtext 0.1.3 2024-01-19 [1] CRAN (R 4.3.1)
  808. # shiny 1.8.0 2023-11-17 [1] CRAN (R 4.3.1)
  809. # SparseArray 1.2.4 2024-02-10 [1] Bioconductor 3.18 (R 4.3.2)
  810. # stringi 1.8.3 2023-12-11 [1] CRAN (R 4.3.1)
  811. # stringr 1.5.1 2023-11-14 [1] CRAN (R 4.3.1)
  812. # SummarizedExperiment * 1.32.0 2023-11-06 [1] Bioconductor
  813. # tibble 3.2.1 2023-03-20 [1] CRAN (R 4.3.0)
  814. # tidygraph 1.3.1 2024-01-30 [1] CRAN (R 4.3.1)
  815. # tidyr 1.3.1 2024-01-24 [1] CRAN (R 4.3.1)
  816. # tidyselect 1.2.0 2022-10-10 [1] CRAN (R 4.3.0)
  817. # tidytree 0.4.6 2023-12-12 [1] CRAN (R 4.3.1)
  818. # treeio 1.26.0 2023-11-06 [1] Bioconductor
  819. # tweenr 2.0.3 2024-02-26 [1] CRAN (R 4.3.1)
  820. # utf8 1.2.4 2023-10-22 [1] CRAN (R 4.3.1)
  821. # vctrs 0.6.5 2023-12-01 [1] CRAN (R 4.3.1)
  822. # viridis 0.6.5 2024-01-29 [1] CRAN (R 4.3.1)
  823. # viridisLite 0.4.2 2023-05-02 [1] CRAN (R 4.3.0)
  824. # withr 3.0.0 2024-01-16 [1] CRAN (R 4.3.1)
  825. # xfun 0.42 2024-02-08 [1] CRAN (R 4.3.1)
  826. # xtable 1.8-4 2019-04-21 [1] CRAN (R 4.3.0)
  827. # XVector 0.42.0 2023-10-26 [1] Bioconductor
  828. # yaml 2.3.8 2023-12-11 [1] CRAN (R 4.3.1)
  829. # yulab.utils 0.1.4 2024-01-28 [1] CRAN (R 4.3.1)
  830. # zlibbioc 1.48.0 2023-10-26 [1] Bioconductor
  831. #
  832. # [1] /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library
  833. #
  834. # ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

01_GO_KEGG_Analyses.R at commit 4284eba, under MIT · at the source

Overview

  1. Department of Psychological and Brain Sciences, Krieger School of Arts and Sciences, Johns Hopkins University, Baltimore, Maryland, USA
  2. Lieber Institute for Brain Development, Johns Hopkins Medical Campus, Baltimore, Maryland, USA
  3. Department of Psychiatry and Behavioral Sciences, Johns Hopkins School of Medicine, Baltimore, Maryland, USA
  4. The Solomon H. Snyder Department of Neuroscience, Johns Hopkins School of Medicine, Baltimore, Maryland, USA
  5. Medical Scientist Training Program, Johns Hopkins University School of Medicine, Baltimore, Maryland, USA
  6. Department of Biostatistics, Johns Hopkins Bloomberg School of Public Health, Baltimore, Maryland, USA
  7. Kavli Neuroscience Discovery Institute, Johns Hopkins University, Baltimore, Maryland, USA
  8. Center for Computational Biology, Johns Hopkins University, Baltimore, Maryland, USA
Institutions: Johns Hopkins University (United States); Lieber Institute for Brain Development (United States); Johns Hopkins Medicine (United States)
Journal: Addiction biology, volume 31, issue 7, article e70179
Dates: received 25 January 2026; accepted 24 June 2026; published online 14 July 2026; in print July 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1111/adb.70179 · PMID 42444546 · PMCID PMC13366401 · OpenAlex W4417361577
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: genetics / omics (modality), human (organism), rat (organism), other condition (population), pain (population), cellular / molecular (subfield)
Methods: Statistics, Smoothing, state filtering, decompositions
MeSH: Amygdala*, Analgesics, Opioid*, Fentanyl*, Habenula*, Transcriptome*, Animals, Gene Expression Profiling, Male, Rats, Rats, Sprague-Dawley, Self Administration (* major topic)
Topic: Neurogenesis and neuroplasticity mechanisms (Developmental Neuroscience, Neuroscience), according to OpenAlex
Funding: NIDA NIH HHS (R01 DA035943, R21 DA060407); NIH HHS (R01DA035943, T32MH015330, R21DA060407); National Institutes of Health (T32MH015330, R01DA035943, R21DA060407); NIMH NIH HHS (T32 MH015330); Lieber Institute for Brain Development
Citations: cited by 1 paper (Europe PMC); 104 references in the paper

Abstract

Fentanyl is a potent synthetic opioid associated with overdose. However, little is known about fentanyl‐induced molecular adaptations in the habenula and amygdala, two brain regions implicated in opioid use and withdrawal. We performed bulk RNA‐sequencing in the rat habenula and amygdala to identify transcriptomic changes associated with fentanyl intake. Male rats self‐administered intravenous saline or fentanyl over 22–24 days. Ninety minutes following the final session, brains were collected for transcriptomic profiling. In Hb, we identified 453 differentially expressed genes (DEGs) between saline and fentanyl rats, with upregulated genes associated with synaptic transmission and ionic conductance. In the amygdala, we identified 3041 fentanyl‐associated DEGs with upregulated genes implicated in metabolic and vesicular functions. Downregulated genes in both regions were enriched for extracellular matrix functions. Integration of DEGs with single‐cell RNA‐sequencing data from rodents and humans revealed that fentanyl DEGs were enriched in specific habenula and amygdala cell type markers. Furthermore, fentanyl downregulated DEGs in the amygdala were enriched in genes associated with the risk for substance use disorders. Together, we define how fentanyl intake alters transcriptional programs in the rat habenula and amygdala, and we link these changes to specific human cell types and risk genes for neuropsychiatric disorders and addiction.

Reproduced under the paper's license (CC BY), from the paper cited above.

Repositories

Its files are read in the Code ↔ Paper reader above, with 12 matches between paragraphs and lines of code.

LieberInstitute/fentanyl_rat_hb_amy

License: MIT
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: 4284ebac39e53fe23aea2a23812dc71441c14e10, 15 July 2026
Languages: R (17), Shell (9)
Size: 489 files, 26 scripts
Software Heritage: not archived
Found in: “Data Availability Statement”
Holds: README
Not found: license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: cowplot (9 files), ggplot2 (9 files), tidyverse (9 files), ComplexHeatmap (3 files), edgeR (2 files), pheatmap (2 files), circlize (1 file), clusterProfiler (1 file), data.table (1 file), limma (1 file), lme4 (1 file), Nextflow (1 file), reshape2 (1 file), rstatix (1 file), Seurat (1 file), SingleCellExperiment (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
27 files

Zenodo 17573970

License: CC-BY-4.0
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Size: 1 file
Software Heritage: not checked
Found in: the references
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
  • 27 September 2026: the link answers (HTTP 200)
At the source:

The paper's code and data availability statement is in the Data section.

Tracing map

Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.

What the map holds:

  • 2 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 26 scripts, each with its path and the digest of its content;
  • 12 matches between paragraphs of the paper and lines of the code (method lexical-v1);
  • neither the text of the paper nor the code itself.

Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.

Data

No dataset and no data link were found in the paper.

Data Availability Statement

The source FASTQ files are publicly available from the NCBI Sequence Read Archive BioProject PRJNA1179901. All analysis code is available at https://github.com/LieberInstitute/fentanyl_rat_hb_amy [104].

Reproduced under the paper's license (CC BY), from the paper cited above.

Versions

The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.

Version 2, 28 September 2026

  • Authors: added Ege A Yalcinbas (0000-0002-9480-7192); Emma Chaloux‐Pinette (0000-0002-6832-6862); Nicholas J Eagles (0000-0002-9808-5254); Michael S Totty (0000-0002-9292-8556); Patricia H Janak (0000-0002-3333-9049); Kristen R Maynard (0000-0003-0031-8468); removed Ege A Yalcinbas; Emma Chaloux‐Pinette; Nicholas J Eagles; Michael S Totty; Patricia H Janak; Kristen R Maynard

Version 1, 27 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 9 authors, 11 MeSH terms, 5 funders, 103 references.

Cite

This paper

Magnard, R., Gonzalez‐Padilla, D., Yalcinbas, E. A., Chaloux‐Pinette, E., Eagles, N. J., Totty, M. S., Janak, P. H., Collado‐Torres, L., & Maynard, K. R. (2026). Transcriptional Response to Chronic Long-Access Fentanyl Self-Administration in Rat Habenula and Amygdala. Addiction biology, 31(7), e70179. https://doi.org/10.1111/adb.70179

BibTeX

@article{magnard2026transcriptional,
author = {Magnard, Robin and Gonzalez‐Padilla, Daianna and Yalcinbas, Ege A and Chaloux‐Pinette, Emma and Eagles, Nicholas J and Totty, Michael S and Janak, Patricia H and Collado‐Torres, Leonardo and Maynard, Kristen R},
title = {{Transcriptional Response to Chronic Long-Access Fentanyl Self-Administration in Rat Habenula and Amygdala}},
journal = {Addiction biology},
year = {2026},
month = jul,
volume = {31},
number = {7},
pages = {e70179},
publisher = {Wiley},
issn = {1355-6215},
doi = {10.1111/adb.70179},
url = {https://doi.org/10.1111/adb.70179},
pmid = {42444546},
pmcid = {PMC13366401}
}

RIS

TY - JOUR
AU - Magnard, Robin
AU - Gonzalez‐Padilla, Daianna
AU - Yalcinbas, Ege A
AU - Chaloux‐Pinette, Emma
AU - Eagles, Nicholas J
AU - Totty, Michael S
AU - Janak, Patricia H
AU - Collado‐Torres, Leonardo
AU - Maynard, Kristen R
TI - Transcriptional Response to Chronic Long-Access Fentanyl Self-Administration in Rat Habenula and Amygdala
T2 - Addiction biology
J2 - Addict Biol
PY - 2026
DA - 2026/07/01
VL - 31
IS - 7
SP - e70179
SN - 1355-6215
PB - Wiley
DO - 10.1111/adb.70179
UR - https://doi.org/10.1111/adb.70179
LA - en
ER -

CSL-JSON

{
"id": "10.1111/adb.70179",
"type": "article-journal",
"title": "Transcriptional Response to Chronic Long-Access Fentanyl Self-Administration in Rat Habenula and Amygdala",
"container-title": "Addiction biology",
"author": [
{
"family": "Magnard",
"given": "Robin"
},
{
"family": "Gonzalez‐Padilla",
"given": "Daianna"
},
{
"family": "Yalcinbas",
"given": "Ege A"
},
{
"family": "Chaloux‐Pinette",
"given": "Emma"
},
{
"family": "Eagles",
"given": "Nicholas J"
},
{
"family": "Totty",
"given": "Michael S"
},
{
"family": "Janak",
"given": "Patricia H"
},
{
"family": "Collado‐Torres",
"given": "Leonardo"
},
{
"family": "Maynard",
"given": "Kristen R"
}
],
"container-title-short": "Addict Biol",
"volume": "31",
"issue": "7",
"page": "e70179",
"DOI": "10.1111/adb.70179",
"PMID": "42444546",
"PMCID": "PMC13366401",
"ISSN": "1355-6215",
"publisher": "Wiley",
"URL": "https://doi.org/10.1111/adb.70179",
"language": "en",
"issued": {
"date-parts": [
[
2026,
7,
1
]
]
}
}

The tracing map gets a citation of its own once an author has validated it and it has a DOI.

Similar papers

The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.

[1] doi:10.1016/j.xcrm.2026.102682 [code]
TET CpG sequence-context-specific DNA demethylation shapes progression of IDH-mutant gliomas.
Journal: Cell reports. Medicine
In common: Nextflow, edgeR, limma, 11 other tools, genetics / omics, other condition
[2] doi:10.1016/j.xcrm.2026.102766 [code]
A longitudinal single-cell and spatial multiomic atlas of pediatric high-grade glioma.
Journal: Cell reports. Medicine
In common: SingleCellExperiment, edgeR, limma, 11 other tools, genetics / omics, other condition, cellular / molecular
[3] doi:10.1002/imt2.70163 [code]
Spatial multi-omics unveils sphingolipid metabolic reprogramming within the retinal pathological niche.
Journal: iMeta
In common: SingleCellExperiment, edgeR, limma, 11 other tools, genetics / omics, cellular / molecular
[4] doi:10.1093/bioinformatics/btag592 [code]
Network-based stratification of allele-specific expression reveals patient subgroups in Huntington's disease.
Journal: Bioinformatics (Oxford, England)
In common: edgeR, limma, rstatix, 10 other tools, genetics / omics, other condition, 1 reference
[5] doi:10.1038/s41467-026-71542-5 [code]
Astrocyte fatty acid metabolism as a driver of risk for major depressive disorder.
Journal: Nature communications
In common: SingleCellExperiment, edgeR, limma, 7 other tools, genetics / omics, cellular / molecular, 4 references
[6] doi:10.1038/s41593-026-02367-0 [code]
A reproducible three-dimensional model of human brain tissue to investigate physiological and disease-associated microglia phenotypes.
Journal: Nature neuroscience
In common: SingleCellExperiment, edgeR, limma, 10 other tools, cellular / molecular
[7] doi:10.1038/s41467-026-75723-0 [code]
Spatial transcriptomics reveals distinct cell type dynamics following opioid dependence in female mice with the common human μ-opioid receptor variant Oprm1 A118G.
Journal: Nature communications
In common: clusterProfiler, pheatmap, Seurat, 3 other tools, pain, genetics / omics, other condition, 1 other category, 6 references
[8] doi:10.1038/s41586-026-10214-2 [code]
Multidimensional profiling of heterogeneity in supratentorial ependymomas.
Journal: Nature
In common: SingleCellExperiment, edgeR, circlize, 9 other tools, genetics / omics, other condition
[9] doi:10.1038/s42003-026-10034-0 [code]
Region- and cell type-specific changes in gene expression in the cerebellum after classical fear conditioning.
Journal: Communications biology
In common: SingleCellExperiment, limma, rstatix, 9 other tools, genetics / omics, cellular / molecular
[10] doi:10.1038/s41467-026-73305-8 [code]
Comparative analysis of the cellular landscape in mammalian striatum.
Journal: Nature communications
In common: SingleCellExperiment, edgeR, clusterProfiler, 8 other tools, genetics / omics, cellular / molecular, 1 reference

Contribute

The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.

Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.

Request its removal

To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).

Discussion, reproductions, activity

Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.

Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.

Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.