OSCR

Mitofusin-2 in ventral striatal D1 neurons regulates effort-based motivation through sex-specific mitochondrial-synaptic reprogramming.

A correction to this paper has been published: the notice, 42607229, from Europe PMC.

Code ↔ Paper

The paper beside its authors' code: matches between them have not been computed for this paper yet.

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 · 460 lines · 22 KB · CC-BY-4.0

  1. ## Chioino et al. 2026, DESeq2 and GSEA
  2. ## In case of issues/suggestions, please contact: [email hidden]
  3. # For the differential expression analysis
  4. require(DESeq2)
  5. require(pheatmap)
  6. require(RColorBrewer)
  7. require(ggplot2)
  8. require(reshape2)
  9. require(ggrepel)
  10. # For the GSEA
  11. require(clusterProfiler)
  12. require(org.Mm.eg.db)
  13. require(org.Rn.eg.db)
  14. require(enrichplot)
  15. require(forcats)
  16. require(DOSE)
  17. require(ggplot2)
  18. require(lattice)
  19. ##### Differential expression analysis #####
  20. # Load in the raw read counts
  21. counts <- read.table("Ribotag_counts_clean.csv", header = T, check.names = FALSE, sep = "\t")
  22. rownames(counts) <- counts[,1]
  23. # Define the conditions table
  24. condition <- c(rep("KD", 2), rep("Ctrl", 5), rep("KD", 3))
  25. condition <- c(rep("M", 5), rep("F", 6))
  26. coldata <- data.frame(sampleNames = colnames(counts)[-1], condition = condition[])
  27. ## Batch correction using sva package ()
  28. require(sva)
  29. b <- c(rep("1",4),rep("2",6)) # Define the batch vector
  30. batch <- ComBat_seq(as.matrix(counts[,-1]), batch = b, group = c(condition))
  31. write.csv2(batch, file = "Ale_M_combined_batchCorrected.csv",quote = F)
  32. batch <- as.data.frame(batch)
  33. batch$Geneid <- sapply(strsplit(counts$Geneid, "\\."), "[", 1)
  34. ## Run DESeq2
  35. ddsHTSeq <- DESeqDataSetFromMatrix(countData = batch[,], colData = coldata, design = ~c(condition))
  36. # Remove reads which are low (here below 5 counts) and genes that were not represented in 3 or more samples.
  37. ddsHTSeq <- ddsHTSeq[rowSums(counts(ddsHTSeq)) > 5, ]
  38. ddsHTSeq <- ddsHTSeq[rowSums(counts(ddsHTSeq) == 0) <= 3, ]
  39. # This tells the program that the reference (the level to which samples should be compared) is WT.
  40. ddsHTSeq$condition <- relevel(ddsHTSeq$condition, ref="Ctrl")
  41. #### QC begins here... #####
  42. rld_BLIND <- vst(ddsHTSeq, blind = TRUE)
  43. sampleDists <- dist(t(assay(rld_BLIND)))
  44. # This calculates the Eucledean distance, meaning the greater the distance the dissimilar the samples.
  45. sampleDistMatrix <- as.matrix(sampleDists)
  46. colors <- colorRampPalette( rev(brewer.pal(9, "Greens")) )(255)
  47. pheatmap(sampleDistMatrix, col=colors, cluster_rows=F, display_numbers = T, fontsize_number = 10, number_color = "black", border_color = "black", annotation_colors = "black", main = "Eucledean Distance of mRNA Gene Expression", cellwidth = 50, cellheight = 25, treeheight_col = 15)
  48. write.csv(sampleDistMatrix, file = "Eucledean_distance_mRNA.csv")
  49. # And a principal component plot:
  50. data <- plotPCA(rld_BLIND, intgroup=c("condition"), returnData = TRUE)
  51. percentVar <- round(100 * attr(data, "percentVar"))
  52. ggplot(data[,], aes(PC1, PC2, color=condition)) + geom_point(size=5) +
  53. xlab(paste0("PC1: ",percentVar[1],"% variance")) + ylab(paste0("PC2: ",percentVar[2],"% variance")) +
  54. scale_colour_brewer(type = "qual", palette="Set1") + theme_linedraw(base_size = 24) +
  55. theme(panel.grid = element_line(colour = "blue")) +
  56. labs(color = "", title = "Ribotag Males", subtitle = "All reps, batch corrected, no mitogenes") + geom_text_repel(aes(label = name), max.overlaps = 15)
  57. ggsave(filename = "PCA_M_batchCorrected_noMitoGenes.pdf", width = 8, height = 6, onefile = F)
  58. # Spearman correlations:
  59. data_table <- assay(rld_BLIND)
  60. spearman <- cor(data_table, method = "spearman")
  61. sampleDistMatrix <- as.matrix(spearman)
  62. colors <- colorRampPalette(brewer.pal(9, "Greens") )(255)
  63. pheatmap(sampleDistMatrix, col=colors, display_numbers = round(sampleDistMatrix, digits = 3), fontsize_number = 10, number_color = "black", border_color = "black", annotation_colors = "black", main = "Spearman Correlation of mRNA Gene Expression", treeheight_col = 20) #, cellwidth = 50, cellheight = 25, treeheight_col = 15)
  64. #### Differential expression analysis begins here... ####
  65. ddsHTSeq <- estimateSizeFactors(ddsHTSeq)
  66. sizeFactors(ddsHTSeq)
  67. countingData <- counts(ddsHTSeq, normalized = T)
  68. # Export the normalized counts table
  69. write.table(countingData, file = "Ale_M_normalizedReadCounts.csv",quote = F, col.names = T, row.names = F, sep = "\t", dec = ".")
  70. dds <- DESeq(ddsHTSeq, betaPrior = FALSE)
  71. res <- results(dds)
  72. summary(res)
  73. #library("IHW")
  74. # In the contrast option, write in the order of ratio, for instance if you want KD/Ctrl -> c("condition", "KD", "Ctrl")
  75. res1 <- results(dds, contrast = c("condition", "KD", "Ctrl"), pAdjustMethod = "BH", alpha = 0.1)
  76. summary(res1)
  77. liste <- list(res1) # If you have more than one comparison, this list helps running the code through all at once
  78. fileNameSuffix <- c("M_KDvCtrl")
  79. generalName <- "RunsCombined_noBatchCorrection_allGenes_someRemoved"
  80. ## Volcano plots
  81. for (i in 1:length(liste)) {
  82. toplot <- as.data.frame(liste[i])
  83. toplot$gene <- sapply(strsplit(rownames(toplot), "\\."), "[", 1)
  84. toplot <- merge(toplot, annotation, by = "gene")
  85. pvallim <- 0.01
  86. xlim <- c(-4, 4)
  87. ylim <- c(0,20) # If you have genes with very low pvals, use a sensible pval cutoff for the graph!
  88. top <- 50
  89. DE <- toplot[is.finite(toplot$log2FoldChange),]
  90. DE <- DE[order(DE$pvalue),]
  91. label <- DE[DE$pvalue < pvallim,ncol(DE)][1:top] # Pick genes to be labeled in the graph, only the top x
  92. label <- c(label, rep("", nrow(DE)-length(label))) # Fill the rest of the vector with empty strings
  93. col1 <- DE$pvalue < pvallim & DE$log2FoldChange < 0
  94. col1 <- ifelse(col1, "Down", "no.change")
  95. col2 <- DE$pvalue < pvallim & DE$log2FoldChange > 0
  96. col2 <- ifelse(col2, "Up", "ns")
  97. col <- ifelse(col1 == "Down", col1, col2)
  98. cols <- c(Up = "blue", Down = "red", ns = "black")
  99. labcol <- ifelse(col == "Down", "red", "blue")
  100. numup <- sum(col == "Up", na.rm = T)
  101. numdown <- sum(col == "Down", na.rm = T)
  102. # With labels
  103. ggplot(data=DE, aes(x=log2FoldChange, y=-log10(pvalue), col = col)) +
  104. geom_point() +
  105. theme_grey() + labs(col = "", title = (fileNameSuffix[i])) +
  106. scale_color_manual(values=cols) + xlim(xlim[1], xlim[2]) +theme(text = element_text(size = 18)) + geom_vline(xintercept = 0, linetype = "dashed") + geom_text_repel(label=label, col = labcol, size = 3, max.overlaps = 100)
  107. ggsave(filename = paste("VolcanoPlot_", generalName, "_",fileNameSuffix[i], "_pval_",pvallim, "_withLabels",".pdf", sep = ""), width = 8, height = 6, onefile = F)
  108. # Without labels
  109. ggplot(data=DE, aes(x=log2FoldChange, y=-log10(pvalue), col = col)) +
  110. geom_point() +
  111. theme_grey() + labs(col = "", title = (fileNameSuffix[i])) +
  112. scale_color_manual(values=cols) + xlim(xlim[1], xlim[2]) +theme(text = element_text(size = 18)) + geom_vline(xintercept = 0, linetype = "dashed") +
  113. annotate("text", label= paste("Down: ", numdown), x = min(xlim)*.5, y = max(-log10(DE$pvalue)*.95, na.rm = T), color = "red") +
  114. annotate("text", label= paste("Up: ", numup), x = -min(xlim)*.5, y = max(-log10(DE$pvalue)*.95, na.rm = T), color = "blue")
  115. ggsave(filename = paste("VolcanoPlot_", generalName, "_",fileNameSuffix[i], "_pval_",pvallim, "_noLabels",".pdf", sep = ""), width = 8, height = 6, onefile = F)
  116. # With labels, no xlim
  117. ggplot(data=DE, aes(x=log2FoldChange, y=-log10(pvalue), col = col)) +
  118. geom_point() +
  119. theme_grey() + labs(col = "", title = (fileNameSuffix[i])) +
  120. scale_color_manual(values=cols) +theme(text = element_text(size = 18)) + geom_vline(xintercept = 0, linetype = "dashed") + geom_text_repel(label=label, col = labcol, size = 3, max.overlaps = 100)
  121. ggsave(filename = paste("VolcanoPlot_", generalName, "_",fileNameSuffix[i], "_pval_",pvallim, "_withLabels_noxlim",".pdf", sep = ""), width = 8, height = 6, onefile = F)
  122. # Without labels, no xlim
  123. ggplot(data=DE, aes(x=log2FoldChange, y=-log10(pvalue), col = col)) +
  124. geom_point() +
  125. theme_grey() + labs(col = "", title = (fileNameSuffix[i])) +
  126. scale_color_manual(values=cols) +theme(text = element_text(size = 18)) + geom_vline(xintercept = 0, linetype = "dashed") +
  127. annotate("text", label= paste("Down: ", numdown), x = min(DE$log2FoldChange)*.5, y = max(-log10(DE$pvalue)*.95, na.rm = T), color = "red") +
  128. annotate("text", label= paste("Up: ", numup), x = -min(DE$log2FoldChange)*.5, y = max(-log10(DE$pvalue)*.95, na.rm = T), color = "blue")
  129. ggsave(filename = paste("VolcanoPlot_", generalName, "_",fileNameSuffix[i], "_pval_",pvallim,"__noLabels_noxlim" ,".pdf", sep = ""), width = 8, height = 6, onefile = F)
  130. # With labels + ylim
  131. ggplot(data=DE, aes(x=log2FoldChange, y=-log10(pvalue), col = col)) +
  132. geom_point() +
  133. theme_grey() + labs(col = "", title = (fileNameSuffix[i])) +
  134. scale_color_manual(values=cols) + xlim(xlim[1], xlim[2]) + ylim(ylim[1], ylim[2]) + theme(text = element_text(size = 18)) + geom_vline(xintercept = 0, linetype = "dashed") + geom_text_repel(label=label, col = labcol, size = 3, max.overlaps = 100)
  135. ggsave(filename = paste("VolcanoPlot_", generalName, "_",fileNameSuffix[i], "_pval_",pvallim, "_withLabels_ylim",".pdf", sep = ""), width = 8, height = 6, onefile = F)
  136. # Without labels + ylim
  137. ggplot(data=DE, aes(x=log2FoldChange, y=-log10(pvalue), col = col)) +
  138. geom_point() +
  139. theme_grey() + labs(col = "", title = (fileNameSuffix[i])) +
  140. scale_color_manual(values=cols) + xlim(xlim[1], xlim[2]) + ylim(ylim[1], ylim[2]) + theme(text = element_text(size = 18)) + geom_vline(xintercept = 0, linetype = "dashed") +
  141. annotate("text", label= paste("Down: ", numdown), x = min(xlim)*.5, y = max(ylim*.95, na.rm = T), color = "red") +
  142. annotate("text", label= paste("Up: ", numup), x = -min(xlim)*.5, y = max(ylim*.95, na.rm = T), color = "blue")
  143. ggsave(filename = paste("VolcanoPlot_", generalName, "_",fileNameSuffix[i], "_pval_",pvallim, "_noLabels_ylim",".pdf", sep = ""), width = 8, height = 6, onefile = F)
  144. ## Volcano Plots with padj < 0.1
  145. padjlim <- 0.1
  146. xlim <- c(-4, 4)
  147. ylim <- c(0,20) # If you have genes with very low pvals, use a sensible pval cutoff for the graph!
  148. top <- 50
  149. DE <- toplot[is.finite(toplot$log2FoldChange),]
  150. DE <- DE[order(DE$padj),]
  151. label <- DE[DE$padj < padjlim,ncol(DE)][1:top] # Pick genes to be labeled in the graph, only the top x
  152. label <- c(label, rep("", nrow(DE)-length(label))) # Fill the rest of the vector with empty strings
  153. col1 <- DE$padj < padjlim & DE$log2FoldChange < 0
  154. col1 <- ifelse(col1, "Down", "no.change")
  155. col2 <- DE$padj < padjlim & DE$log2FoldChange > 0
  156. col2 <- ifelse(col2, "Up", "ns")
  157. col <- ifelse(col1 == "Down", col1, col2)
  158. cols <- c(Up = "blue", Down = "red", ns = "black")
  159. labcol <- ifelse(col == "Down", "red", "blue")
  160. numup <- sum(col == "Up", na.rm = T)
  161. numdown <- sum(col == "Down", na.rm = T)
  162. # With labels
  163. ggplot(data=DE, aes(x=log2FoldChange, y=-log10(padj), col = col)) +
  164. geom_point() +
  165. theme_grey() + labs(col = "", title = (fileNameSuffix[i])) +
  166. scale_color_manual(values=cols) + xlim(xlim[1], xlim[2]) +theme(text = element_text(size = 18)) + geom_vline(xintercept = 0, linetype = "dashed") + geom_text_repel(label=label, col = labcol, size = 3, max.overlaps = 100)
  167. ggsave(filename = paste("VolcanoPlot_", generalName, "_",fileNameSuffix[i], "_padj_",padjlim, "_withLabels",".pdf", sep = ""), width = 8, height = 6, onefile = F)
  168. # Without labels
  169. ggplot(data=DE, aes(x=log2FoldChange, y=-log10(padj), col = col)) +
  170. geom_point() +
  171. theme_grey() + labs(col = "", title = (fileNameSuffix[i])) +
  172. scale_color_manual(values=cols) + xlim(xlim[1], xlim[2]) +theme(text = element_text(size = 18)) + geom_vline(xintercept = 0, linetype = "dashed") +
  173. annotate("text", label= paste("Down: ", numdown), x = min(xlim)*.5, y = max(-log10(DE$padj)*.95, na.rm = T), color = "red") +
  174. annotate("text", label= paste("Up: ", numup), x = -min(xlim)*.5, y = max(-log10(DE$padj)*.95, na.rm = T), color = "blue")
  175. ggsave(filename = paste("VolcanoPlot_", generalName, "_",fileNameSuffix[i], "_padj_",padjlim, "_noLabels",".pdf", sep = ""), width = 8, height = 6, onefile = F)
  176. # With labels, no xlim
  177. ggplot(data=DE, aes(x=log2FoldChange, y=-log10(padj), col = col)) +
  178. geom_point() +
  179. theme_grey() + labs(col = "", title = (fileNameSuffix[i])) +
  180. scale_color_manual(values=cols) +theme(text = element_text(size = 18)) + geom_vline(xintercept = 0, linetype = "dashed") + geom_text_repel(label=label, col = labcol, size = 3, max.overlaps = 100)
  181. ggsave(filename = paste("VolcanoPlot_", generalName, "_",fileNameSuffix[i], "_padj_",padjlim, "_withLabels_noxlim",".pdf", sep = ""), width = 8, height = 6, onefile = F)
  182. # Without labels, no xlim
  183. ggplot(data=DE, aes(x=log2FoldChange, y=-log10(padj), col = col)) +
  184. geom_point() +
  185. theme_grey() + labs(col = "", title = (fileNameSuffix[i])) +
  186. scale_color_manual(values=cols) +theme(text = element_text(size = 18)) + geom_vline(xintercept = 0, linetype = "dashed") +
  187. annotate("text", label= paste("Down: ", numdown), x = min(DE$log2FoldChange)*.5, y = max(-log10(DE$padj)*.95, na.rm = T), color = "red") +
  188. annotate("text", label= paste("Up: ", numup), x = -min(DE$log2FoldChange)*.5, y = max(-log10(DE$padj)*.95, na.rm = T), color = "blue")
  189. ggsave(filename = paste("VolcanoPlot_", generalName, "_",fileNameSuffix[i], "_padj_",padjlim,"__noLabels_noxlim" ,".pdf", sep = ""), width = 8, height = 6, onefile = F)
  190. # With labels + ylim
  191. ggplot(data=DE, aes(x=log2FoldChange, y=-log10(padj), col = col)) +
  192. geom_point() +
  193. theme_grey() + labs(col = "", title = (fileNameSuffix[i])) +
  194. scale_color_manual(values=cols) + xlim(xlim[1], xlim[2]) + ylim(ylim[1], ylim[2]) + theme(text = element_text(size = 18)) + geom_vline(xintercept = 0, linetype = "dashed") + geom_text_repel(label=label, col = labcol, size = 3, max.overlaps = 100)
  195. ggsave(filename = paste("VolcanoPlot_", generalName, "_", fileNameSuffix[i], "_padj_",padjlim, "_withLabels_ylim",".pdf", sep = ""), width = 8, height = 6, onefile = F)
  196. # Without labels + ylim
  197. ggplot(data=DE, aes(x=log2FoldChange, y=-log10(padj), col = col)) +
  198. geom_point() +
  199. theme_grey() + labs(col = "", title = (fileNameSuffix[i])) +
  200. scale_color_manual(values=cols) + xlim(xlim[1], xlim[2]) + ylim(ylim[1], ylim[2]) + theme(text = element_text(size = 18)) + geom_vline(xintercept = 0, linetype = "dashed") +
  201. annotate("text", label= paste("Down: ", numdown), x = min(xlim)*.5, y = max(ylim*.95, na.rm = T), color = "red") +
  202. annotate("text", label= paste("Up: ", numup), x = -min(xlim)*.5, y = max(ylim*.95, na.rm = T), color = "blue")
  203. ggsave(filename = paste("VolcanoPlot_", generalName, "_" ,fileNameSuffix[i], "_padj_",padjlim, "_noLabels_ylim",".pdf", sep = ""), width = 8, height = 6, onefile = F)
  204. }
  205. ## Saving the results as tables
  206. fileNameSuffix <- c("M_KDvCtrl")
  207. generalName <- "RunsCombined_noBatchCorrection_allGenes_someRemoved"
  208. for (i in 1:length(liste)) {
  209. res <- liste[i]
  210. res <- as.data.frame(res)
  211. res_Ordered <- as.data.frame(res[order(res$pvalue),])
  212. res_Ordered$gene <- rownames(res_Ordered)
  213. res_Ordered$gene <- sapply(strsplit(rownames(res_Ordered), "\\."), "[", 1)
  214. res_merged <- merge(res_Ordered, annotation, by="gene")
  215. # res_merged <- res_Ordered
  216. # wt_kd_F_merged <- wt_kd_F_merged[,c(1,8,9,2,3,6,7)]
  217. res_merged <- res_merged[,c(7,1:6)]
  218. res_merged <- res_merged[,c(1,9,2:7)]
  219. res_merged <- res_merged[order(res_merged$pvalue, decreasing = F),]
  220. colnames(res_merged)[1] <- "Gene"
  221. colnames(res_merged)[2] <- "GeneSymbol"
  222. res_sig <- subset(res_merged, res_merged$pvalue < 0.05)
  223. res_padj <- subset(res_merged, res_merged$padj < 0.1)
  224. write.table(res_merged, file = paste(generalName, "_", fileNameSuffix[i], "_allChanges.csv", sep = ""),quote = F, col.names = T, row.names = F, sep = "\t", dec = ".")
  225. write.table(res_sig, file = paste(generalName, "_", fileNameSuffix[i], "_pval0.05.csv", sep = ""),quote = F, col.names = T, row.names = F, sep = "\t", dec = ".")
  226. write.table(res_padj, file = paste(generalName, "_", fileNameSuffix[i], "_padj0.1.csv", sep = ""),quote = F, col.names = T, row.names = F, sep = "\t", dec = ".")
  227. }
  228. ## Comparisons (i.e. Male vs Female DEGs)
  229. ## Define cutoffs for i.e. p-value, or fold change
  230. group1 <- subset(wt_kd_F_sig, wt_kd_F_sig$log2FoldChange > 0 & wt_kd_F_sig$padj < 0.1)
  231. group2 <- subset(wt_kd_M_sig, wt_kd_M_sig$log2FoldChange > 0 & wt_kd_M_sig$padj < 0.1)
  232. ## get the overlap between the groups.
  233. overlap <- group1[group1$GeneID %in% group2$external_gene_name,]
  234. ## or get the differences between groups.
  235. group1only <- group1[!group1$ID %in% group2$ID,]
  236. group2only <- group2[!group2$ID %in% group1$ID,]
  237. ## and draw the Venn diagrams
  238. require(VennDiagram)
  239. grid.newpage()
  240. draw.pairwise.venn(nrow(group1), nrow(group2), nrow(overlap), category = c("Female DEGs", "Male DEGs"), cat.pos = c(-10,-5), fill = c("cyan", "coral2"))
  241. ## Gene Heatmaps
  242. # Load in the mouse genome annotation, if you would like to convert Ensembl IDs into gene symbols
  243. annotation <- read.csv2("mouse_annotation_genesOnly.csv", header = T, sep = ";")
  244. countingData <- as.data.frame(countingData)
  245. countingData$V1 <- sapply(strsplit(rownames(countingData), "\\."), "[", 1) # Only needed if there are dots in the gene IDs
  246. countmat <- merge(countingData, annotation, by = "V1")# Get the gene names from annotation
  247. colnames(countsInUse)[1]
  248. countsInUse <- merge(countsInUse, annotation, by = "V1")
  249. # To draw the most highly changing genes (the example here is with the female genes)
  250. subs <- subset(countmat, (countmat$V3 %in% wt_kd_F_padj$V3))
  251. subs <- subs[!(str_detect(subs$V3, "Gm")),] # If you want to remove the unannotated genes
  252. subs <- subs[,-c(1,12:13)] # Get rid of non-number columns
  253. df <- scale(t(subs))
  254. rownames(df) <- paste(sapply(strsplit(rownames(df), "_"), "[", 1), sapply(strsplit(rownames(df), "_"), "[", 2), sapply(strsplit(rownames(df), "_"), "[", 3))
  255. library("RColorBrewer")
  256. col <- colorRampPalette(brewer.pal(10, "RdYlBu"))(256)
  257. library(ComplexHeatmap)
  258. Heatmap(df[,sample(1:ncol(df),100)], # Use t(df) to transpose and cluster genes instead of samples
  259. name = "z-score", #title of legend
  260. column_title = "Genes", row_title = "Samples", cluster_columns = T, cluster_rows = F, show_column_dend = T, show_column_names = T,
  261. row_names_gp = gpar(fontsize = 10), column_names_gp = gpar(fontsize = 5), col = col, km = 2)
  262. # To get the genes/samples belonging to kmeans clusters
  263. km <- kmeans(t(df), centers = 2)
  264. kmdf <- as.data.frame(km$cluster)
  265. kmdf
  266. ##### GSEA #####
  267. # Helper functions
  268. # Arrange the DE tables in a way that can be parsed by the GSEA function
  269. tableCleanUp <- function(table) {
  270. flag <- NULL
  271. # Find the column with the gene names
  272. for (i in 1:ncol(table)) {
  273. if ((is.character(table[,i])) & (length(unique(table[,i])) == nrow(table))) {
  274. geneCol <- i
  275. }
  276. if ((is.numeric(table[,i]) & any(table[,i] < 0))) {
  277. log2Col <- i
  278. }
  279. if ((is.numeric(table[,i])) & all(table[,i] > 0) & all(table[,i] <= 1)) {
  280. flag <- c(flag, i)
  281. }
  282. }
  283. minMeans <- min(colMeans(table[,flag]))
  284. for (j in flag) {
  285. if (round(minMeans, digits = 3) == round(mean(table[,j]), digits = 3)) {
  286. pvalCol <- j
  287. }
  288. }
  289. padjCol <- flag[flag != pvalCol]
  290. clean <- table[,c(geneCol, log2Col, pvalCol, padjCol)]
  291. colnames(clean) <- c("Gene", "avg_log2FC","pvalue", "padj")
  292. return(clean)
  293. }
  294. # Main GSEA function
  295. cP_GSEARun <- function(DE, name, customList = tibble(), customListName = "customGeneList", ont = "BP",OrgDb = "org.Mm.eg.db", pAdjustMethod = "BH", by = "classic", cutoff = 0.5) {
  296. if (by == "wald") {
  297. geneList <- DE$stat
  298. }
  299. if (by == "classic") {
  300. geneList <- -log10(DE$pvalue) * sign(DE$log2FoldChange)
  301. }
  302. names(geneList) <- DE$Gene
  303. geneList = sort(geneList, decreasing = TRUE)
  304. de <- names(geneList) # Take all the DEGs
  305. ##Get the Entrez gene IDs associated with those symbols
  306. if (OrgDb == "org.Mm.eg.db") {
  307. EG_IDs = mget(de, revmap(org.Mm.egSYMBOL),ifnotfound=NA)
  308. }
  309. if (OrgDb == "org.Rn.eg.db") {
  310. EG_IDs = mget(de, revmap(org.Rn.egSYMBOL),ifnotfound=NA)
  311. }
  312. if (nrow(customList) == 0) {
  313. names(geneList) <- (EG_IDs)
  314. gL <- geneList
  315. nodups <- gL[!(duplicated(names(gL)))]
  316. gse <- gseGO(geneList=nodups,
  317. ont = ont,
  318. keyType = "ENTREZID",
  319. pvalueCutoff = cutoff,
  320. OrgDb = OrgDb,
  321. pAdjustMethod = pAdjustMethod, nPermSimple = 10000,
  322. verbose = F)
  323. name <- paste(ont, "_", name, sep = "")
  324. }
  325. else {
  326. gL <- geneList
  327. nodups <- gL[!(duplicated(names(gL)))]
  328. gse <- GSEA(nodups, TERM2GENE = customList, nPermSimple = 10000,
  329. pvalueCutoff = cutoff, pAdjustMethod = pAdjustMethod)
  330. name <- paste(customListName, "_", name, sep = "")
  331. }
  332. results <- gse@result
  333. write.csv(results, file = paste("GSEAGO_", name, ".csv",sep = ""))
  334. if (nrow(results) == 0) {
  335. return()
  336. }
  337. clusterProfiler::dotplot(gse, showCategory=10, split = ".sign", font.size = 5, x = "NES") + facet_grid(.~.sign)
  338. ggsave(filename = paste("Dotplot_ActivatedSuppressed_", name, ".pdf", sep = ""), width = 8, height = 6, onefile = F)
  339. clusterProfiler::dotplot(gse, color = "p.adjust", x = "NES", showCategory=10, font.size = 5)
  340. ggsave(filename = paste("Dotplot_bypadj_", name, ".pdf", sep = ""), width = 8, height = 6, onefile = F)
  341. # simp <- clusterProfiler::simplify(gse, 0.7)
  342. #
  343. # clusterProfiler::dotplot(simp, showCategory=15, split = ".sign", font.size = 10) + facet_grid(.~.sign)
  344. # clusterProfiler::dotplot(gse, color = "NES", x = "p.adjust", showCategory=15)
  345. emp <- pairwise_termsim(gse)
  346. emapplot(emp, showCategory = 30)
  347. ggsave(filename = paste("EmapPlot_",name, ".pdf", sep = ""), width = 8, height = 6, onefile = F)
  348. count <- ifelse(nrow(results) < 10, yes = nrow(results), no = 10)
  349. for (j in 1:count) {
  350. pdf(file = paste("GSEAplot_","_Rank", j, "_", name, ".pdf", sep = ""))
  351. print(gseaplot2(gse, geneSetID = j, title = gse$Description[j], pvalue_table = T))
  352. dev.off()
  353. }
  354. }
  355. # Example run: Make sure that the DE list contains ALL assessed genes; no pval cutoffs should be utilized for GSEA!!
  356. clean <- tableCleanUp(DElist)
  357. cP_GSEARun(DE = clean, name = "M_KDvCtrl" , OrgDb = "org.Mm.eg.db", ont = "BP", pAdjustMethod = "BH", cutoff = 0.1, by = "classic")

