OSCR

Postmortem brain single-nucleus and bulk gene expression analyses identify shared and distinct abnormalities in bipolar disorder and major depressive disorder.

Code ↔ Paper

7 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 7 matches
  1. [1] § Results › Consistency with results from snRNA-seq of the dlPFC ↔ HBCC_03_cellchat.R, lines 62–122 · score 0.95 · en l6 ct, EN_L6B, lamp5 lhx6, lamp5 reln, pvalb chc, en l2
  2. [2] § Results › Consistency with results from snRNA-seq of the dlPFC ↔ HBCC_01_preprocessing.R, lines 238–299 · score 0.95 · en l6 ct, EN_L6B, lamp5 lhx6, lamp5 reln, pvalb chc, en l2
  3. [3] § Results › Single-nucleus transcriptomic profiling and cell population of case and controls in the OFC ↔ OFCsnRNA_01_preprocessing.R, lines 401–478 · score 0.95 · ExN.L5ET, ExN.L2, ExN.L3, ExN.L6CT, ExN.L6IT, InN.Lamp5
  4. [4] § Results › Transcription factor network analysis reveals key regulatory relationships ↔ OFCsnRNA_05_hdWGCNA_mdd_bd_ExN.R, lines 307–367 · score 0.83 · regulon score, BCL11A, POU6F2, CREM, ETS2, FOXP2
  5. [5] § Results › Co-expression modules associated with translation and mitochondrial ATP production in neurons contribute to BD ↔ OFCsnRNA_05_hdWGCNA_mdd_bd_ExN.R, lines 183–241 · score 0.63 · module trait correlation, biological processes, component, cellular, RNA, Classification
  6. [6] § Materials and methods › Differential abundance (DA) analysis ↔ OFCsnRNA_02_subtype_milo.R, lines 1–82 · score 0.54 · sub clusters, single cell, DA, graphs
  7. [7] § Results › Dysfunction of parvalbumin interneurons and hyperactivity of excitatory neurons in BD and MDD ↔ OFCsnRNA_04_cellchat_bd_mdd.R, lines 61–118 · score 0.51 · ExN.L5, InN.Pvalb, Ch, Ba, signaling, pathways

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 · 605 lines · 18 KB · no license · 2 matches

  1. setwd("")
  2. library(Seurat)
  3. library(tidyverse)
  4. library(cowplot)
  5. library(patchwork)
  6. library(WGCNA)
  7. library(hdWGCNA)
  8. theme_set(theme_cowplot())
  9. set.seed(12345)
  10. enableWGCNAThreads(nThreads = 8)
  11. seurat_obj <- readRDS("")
  12. seurat_obj <- SetupForWGCNA(seurat_obj, gene_select = "fraction", fraction = 0.05, wgcna_name = "exp_sc")
  13. seurat_obj <- MetacellsByGroups(seurat_obj = seurat_obj, group.by = c("cell_type_1", "Donor"), k = 25, max_shared = 10, ident.group = "cell_type_1")
  14. seurat_obj <- NormalizeMetacells(seurat_obj)
  15. seurat_obj <- SetDatExpr(seurat_obj, group_name = "ExN", group.by = "cell_type_1", assay = 'RNA', layer = 'data')
  16. seurat_obj <- TestSoftPowers(seurat_obj, networkType = 'signed')
  17. plot_list <- PlotSoftPowers(seurat_obj)
  18. wrap_plots(plot_list, ncol=2)
  19. power_table <- GetPowerTable(seurat_obj)
  20. head(power_table)
  21. seurat_obj <- ConstructNetwork(seurat_obj, tom_name = "ExN")
  22. pdf()
  23. PlotDendrogram(seurat_obj, main = 'hdWGCNA Dendrogram')
  24. dev.off()
  25. seurat_obj <- ScaleData(seurat_obj, features = VariableFeatures(seurat_obj))
  26. seurat_obj <- ModuleEigengenes(seurat_obj, group.by.vars = "Donor")
  27. hMEs <- GetMEs(seurat_obj, harmonized = TRUE)
  28. seurat_obj <- ModuleConnectivity(seurat_obj , group.by = "cell_type_1", group_name = "ExN")
  29. seurat_obj <- ResetModuleNames(seurat_obj, new_name = "M")
  30. pdf()
  31. PlotKMEs(seurat_obj, text_size = 3, ncol = 3)
  32. dev.off()
  33. modules <- GetModules(seurat_obj) %>% subset(module != 'grey')
  34. head(modules[,1:6])
  35. hub_df <- GetHubGenes(seurat_obj, n_hubs = 10)
  36. head(hub_df)
  37. saveRDS(seurat_obj, file = "")
  38. library(UCell)
  39. seurat_obj <- ModuleExprScore(seurat_obj, n_genes = 20, method = 'UCell')
  40. plot_list <- ModuleFeaturePlot(seurat_obj, features = "hMEs", order = TRUE)
  41. pdf()
  42. wrap_plots(plot_list, ncol = 4)
  43. dev.off()
  44. plot_list <- ModuleFeaturePlot(seurat_obj, features = 'scores', order = 'shuffle', ucell = TRUE)
  45. pdf()
  46. wrap_plots(plot_list, ncol = 4)
  47. dev.off()
  48. pdf()
  49. ModuleCorrelogram(seurat_obj)
  50. dev.off()
  51. hMEs <- GetMEs(seurat_obj, harmonized = TRUE)
  52. modules <- GetModules(seurat_obj)
  53. mods <- levels(modules$module); mods <- mods[mods != 'grey']
  54. [email hidden] <- cbind([email hidden], hMEs)
  55. p <- DotPlot(seurat_obj, features = mods, group.by = "cell_type_2")
  56. p <- p +
  57. RotatedAxis() +
  58. scale_color_gradient2(high='red', mid='grey95', low='blue')
  59. print(p)
  60. ggsave()
  61. group1 <- [email hidden] %>% subset(cell_type_1 == "ExN" & Classification == "BD") %>% rownames
  62. group2 <- [email hidden] %>% subset(cell_type_1 == "ExN" & Classification == "MDD") %>% rownames
  63. DMEs <- FindDMEs(seurat_obj, barcodes1 = group1, barcodes2 = group2, test.use = 'wilcox', wgcna_name = "exp_sc")
  64. head(DMEs)
  65. PlotDMEsLollipop(seurat_obj, DMEs, wgcna_name = "exp_sc", pvalue = "p_val_adj")
  66. pdf()
  67. PlotDMEsLollipop(seurat_obj, DMEs, wgcna_name = "exp_sc", pvalue = "p_val_adj")
  68. dev.off()
  69. clusters <- c("ExN.L2-3IT", "ExN.L3-5IT", "ExN.L6IT", "ExN.L5-6NP", "ExN.L6CT", "ExN.L5ET",
  70. "InN.Lamp5", "InN.Sncg", "InN.Vip", "InN.Sst", "InN.Pvalb-Ba", "InN.Pvalb-Ch",
  71. "Ast", "Mic", "Oli", "OPC", "End")
  72. clusters <- factor(clusters,
  73. levels = c("ExN.L2-3IT", "ExN.L3-5IT", "ExN.L6IT", "ExN.L5-6NP", "ExN.L6CT", "ExN.L5ET",
  74. "InN.Lamp5", "InN.Sncg", "InN.Vip", "InN.Sst", "InN.Pvalb-Ba", "InN.Pvalb-Ch",
  75. "Ast", "Mic", "Oli", "OPC", "End"))
  76. DMEs <- data.frame()
  77. for(cur_cluster in clusters){
  78. group1 <- [email hidden] %>% subset(cell_type_2 == cur_cluster & Classification == "BD") %>% rownames
  79. group2 <- [email hidden] %>% subset(cell_type_2 == cur_cluster & Classification == "MDD") %>% rownames
  80. cur_DMEs <- FindDMEs(seurat_obj, barcodes1 = group1, barcodes2 = group2, test.use = 'wilcox', pseudocount.use = 0.01, wgcna_name = "exp_sc")
  81. cur_DMEs$cluster <- cur_cluster
  82. DMEs <- rbind(DMEs, cur_DMEs)
  83. }
  84. modules <- GetModules(seurat_obj)
  85. mods <- levels(modules$module); mods <- mods[mods != 'grey']
  86. plot_df <- DMEs
  87. plot_df$module <- factor(as.character(plot_df$module), levels=mods)
  88. plot_df$cluster <- factor(plot_df$cluster,
  89. levels = c("ExN.L2-3IT", "ExN.L3-5IT", "ExN.L6IT", "ExN.L5-6NP", "ExN.L6CT", "ExN.L5ET",
  90. "InN.Lamp5", "InN.Sncg", "InN.Vip", "InN.Sst", "InN.Pvalb-Ba", "InN.Pvalb-Ch",
  91. "Ast", "Mic", "Oli", "OPC", "End"))
  92. maxval <- 2; minval <- -2
  93. plot_df$avg_log2FC <- ifelse(plot_df$avg_log2FC > maxval, maxval, plot_df$avg_log2FC)
  94. plot_df$avg_log2FC <- ifelse(plot_df$avg_log2FC < minval, minval, plot_df$avg_log2FC)
  95. plot_df$Significance <- gtools::stars.pval(plot_df$p_val_adj)
  96. plot_df$textcolor <- ifelse(abs(plot_df$avg_log2FC) > 1, "white", "black")
  97. p <- plot_df %>%
  98. ggplot(aes(y=cluster, x=module, fill=avg_log2FC)) +
  99. geom_tile()
  100. p <- p +
  101. geom_text(label=plot_df$Significance, color=plot_df$textcolor)
  102. p <- p +
  103. scale_fill_gradient2(low = "dodgerblue4", mid = "gray90", high = "brown") +
  104. RotatedAxis() +
  105. theme(
  106. panel.border = element_rect(fill=NA, color='black', size=1),
  107. axis.line.x = element_blank(),
  108. axis.line.y = element_blank(),
  109. plot.margin = margin(0,0,0,0)
  110. ) + xlab('') + ylab('') +
  111. coord_equal()
  112. print(p)
  113. ggsave()
  114. cur_traits <- c("Classification", "Age", "Sex", "PMI", "Brain.pH", "RIN")
  115. seurat_obj <- ModuleTraitCorrelation(
  116. seurat_obj,
  117. traits = cur_traits,
  118. group.by = "cell_type_2"
  119. )
  120. mt_cor <- GetModuleTraitCorrelation(seurat_obj)
  121. pdf()
  122. PlotModuleTraitCorrelation(
  123. seurat_obj, label = 'fdr', label_symbol = 'stars',
  124. text_size = 2, text_digits = 2,
  125. text_color = "black", high_color = "gold3", mid_color = "gray90", low_color = "skyblue3",
  126. plot_max = 0.4, combine=TRUE)
  127. dev.off()
  128. library(enrichR)
  129. library(GeneOverlap)
  130. theme_set(theme_cowplot())
  131. set.seed(12345)
  132. dbs <- c('GO_Biological_Process_2023','GO_Cellular_Component_2023','GO_Molecular_Function_2023')
  133. seurat_obj <- RunEnrichr(seurat_obj, dbs=dbs, max_genes = Inf)
  134. enrich_df <- GetEnrichrTable(seurat_obj)
  135. head(enrich_df)
  136. EnrichrBarPlot(seurat_obj, outdir = "enrichr_plots", n_terms = 10, plot_size = c(5,7), logscale=TRUE)
  137. pdf()
  138. EnrichrDotPlot(seurat_obj,
  139. mods = "all", database = "GO_Biological_Process_2023", n_terms = 4, term_size = 8, p_adj = FALSE
  140. ) + scale_color_stepsn(colors=rev(viridis::magma(256)))
  141. dev.off()
  142. seurat_ref <- readRDS("")
  143. seurat_query <- readRDS("")
  144. seurat_query <- subset(seurat_query, Classification == "CTRL")
  145. seurat_query <- ProjectModules(seurat_obj = seurat_query, seurat_ref = seurat_ref, wgcna_name = "exp_sc", wgcna_name_proj = "projected", assay = "RNA")
  146. seurat_query <- MetacellsByGroups(seurat_obj = seurat_query, group.by = c("cell_type_1", "Donor"), k = 25, max_shared = 10, ident.group = "cell_type_1")
  147. seurat_query <- NormalizeMetacells(seurat_query)
  148. seurat_ref <- SetDatExpr(seurat_ref, group_name = "ExN", group.by = "cell_type_1")
  149. seurat_query <- SetDatExpr(seurat_query, group_name = "ExN", group.by = "cell_type_1")
  150. seurat_query <- ModulePreservation(seurat_query, seurat_ref = seurat_ref, name = "CTRL_ExN", verbose = 3, n_permutations = 200)
  151. saveRDS(seurat_query, file = "")
  152. plot_list <- PlotModulePreservation(seurat_query, name = "CTRL_ExN", statistics = "summary")
  153. pdf()
  154. wrap_plots(plot_list, ncol=2)
  155. dev.off()
  156. plot_list <- PlotModulePreservation(seurat_query, name = "CTRL_ExN", statistics = "rank")
  157. pdf()
  158. wrap_plots(plot_list, ncol=2)
  159. dev.off()
  160. library(Seurat)
  161. library(tidyverse)
  162. library(cowplot)
  163. library(patchwork)
  164. library(magrittr)
  165. library(WGCNA)
  166. library(hdWGCNA)
  167. library(igraph)
  168. library(motifmatchr)
  169. library(TFBSTools)
  170. library(EnsDb.Hsapiens.v86)
  171. library(BSgenome.Hsapiens.UCSC.hg38)
  172. library(GenomicRanges)
  173. library(xgboost)
  174. theme_set(theme_cowplot())
  175. set.seed(12345)
  176. seurat_obj <- readRDS("")
  177. library(JASPAR2024)
  178. library(RSQLite)
  179. library(EnsDb.Hsapiens.v86)
  180. JASPAR2024 <- JASPAR2024()
  181. sq24 <- RSQLite::dbConnect(RSQLite::SQLite(), db(JASPAR2024))
  182. pfm_core <- TFBSTools::getMatrixSet(x = sq24, opts = list(collection = "CORE", tax_group = 'vertebrates', all_versions = FALSE))
  183. seurat_obj <- MotifScan(seurat_obj, species_genome = 'hg38', pfm = pfm_core, EnsDb = EnsDb.Hsapiens.v86)
  184. motif_df <- GetMotifs(seurat_obj)
  185. tf_genes <- unique(motif_df$gene_name)
  186. modules <- GetModules(seurat_obj)
  187. nongrey_genes <- subset(modules, module != 'grey') %>% .$gene_name
  188. genes_use <- c(tf_genes, nongrey_genes)
  189. seurat_obj <- SetWGCNAGenes(seurat_obj, genes_use)
  190. seurat_obj <- SetDatExpr(seurat_obj, group_name = "ExN", group.by = "cell_type_1")
  191. model_params <- list(objective = 'reg:squarederror', max_depth = 1, eta = 0.1, nthread = 24, alpha = 0.5)
  192. seurat_obj <- ConstructTFNetwork(seurat_obj, model_params)
  193. seurat_obj <- AssignTFRegulons(seurat_obj, strategy = "A", reg_thresh = 0.01, n_tfs = 10)
  194. saveRDS(seurat_obj, file = "")
  195. tf_regulons <- GetTFRegulons(seurat_obj)
  196. hub_df <- GetHubGenes(seurat_obj, n_hubs = 10) %>%
  197. subset(gene_name %in% tf_regulons$tf)
  198. Idents(seurat_obj) <- seurat_obj$cell_type_1
  199. marker_tfs <- FindAllMarkers(
  200. seurat_obj,
  201. features = unique(tf_regulons$tf)
  202. )
  203. top_tfs <- marker_tfs %>% subset(cluster == "ExN") %>%
  204. slice_max(n = 80, order_by = avg_log2FC)
  205. intersect(top_tfs$gene, hub_df$gene_name)
  206. tf_for_plot <- c("FOXP2", "RORB", "CUX2", "POU6F2", "PKNOX2", "BCL11A",
  207. "BHLHE40", "ETS2", "CREM", "E2F3", "ZNF675", "PPARG")
  208. for (tf in tf_for_plot) {
  209. p <- RegulonBarPlot(seurat_obj, selected_tf = tf, cutoff = 0.25)
  210. print(p)
  211. ggsave()
  212. }
  213. seurat_obj <- RegulonScores(seurat_obj, target_type = 'positive', cor_thresh = 0.05, ncores = 16)
  214. seurat_obj <- RegulonScores(seurat_obj, target_type = 'negative', cor_thresh = -0.05, ncores = 16)
  215. pos_regulon_scores <- GetRegulonScores(seurat_obj, target_type='positive')
  216. neg_regulon_scores <- GetRegulonScores(seurat_obj, target_type='negative')
  217. tf_for_plot <- c("FOXP2", "RORB", "CUX2", "POU6F2", "PKNOX2", "BCL11A",
  218. "BHLHE40", "ETS2", "CREM", "E2F3", "ZNF675", "PPARG")
  219. for (tf in tf_for_plot) {
  220. cur_tf <- tf
  221. seurat_obj$pos_regulon_score <- pos_regulon_scores[,cur_tf]
  222. seurat_obj$neg_regulon_score <- neg_regulon_scores[,cur_tf]
  223. p1 <- FeaturePlot(seurat_obj, feature = cur_tf) + umap_theme()
  224. p2 <- FeaturePlot(seurat_obj, feature = 'pos_regulon_score', cols = c('lightgrey', 'red')) + umap_theme()
  225. p3 <- FeaturePlot(seurat_obj, feature = 'neg_regulon_score', cols = c('lightgrey', 'seagreen')) + umap_theme()
  226. p <- p1 | p2 | p3
  227. print(p)
  228. ggsave()
  229. }
  230. tf_for_plot <- c("FOXP2", "RORB", "CUX2", "POU6F2", "PKNOX2", "BCL11A",
  231. "BHLHE40", "ETS2", "CREM", "E2F3", "ZNF675", "PPARG")
  232. for (tf in tf_for_plot) {
  233. cur_tf <- tf
  234. p1 <- TFNetworkPlot(
  235. seurat_obj, selected_tfs = cur_tf,
  236. target_type = 'positive',
  237. label_TFs = 1, depth = 2, cutoff = 0.05
  238. ) + ggtitle(paste0("Positive targets of ", cur_tf)) +
  239. theme(plot.title = element_text(hjust = 0.5))
  240. p2 <- TFNetworkPlot(
  241. seurat_obj, selected_tfs = cur_tf,
  242. target_type = 'negative',
  243. label_TFs = 1, depth = 2, cutoff = 0.05
  244. ) + ggtitle(paste0("Negative targets of ", cur_tf)) +
  245. theme(plot.title = element_text(hjust = 0.5))
  246. p3 <- TFNetworkPlot(
  247. seurat_obj, selected_tfs = cur_tf,
  248. target_type = 'both',
  249. label_TFs = 1, depth = 2, cutoff = 0.05
  250. ) + ggtitle(paste0("Pos & Neg targets of ", cur_tf)) +
  251. theme(plot.title = element_text(hjust = 0.5))
  252. p <- p1 | p2 | p3
  253. print(p)
  254. ggsave()
  255. }
  256. group1 <- [email hidden] %>% subset(cell_type_1 == "ExN" & Classification == "BD") %>% rownames
  257. group2 <- [email hidden] %>% subset(cell_type_1 == "ExN" & Classification == "MDD") %>% rownames
  258. dregs <- FindDifferentialRegulons(seurat_obj, barcodes1 = group1, barcodes2 = group2)
  259. p <- PlotDifferentialRegulons(seurat_obj, dregs)
  260. print(p)
  261. ggsave()
  262. seurat_obj <- RunModuleUMAP(seurat_obj, n_hubs = 10, n_neighbors = 15, min_dist = 0.1)
  263. tf_for_plot <- c("FOXP2", "RORB", "CUX2", "POU6F2", "PKNOX2", "BCL11A",
  264. "BHLHE40", "ETS2", "CREM", "E2F3", "ZNF675", "PPARG")
  265. for (tf in tf_for_plot) {
  266. cur_tf <- tf
  267. modules <- GetModules(seurat_obj)
  268. umap_df <- GetModuleUMAP(seurat_obj)
  269. mods <- levels(modules$module)
  270. mod_colors <- dplyr::select(modules, c(module, color)) %>%
  271. distinct %>% arrange(module) %>% .$color
  272. cp <- mod_colors; names(cp) <- mods
  273. hub_df <- GetHubGenes(seurat_obj, n_hubs=10)
  274. tf_net <- GetTFNetwork(seurat_obj)
  275. tf_regulons <- GetTFRegulons(seurat_obj) %>%
  276. subset(gene %in% umap_df$gene & tf %in% umap_df$gene)
  277. all(tf_regulons$gene %in% umap_df$gene)
  278. cur_network <- GetTFTargetGenes(
  279. seurat_obj,
  280. selected_tfs=cur_tf,
  281. depth=2,
  282. target_type='both'
  283. ) %>% subset(gene %in% umap_df$gene & tf %in% umap_df$gene)
  284. gene_depths <- cur_network %>%
  285. group_by(gene) %>%
  286. slice_min(n=1, order_by=depth) %>%
  287. dplyr::select(gene, depth) %>% distinct()
  288. cur_network <- cur_network %>%
  289. dplyr::rename(c(source=tf, target=gene))
  290. cur_network <- subset(cur_network, target %in% unique(tf_net$tf) | target %in% hub_df$gene_name)
  291. graph <- tidygraph::as_tbl_graph(cur_network) %>%
  292. tidygraph::activate(nodes) %>%
  293. mutate(degree = centrality_degree())
  294. tf_degrees <- table(tf_regulons$tf)
  295. tmp <- tf_degrees[names(V(graph))]; tmp <- tmp[!is.na(tmp)]
  296. V(graph)[names(tmp)]$degree <- as.numeric(tmp)
  297. V(graph)$gene_type <- ifelse(names(V(graph)) %in% unique(tf_regulons$tf), 'TF', 'Gene')
  298. V(graph)$gene_type <- ifelse(names(V(graph)) == cur_tf, 'selected', V(graph)$gene_type)
  299. umap_layout <- umap_df[names(V(graph)),] %>% dplyr::rename(c(x=UMAP1, y = UMAP2, name=gene))
  300. rownames(umap_layout) <- 1:nrow(umap_layout)
  301. lay <- create_layout(graph, umap_layout)
  302. gene_depths <- subset(gene_depths, gene %in% lay$name)
  303. tmp <- dplyr::left_join(lay, gene_depths, by = c('name' = 'gene'))
  304. lay$depth <- tmp$depth
  305. lay$depth <- ifelse(lay$name %in% cur_tf, 0, lay$depth)
  306. lay$depth <- factor(lay$depth, levels=0:max(as.numeric(lay$depth)))
  307. cur_shapes <- c(23, 24, 25); names(cur_shapes) <- levels(lay$depth)
  308. label_tfs <- subset(cur_network, target %in% tf_regulons$tf) %>% .$target %>% unique
  309. lay$lab <- ifelse(lay$name %in% c(cur_tf, label_tfs), lay$name, NA)
  310. p <- ggraph(lay)
  311. p <- p + geom_point(inherit.aes=FALSE, data=umap_df, aes(x=UMAP1, y=UMAP2), color=umap_df$color, alpha=0.3, size=2)
  312. p <- p + geom_edge_fan(
  313. aes(color=Cor, alpha=abs(Cor)),
  314. arrow = arrow(length = unit(2, 'mm'), type='closed'),
  315. end_cap = circle(3, 'mm')
  316. )
  317. p <- p + geom_node_point(
  318. data=subset(lay, gene_type == 'Gene'), aes(fill=module), shape=21, color='black', size=2
  319. )
  320. p <- p + geom_node_point(
  321. data=subset(lay, gene_type == 'TF'),
  322. aes(fill=module, size=degree, shape=depth), color='black'
  323. )
  324. p <- p + geom_node_label(
  325. aes(label=lab), repel=TRUE, max.overlaps=Inf,
  326. fontface='italic', color='black'
  327. )
  328. p <- p + scale_edge_colour_gradient2(high='orange2', mid='white', low='dodgerblue') +
  329. scale_colour_manual(values=cp) +
  330. scale_fill_manual(values=cp) +
  331. scale_shape_manual(values=cur_shapes) +
  332. guides(
  333. edge_alpha = "none",
  334. size = "none",
  335. shape = "none",
  336. fill = "none"
  337. )
  338. print(p)
  339. ggsave()
  340. }
  341. library(enrichR)
  342. seurat_obj <- RunEnrichrRegulons(seurat_obj, wait_time=1)
  343. saveRDS(seurat_obj, file = "")
  344. enrich_df <- GetEnrichrRegulonTable(seurat_obj)
  345. tf_for_plot <- c("FOXP2", "RORB", "CUX2", "POU6F2", "PKNOX2", "BCL11A",
  346. "BHLHE40", "ETS2", "CREM", "E2F3", "ZNF675", "PPARG")
  347. for (tf in tf_for_plot) {
  348. cur_tf <- tf
  349. plot_df <- subset(enrich_df, tf == cur_tf & P.value < 0.05)
  350. table(plot_df$target_type)
  351. p1 <- plot_df %>%
  352. subset(target_type == 'negative') %>%
  353. slice_max(n=10, order_by=Combined.Score) %>%
  354. mutate(Term = stringr::str_replace(Term, " \\s*\\([^\\)]+\\)", "")) %>% head(10) %>%
  355. ggplot(aes(x=-log(Combined.Score), y=reorder(Term, Combined.Score)))+
  356. geom_bar(stat='identity', position='identity', fill = "dodgerblue", alpha = 0.5) +
  357. geom_text(aes(label=Term), x=-.1, color='black', size=3.5, hjust='right') +
  358. xlab('log(Enrichment)') +
  359. scale_x_continuous(expand = c(0, 0), limits = c(NA, 0)) +
  360. ggtitle('Negatively correlated target genes') +
  361. theme(
  362. panel.grid.major=element_blank(),
  363. panel.grid.minor=element_blank(),
  364. legend.title = element_blank(),
  365. axis.ticks.y=element_blank(),
  366. axis.text.y=element_blank(),
  367. axis.line.y=element_blank(),
  368. plot.title = element_text(hjust = 0.5),
  369. axis.title.y = element_blank()
  370. )
  371. p2 <- plot_df %>%
  372. subset(target_type == 'positive') %>%
  373. slice_max(n=10, order_by=Combined.Score) %>%
  374. mutate(Term = stringr::str_replace(Term, " \\s*\\([^\\)]+\\)", "")) %>% head(10) %>%
  375. ggplot(aes(x=log(Combined.Score), y=reorder(Term, Combined.Score)))+
  376. geom_bar(stat='identity', position='identity', fill = "orange2", alpha = 0.5) +
  377. geom_text(aes(label=Term), x=.1, color='black', size=3.5, hjust='left') +
  378. xlab('log(Enrichment)') +
  379. scale_x_continuous(expand = c(0, 0), limits = c(0, NA)) +
  380. ggtitle('Positively correlated target genes') +
  381. theme(
  382. panel.grid.major=element_blank(),
  383. panel.grid.minor=element_blank(),
  384. legend.title = element_blank(),
  385. axis.ticks.y=element_blank(),
  386. axis.text.y=element_blank(),
  387. axis.line.y=element_blank(),
  388. plot.title = element_text(hjust = 0.5),
  389. axis.title.y = element_blank()
  390. )
  391. p <- p1 | p2
  392. print(p)
  393. ggsave()
  394. }
  395. p1 <- ModuleRegulatoryHeatmap(
  396. seurat_obj, feature='delta', dendrogram=FALSE
  397. ) + ggtitle('TFs only')
  398. p2 <- ModuleRegulatoryHeatmap(
  399. seurat_obj, feature='delta', TFs_only=FALSE,
  400. max_val=5, dendrogram=FALSE
  401. ) + ggtitle('All target genes')
  402. p <- p1 | p2
  403. print(p)
  404. ggsave()
  405. p1 <- ModuleRegulatoryHeatmap(
  406. seurat_obj, feature = 'positive', TFs_only = TRUE,
  407. high_color='orange2')
  408. p2 <- ModuleRegulatoryHeatmap(
  409. seurat_obj, feature = 'negative', TFs_only = TRUE,
  410. high_color='dodgerblue')
  411. p <- p1 | p2
  412. print(p)
  413. ggsave()
  414. p1 <- ModuleRegulatoryHeatmap(
  415. seurat_obj, feature = 'positive', TFs_only = FALSE,
  416. high_color='orange2')
  417. p2 <- ModuleRegulatoryHeatmap(
  418. seurat_obj, feature = 'negative', TFs_only = FALSE,
  419. high_color='dodgerblue')
  420. p <- p1 | p2
  421. print(p)
  422. ggsave()
  423. p <- ModuleRegulatoryNetworkPlot(seurat_obj, cutoff=0.5, max_val=1.5)
  424. print(p)
  425. ggsave()
  426. p1 <- ModuleRegulatoryNetworkPlot(
  427. seurat_obj, feature='positive', high_color='orange2')
  428. p2 <- ModuleRegulatoryNetworkPlot(
  429. seurat_obj, feature='negative', high_color='dodgerblue')
  430. p <- p1 | p2
  431. print(p)
  432. ggsave()