Chioinoetal_2026_DESeq2_and_GSEA.R, under CC-BY-4.0 · at the source

Overview

Authors: Alessandro Chioino1,2, Dogukan H Ulgen1,2, Olivia Zanoletti1,2, Isabelle Guillot de Suduiraut1,2, Ashley M Maynard3, Elisenda Sanz4,5,6, Albert Quintana4,5,6, Simone Astori1,2, Carmen Sandi1,2
  1. Laboratory of Behavioral Genetics, Brain Mind Institute, School of Life Sciences, Ecole Polytechnique Fédérale de Lausanne, Lausanne 1015, Switzerland
  2. Synapsy Center for Neuroscience and Mental Health Research, School of Life Sciences, Ecole Polytechnique Fédérale de Lausanne, Lausanne 1015, Switzerland
  3. Regeneration and Neurogenomics Laboratory, Brain Mind Institute, School of Life Sciences, Ecole Polytechnique Fédérale de Lausanne, Lausanne 1015, Switzerland
  4. Institut de Neurociències, Universitat Autònoma de Barcelona, Bellaterra 08193, Spain
  5. Departament de Biologia Cellular, Fisiologia i Immunologia, Universitat Autònoma de Barcelona, Barcelona 08193, Spain
  6. Focus Area for Human Metabolomics, Faculty of Natural and Agricultural Sciences, North-West University, Potchefstroom 2520, South Africa
Dates: received 22 January 2026; accepted 7 June 2026; published online 15 July 2026; in print 21 July 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1073/pnas.2601657123 · PMID 42455671 · PMCID PMC13389689 · OpenAlex W7168342532
Open access: hybrid, a free copy (OpenAlex)
Status: code verified
Categories: mouse (organism), cellular / molecular (subfield)
Methods: Statistics
Keywords: mitochondria, motivation, ventral striatum
MeSH: GTP Phosphohydrolases*, Mitochondria*, Motivation*, Neurons*, Receptors, Dopamine D1*, Synapses*, Ventral Striatum*, Animals, Female, Male, Medium Spiny Neurons, Mice (* major topic)
Topic: Mitochondrial Function and Pathology (Molecular Biology, Biochemistry, Genetics and Molecular Biology), according to OpenAlex
Funding: Swiss National Science Foundation (10003692, 197942, 158776, 51NF40-158776, 189061, 31NE30 _ 189061, 31003A _ 197942); Brain & Behavior Research Foundation (32172)
Citations: cited by 1 paper (Europe PMC); 113 references in the paper
Notices: A correction to this paper has been published (42607229, from Europe PMC)

Abstract

Effort-based motivation varies widely across individuals and affects well-being, yet the molecular and neuronal mechanisms that set motivational capacity remain incompletely understood. Mitochondrial function is emerging as a critical regulator of behavior, and mitofusin-2 (MFN2) is a key mediator of mitochondrial fusion and endoplasmic reticulum–mitochondria coupling. Here, we asked how downregulation of Mfn2 in dopamine receptor type-1-expressing medium spiny neurons (D1-MSNs) contributes to effort-based motivation and stress coping in male and female mice by integrating electrophysiology, neuronal and synaptic morphology, immunohistochemistry, mitochondrial readouts, RNA in situ hybridization, RiboTag, and behavioral analyses. MFN2 deficiency resulted in fragmented dendritic mitochondria and remodeled synaptic inputs in ventral striatal D1-MSNs, with no cellular impact in dorsomedial striatal D1-MSNs. Although MFN2 deficiency elicited sex-dependent synaptic and structural alterations, both sexes showed reduced recruitment of accumbal D1-MSNs during motivated behavior and impaired effort-based motivation and stress coping. Translatome profiling revealed shared depletion of mitochondrial pathways in both sexes, with more pronounced suppression of oxidative phosphorylation and TCA cycle programs in males. Strikingly, only males also exhibited coordinated downregulation of ribosomal programs together with enrichment of synaptic pathways, with high representation of genes regulating glutamate receptor cycling and PSD remodeling, providing a mechanistic framework for the observed synaptic alterations. Pathway-level network inference further supported coupling among mitochondrial, translational, and synaptic programs in males. These findings identify MFN2-dependent mitochondrial integrity in ventral striatal D1-MSNs as a critical determinant of motivational capacity and reveal sex-specific molecular and cellular responses through which mitochondrial dysfunction converges on similar motivational deficits.

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