OFCsnRNA_05_hdWGCNA_mdd_bd_ExN.R at commit 7f932c5, no license · at the source

Overview

Authors: Rongwei Gao1, Ikuo Otsuka1, Toshiyuki Shirai1, Masao Miyachi1, Kiriko Minami1, Shohei Okada1, Ryo Tsukamoto1, Takaki Tanifuji1, Satoshi Okazaki2, Akitoyo Hishimoto1
  1. Department of Psychiatry, Kobe University Graduate School of Medicine,Kobe, Japan
  2. Kobe University Inclusive Campus & Healthcare Center,Kobe, Japan
Institutions: Kobe University (Japan)
Journal: Translational psychiatry, volume 16, issue 1, article 442
Dates: received 10 December 2025; accepted 12 June 2026; published online 21 June 2026
Type: Research article · Language: English
License: CC BY-NC-ND
Identifiers: DOI 10.1038/s41398-026-04200-5 · PMID 42324251 · PMCID PMC13529797 · OpenAlex W7165444042
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: genetics / omics (modality), histology / microscopy (modality), human (organism), depression (population), bipolar (population), cellular / molecular (subfield)
Methods: Machine learning
Keywords: Comparative genomics, Bipolar disorder, Depression
MeSH: Bipolar Disorder*, Brain*, Major Depressive Disorder*, Prefrontal Cortex*, Female, Gene Expression Profiling, Humans, Neurons (* major topic)
Topic: Bipolar Disorder and Treatment (Psychiatry and Mental health, Medicine), according to OpenAlex
Funding: JST Moonshot R&D Program (JPMJMS239F) SENSHIN Medical Research Foundation Smoking Research Foundation; JST SPRING (JPMJSP2148); Japan Society for the Promotion of Science (JP25K19058, JP21K07520 JP24K10710, JP21H02852 JP24K02383); Japan Agency for Medical Research and Development (23dk0307111); JST Moonshot R&D Program (JPMJMS239F) Smoking Research Foundation
Citations: not cited yet (Europe PMC); 69 references in the paper
Research resources: RRID:SCR_021059

Abstract

The abstract is not reproduced here: the paper's license (CC BY-NC-ND) does not allow it. Read it in the paper, at the publisher or on Europe PMC.

Repository

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

PsychiatKobeUniv-singlecell/Code_brain_mood_disorders

License: none: the authors keep all their rights
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: 7f932c51fa43710042e864e17a191cba550aa76a, 30 March 2026
Languages: R (18), Python (3)
Size: 30 files, 21 scripts
Software Heritage: not archived
Found in: “Code availability”
Holds: README
Not found: license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: tidyverse (18 files), ggplot2 (15 files), patchwork (12 files), Seurat (11 files), clusterProfiler (8 files), edgeR (8 files), ComplexHeatmap (5 files), Harmony (2 files), pandas (2 files), Scanpy (2 files), WGCNA (2 files), anndata (1 file), cowplot (1 file), ggpubr (1 file), igraph (1 file), limma (1 file), NumPy (1 file), reshape2 (1 file), rstatix (1 file), SingleCellExperiment (1 file), XGBoost (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
22 files

Code availability statement

The paper has a code availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:

Read it in the paper: doi.org/10.1038/s41398-026-04200-5.

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:

  • 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 21 scripts, each with its path and the digest of its content;
  • 7 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

Datasets cited

Other data links

Data availability statement

The paper has a data availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:

Read it in the paper: doi.org/10.1038/s41398-026-04200-5.

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 1, 27 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 10 authors, 3 keywords, 8 MeSH terms, 5 funders, 67 references, 1 RRID.

Cite

This paper

Gao, R., Otsuka, I., Shirai, T., Miyachi, M., Minami, K., Okada, S., Tsukamoto, R., Tanifuji, T., Okazaki, S., & Hishimoto, A. (2026). Postmortem brain single-nucleus and bulk gene expression analyses identify shared and distinct abnormalities in bipolar disorder and major depressive disorder. Translational psychiatry, 16(1), 442. https://doi.org/10.1038/s41398-026-04200-5

BibTeX

@article{gao2026postmortem,
author = {Gao, Rongwei and Otsuka, Ikuo and Shirai, Toshiyuki and Miyachi, Masao and Minami, Kiriko and Okada, Shohei and Tsukamoto, Ryo and Tanifuji, Takaki and Okazaki, Satoshi and Hishimoto, Akitoyo},
title = {{Postmortem brain single-nucleus and bulk gene expression analyses identify shared and distinct abnormalities in bipolar disorder and major depressive disorder}},
journal = {Translational psychiatry},
year = {2026},
month = jun,
volume = {16},
number = {1},
pages = {442},
publisher = {Nature Publishing Group},
issn = {2158-3188},
doi = {10.1038/s41398-026-04200-5},
url = {https://doi.org/10.1038/s41398-026-04200-5},
pmid = {42324251},
pmcid = {PMC13529797}
}

RIS

TY - JOUR
AU - Gao, Rongwei
AU - Otsuka, Ikuo
AU - Shirai, Toshiyuki
AU - Miyachi, Masao
AU - Minami, Kiriko
AU - Okada, Shohei
AU - Tsukamoto, Ryo
AU - Tanifuji, Takaki
AU - Okazaki, Satoshi
AU - Hishimoto, Akitoyo
TI - Postmortem brain single-nucleus and bulk gene expression analyses identify shared and distinct abnormalities in bipolar disorder and major depressive disorder
T2 - Translational psychiatry
J2 - Transl Psychiatry
PY - 2026
DA - 2026/06/21
VL - 16
IS - 1
SP - 442
SN - 2158-3188
PB - Nature Publishing Group
DO - 10.1038/s41398-026-04200-5
UR - https://doi.org/10.1038/s41398-026-04200-5
LA - en
ER -

CSL-JSON

{
"id": "10.1038/s41398-026-04200-5",
"type": "article-journal",
"title": "Postmortem brain single-nucleus and bulk gene expression analyses identify shared and distinct abnormalities in bipolar disorder and major depressive disorder",
"container-title": "Translational psychiatry",
"author": [
{
"family": "Gao",
"given": "Rongwei"
},
{
"family": "Otsuka",
"given": "Ikuo"
},
{
"family": "Shirai",
"given": "Toshiyuki"
},
{
"family": "Miyachi",
"given": "Masao"
},
{
"family": "Minami",
"given": "Kiriko"
},
{
"family": "Okada",
"given": "Shohei"
},
{
"family": "Tsukamoto",
"given": "Ryo"
},
{
"family": "Tanifuji",
"given": "Takaki"
},
{
"family": "Okazaki",
"given": "Satoshi"
},
{
"family": "Hishimoto",
"given": "Akitoyo"
}
],
"container-title-short": "Transl Psychiatry",
"volume": "16",
"issue": "1",
"page": "442",
"DOI": "10.1038/s41398-026-04200-5",
"PMID": "42324251",
"PMCID": "PMC13529797",
"ISSN": "2158-3188",
"publisher": "Nature Publishing Group",
"URL": "https://doi.org/10.1038/s41398-026-04200-5",
"language": "en",
"issued": {
"date-parts": [
[
2026,
6,
21
]
]
}
}

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.102766 [code]
A longitudinal single-cell and spatial multiomic atlas of pediatric high-grade glioma.
Journal: Cell reports. Medicine
In common: WGCNA, Harmony, SingleCellExperiment, 16 other tools, genetics / omics, cellular / molecular, 5 references
[2] doi:10.1016/j.cell.2026.05.026 [code]
The critical role of the endogenous immune compartment after CAR T cell therapy in recurrent GBM.
Journal: Cell
In common: Harmony, SingleCellExperiment, edgeR, 13 other tools, genetics / omics, 5 references
[3] doi:10.1002/imt2.70163 [code]
Spatial multi-omics unveils sphingolipid metabolic reprogramming within the retinal pathological niche.
Journal: iMeta
In common: Harmony, SingleCellExperiment, edgeR, 16 other tools, genetics / omics, cellular / molecular
[4] doi:10.1038/s41467-026-73305-8 [code]
Comparative analysis of the cellular landscape in mammalian striatum.
Journal: Nature communications
In common: WGCNA, Harmony, SingleCellExperiment, 14 other tools, genetics / omics, cellular / molecular, 2 references
[5] 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: WGCNA, Harmony, SingleCellExperiment, 12 other tools, cellular / molecular, 3 references
[6] doi:10.1038/s41380-026-03629-w [code]
Maternal fasting during early gestation induces epigenetic alterations and schizophrenia-related phenotypes.
Journal: Molecular psychiatry
In common: WGCNA, Harmony, limma, 12 other tools, genetics / omics, cellular / molecular, 4 references
[7] doi:10.1016/j.celrep.2026.117500 [code]
Spatio-molecular gene expression reflects dorsal anterior cingulate cortex structure and function in the human brain.
Journal: Cell reports
In common: Harmony, SingleCellExperiment, edgeR, 12 other tools, histology / microscopy, genetics / omics, cellular / molecular, 3 references
[8] doi:10.1038/s41586-026-10214-2 [code]
Multidimensional profiling of heterogeneity in supratentorial ependymomas.
Journal: Nature
In common: Harmony, SingleCellExperiment, edgeR, 14 other tools, genetics / omics
[9] doi:10.1126/sciadv.aeg3223 [code]
The extreme diversity of retinal amacrine cells has deep evolutionary roots.
Journal: Science advances
In common: WGCNA, XGBoost, rstatix, 13 other tools, genetics / omics, cellular / molecular, 1 reference
[10] doi:10.1038/s41514-026-00391-9 [code]
Region-specific transcriptional signatures of brain aging in the absence of neuropathology at the single-cell level.
Journal: npj aging
In common: Harmony, edgeR, anndata, 11 other tools, histology / microscopy, genetics / omics, cellular / molecular, 2 references

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.