Repository

Its files are read in the Code ↔ Paper reader above.

figshare 32252133

License: CC-BY-4.0
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Languages: R (2)
Size: 9 files, 2 scripts
Software Heritage: not checked
Found in: “Data, Materials, and Software Availability”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: tidyverse (2 files), clusterProfiler (1 file), ComplexHeatmap (1 file), DESeq2 (1 file), ggplot2 (1 file), igraph (1 file), pheatmap (1 file), reshape2 (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
  • 27 September 2026: the link answers (HTTP 200)
2 files

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:

  • 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 2 scripts, each with its path and the digest of its content;
  • no match between paragraphs and code yet;
  • 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, Materials, and Software Availability

Source data for all figures, RiboTag sequencing data, full tables from the bioinformatics analyses, and the R scripts used for the analyses are publicly accessible in Figshare (https://doi.org/10.6084/m9.figshare.32252133) (113).

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

Recorded: type, language, journal, volume, issue, pages, dates, 9 authors, 3 keywords, 12 MeSH terms, 2 funders, 112 references, 1 integrity notice.

Cite

This paper

Chioino, A., Ulgen, D. H., Zanoletti, O., Guillot de Suduiraut, I., Maynard, A. M., Sanz, E., Quintana, A., Astori, S., & Sandi, C. (2026). Mitofusin-2 in ventral striatal D1 neurons regulates effort-based motivation through sex-specific mitochondrial-synaptic reprogramming. Proceedings of the National Academy of Sciences of the United States of America, 123(29), e2601657123. https://doi.org/10.1073/pnas.2601657123

BibTeX

@article{chioino2026mitofusin,
author = {Chioino, Alessandro and Ulgen, Dogukan H and Zanoletti, Olivia and Guillot de Suduiraut, Isabelle and Maynard, Ashley M and Sanz, Elisenda and Quintana, Albert and Astori, Simone and Sandi, Carmen},
title = {{Mitofusin-2 in ventral striatal D1 neurons regulates effort-based motivation through sex-specific mitochondrial-synaptic reprogramming}},
journal = {Proceedings of the National Academy of Sciences of the United States of America},
year = {2026},
month = jul,
volume = {123},
number = {29},
pages = {e2601657123},
publisher = {National Academy of Sciences},
issn = {0027-8424},
doi = {10.1073/pnas.2601657123},
url = {https://doi.org/10.1073/pnas.2601657123},
pmid = {42455671},
pmcid = {PMC13389689}
}

RIS

TY - JOUR
AU - Chioino, Alessandro
AU - Ulgen, Dogukan H
AU - Zanoletti, Olivia
AU - Guillot de Suduiraut, Isabelle
AU - Maynard, Ashley M
AU - Sanz, Elisenda
AU - Quintana, Albert
AU - Astori, Simone
AU - Sandi, Carmen
TI - Mitofusin-2 in ventral striatal D1 neurons regulates effort-based motivation through sex-specific mitochondrial-synaptic reprogramming
T2 - Proceedings of the National Academy of Sciences of the United States of America
J2 - Proc Natl Acad Sci U S A
PY - 2026
DA - 2026/07/15
VL - 123
IS - 29
SP - e2601657123
SN - 0027-8424
PB - National Academy of Sciences
DO - 10.1073/pnas.2601657123
UR - https://doi.org/10.1073/pnas.2601657123
LA - en
ER -

CSL-JSON

{
"id": "10.1073/pnas.2601657123",
"type": "article-journal",
"title": "Mitofusin-2 in ventral striatal D1 neurons regulates effort-based motivation through sex-specific mitochondrial-synaptic reprogramming",
"container-title": "Proceedings of the National Academy of Sciences of the United States of America",
"author": [
{
"family": "Chioino",
"given": "Alessandro"
},
{
"family": "Ulgen",
"given": "Dogukan H"
},
{
"family": "Zanoletti",
"given": "Olivia"
},
{
"family": "Guillot de Suduiraut",
"given": "Isabelle"
},
{
"family": "Maynard",
"given": "Ashley M"
},
{
"family": "Sanz",
"given": "Elisenda"
},
{
"family": "Quintana",
"given": "Albert"
},
{
"family": "Astori",
"given": "Simone"
},
{
"family": "Sandi",
"given": "Carmen"
}
],
"container-title-short": "Proc Natl Acad Sci U S A",
"volume": "123",
"issue": "29",
"page": "e2601657123",
"DOI": "10.1073/pnas.2601657123",
"PMID": "42455671",
"PMCID": "PMC13389689",
"ISSN": "0027-8424",
"publisher": "National Academy of Sciences",
"URL": "https://doi.org/10.1073/pnas.2601657123",
"language": "en",
"issued": {
"date-parts": [
[
2026,
7,
15
]
]
}
}

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.1038/s42003-026-10957-8 [code]
Brain defence by the extracellular matrix protein Cochlin.
Journal: Communications biology
In common: DESeq2, igraph, clusterProfiler, 5 other tools, mouse, cellular / molecular
[2] doi:10.1002/imt2.70163 [code]
Spatial multi-omics unveils sphingolipid metabolic reprogramming within the retinal pathological niche.
Journal: iMeta
In common: DESeq2, igraph, clusterProfiler, 5 other tools, mouse, cellular / molecular
[3] 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: DESeq2, igraph, clusterProfiler, 5 other tools, mouse, cellular / molecular
[4] 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: DESeq2, igraph, clusterProfiler, 5 other tools, cellular / molecular
[5] doi:10.1038/s41386-026-02406-1 [code]
Functional genomic profiling of schizophrenia-associated genes reveals key microglial regulators.
Journal: Neuropsychopharmacology : official publication of the American College of Neuropsychopharmacology
In common: DESeq2, igraph, clusterProfiler, 4 other tools, cellular / molecular, 1 reference
[6] 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: DESeq2, igraph, clusterProfiler, 5 other tools
[7] doi:10.1038/s44318-026-00806-z [code]
Interspecific diversity in the neuronal composition of the mammalian cortex arises from heterochrony in neurogenesis.
Journal: The EMBO journal
In common: DESeq2, igraph, clusterProfiler, 5 other tools
[8] doi:10.1016/j.isci.2026.115657 [code]
Integration of machine learning to develop a disulfidptosis model for predicting glioma prognosis, immunotherapy response, and drug.
Journal: iScience
In common: DESeq2, igraph, clusterProfiler, 5 other tools
[9] doi:10.1038/s41593-026-02300-5 [code]
Integrated single-cell and spatial transcriptomic profiling in ALS uncovers peripheral-to-central immune infiltration and reprogramming.
Journal: Nature neuroscience
In common: DESeq2, igraph, ComplexHeatmap, 4 other tools, cellular / molecular, 1 reference
[10] doi:10.1371/journal.pcbi.1014573 [code]
Cell-type-specific m1A dynamics are associated with microglial phenotypic transition and neuronal metabolic adaptation during spinal cord injury.
Journal: PLoS computational biology
In common: DESeq2, igraph, clusterProfiler, 4 other tools, mouse, cellular / molecular

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.