Transcriptome profiling of human hypothalamic agouti-related protein and proopiomelanocortin neurons regulating energy homeostasis.
6 blocks of code here have a permanent identifier (oscr:b:…), listed with the matches below: citable for good, with a page of its own. Select a match and press Cite to copy it. What a block identifier is.
The 6 matches · 1 of them tie a paragraph to a whole file without given lines: a weak match, whose lines are not tinted
- [1] § Results › Transcription factor profiles differ among neuronal phenotypes ↔ Human_AgRP_POMC_KP_ILCMSeq_codes.R, lines 303 to 347 · score 0.95 · STAT5A, NR3C1, transcription factor, BCL6, CREM, ETV5 · block
oscr:b:MN3K4F9PJV3YV-I· Report a mismatch - [2] § Methods › IHC/LCM-Seq studies of hypothalamic neurons › Bioinformatics ↔ Bash scripts for reanalysis of PRJNA281954.sh, the whole file · a weak match · score 0.72 · featureCounts, Cutadapt, MINLEN, SLIDINGWINDOW, TRAILING, Trimmomatic · block
oscr:b:F34JFA4JJB280-J· Report a mismatch - [3] § Methods › Quantification and statistical analysis ↔ Human_AgRP_POMC_KP_ILCMSeq_codes.R, lines 1 to 78 · score 0.65 · TukeyHSD, way ANOVA, aov · block
oscr:b:5KBQA84WXVF31-M· Report a mismatch - [4] § Methods › IHC/LCM-Seq studies of hypothalamic neurons › Functional classification ↔ Human_AgRP_POMC_KP_ILCMSeq_codes.R, lines 220 to 260 · score 0.58 · KEGG BRITE, ACVR1C, INSR, Neuropeptides, Receptor, KP · block
oscr:b:7SEKG4R53KN5P-6· Report a mismatch - [5] § Methods › IHC/LCM-Seq studies of hypothalamic neurons › Functional classification ↔ R scripts for reanalysis of PRJNA281954.R, lines 230 to 276 · score 0.56 · protein coupled, nuclear receptors, Ensembl, AgRP, TPM · block
oscr:b:TZ2Q30C5R6GGT-K· Report a mismatch - [6] § Methods › GWAS associations ↔ Human_AgRP_POMC_KP_ILCMSeq_codes.R, lines 793 to 852 · score 0.52 · Body weight, disease, Trait, GWAS, enrichment · block
oscr:b:H7CN2NK15WV8Q-Q· Report a mismatch
Paper
Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
R · 1,554 lines · 71 KB · no license · 4 matches
- #Libraries####
- #1.
- library(readxl)
- library(DESeq2)
- library(openxlsx)
- library(tidyverse)
- #2.
- library('ggplot2')
- library('ggfortify')
- library (cluster)
- #3.
- library('pheatmap')
- library('RColorBrewer')
- #5.
- library(ggrepel)
- library("EnhancedVolcano")
- #10.
- library(gridExtra)
- library(ggpubr)
- #14.
- library(eulerr)
- #16.
- library("scales")
- library(fmsb)
- #One-way ANOVA -Fig 1d, Supplementary table 2####
- Ano <- data.frame(read_excel("forANOVAH.xlsx"))
- Ano <- Ano %>%
- pivot_longer(cols = colnames(Ano),
- names_to = "Stage",
- values_to = "RIN")
- Anos <- aov(Ano$RIN~factor(Ano$Stage))
- summary(Anos)
- TukeyHSD(Anos)
- #1.DESeq2 -Fig 2, Supplementary table 4, 5####
- data <- data.frame(read_excel("Human_iLCM_POMC_AgRP_KP_no_multi.xlsx")) #raw reads
- row.names(data) <- data$Geneid
- countS <- data %>% dplyr::select(1,2,3)
- data <- data %>% dplyr::select(4:11)
- colnames(data) = paste0('raw_',colnames(data))
- data$Geneid <- row.names(data)
- countS <- right_join(countS, data)
- row.names(countS) <- countS$Geneid
- data <-data %>% dplyr::select(-"Geneid")
- colnames(data) <- c("AgRP_1","AgRP_2","AgRP_3","POMC_1","POMC_2","KP_1","KP_2","KP_3")
- info = data.frame(smpl=colnames(data))
- rownames(info) = info$smpl
- info$type = gsub('s', '', matrix(unlist(strsplit(info$smpl, '_')), nc=2, byrow=TRUE)[,1])
- info$type = factor(info$type)
- vresTC = tibble(Geneid=rownames(data))
- uni <- unique(info$type)
- dds<- DESeqDataSetFromMatrix(countData =data, colData = info, design = ~type)
- keep <- rowSums(counts(dds) > 5) >= 2
- dds <- dds[keep, ]
- rld <- rlog(dds, blind = FALSE)#->PCA
- for (x in 1:(length(uni)-1)) {
- y = length(uni)-x
- for (z in 1:y){
- a=uni[x]
- b=uni[x+z]
- infoh <-info
- infoh$type = factor(info$type, levels = c(a,b))
- infoh <- infoh %>% filter(is.na(type) != TRUE)
- datah <- data[,infoh$smpl]
- dds<- DESeqDataSetFromMatrix(countData =datah, colData = infoh, design = ~type)
- keep <- rowSums(counts(dds) > 5) >= 2
- dds <- dds[keep, ]
- ddsDE <- DESeq(dds)
- res <- results(ddsDE, alpha=0.05)
- resTC <- as.data.frame(res)
- colnames(resTC) = paste0('Wald_',a,"_vs_",b,"_",colnames(resTC))
- resTC = resTC %>% mutate(Geneid=rownames(.)) %>% as_tibble() %>% dplyr::select(7,2,5,6)
- vresTC = left_join(vresTC, resTC)
- }
- }
- all = left_join(countS, vresTC)
- write.xlsx(all, "1_pairwise_Wald_AgRP_POMC_KP_noFCshrinkage.xlsx")
- #2.PCA -Fig 2e####
- rm <- as.data.frame(assay(rld))#deseq
- pca <-prcomp(t(rm), scale. =FALSE)
- plot(pca$x[,1], pca$x[,2])
- pca.var <- pca$sdev^2
- pca.var.per <- round(pca.var/sum(pca.var)*100, 1)
- barplot(pca.var.per, main="Scree Plot", xlab="Principal Component", ylab="Percent Variation")
- pca.data <- data.frame(Sample=rownames(pca$x),
- X=pca$x[,1],
- Y=pca$x[,2])
- ggplot(data=pca.data, aes(x=X, y=Y, label=Sample))+
- geom_point()+
- ggrepel::geom_label_repel(aes(label = Sample), data = pca.data)+
- xlab(paste("PC1 - ", pca.var.per[1], "%", sep=""))+
- ylab(paste("PC2 - ", pca.var.per[2], "%", sep=""))+
- theme_bw()+
- ggtitle("PCA Graph")
- ttest <- data.frame(t(rm))
- cls <- kmeans(ttest, 3)
- ttest$cluster <- as.character(cls$cluster)
- pca.data <- data.frame(Sample=rownames(pca$x),
- X=pca$x[,1],
- Y=pca$x[,2],
- Cluster=ttest$cluster)
- pcaplot <- ggplot(data=pca.data, aes(x=X, y=Y, label=Sample, color = Cluster))+
- geom_point()+
- ggrepel::geom_label_repel(aes(label = Sample), data = pca.data)+
- xlab(paste("PC1 - ", pca.var.per[1], "%", sep=""))+
- ylab(paste("PC2 - ", pca.var.per[2], "%", sep=""))+
- theme_bw()+
- ggtitle("PCA Graph")
- pdf("2_PCA_plot.pdf")
- print(pcaplot)
- dev.off()
- #3.Heatmap -Fig 3a####
- test <- as.data.frame(assay(rld))
- sign_genes <- all |> filter(Wald_AgRP_vs_POMC_padj < 0.05 | Wald_AgRP_vs_KP_padj < 0.05 | Wald_POMC_vs_KP_padj < 0.05)
- test <- test |> mutate(Geneid = row.names(test))
- test <-left_join(sign_genes[1],test) |> dplyr::select(2:9)
- test <- as.matrix(test)
- pheatmap(test,
- scale = "row",
- color = colorRampPalette(rev(brewer.pal(n =11, name = "RdBu")))(200),
- kmeans_k = 500,
- cellwidth = 20,
- cellheight = 1,
- fontsize = 8,
- border_color = NA,
- clustering_distance_rows = "euclidean",
- clustering_distance_cols = "euclidean",
- clustering_method = "average",
- cutree_cols = 3,
- show_rownames = FALSE,
- fontsize_row = 6,
- fontsize_col = 6,
- filename = "3_pheatmap.pdf")
- #4.TPM calculation -Fig 2f, etc.####
- data <- all %>% dplyr::select(1,4:11)#DEseq
- data <- data |> arrange(Geneid)
- data <- data.frame(data, row.names = 1)
- m = as.matrix(data)
- h_length <- data.frame(read_excel("Human_iLCM_length.xlsx"))#gene lengths obtained via FeatureCounts
- h_length <- h_length |> arrange(Geneid)
- l = h_length$Length / 1000
- RPK = m / l
- counts_tpm = as.data.frame(t(t(RPK) * 1e6 / colSums(RPK)))
- colnames(counts_tpm) = paste0('TPM_', colnames(counts_tpm))
- counts_tpm$ens = rownames(counts_tpm)
- counts_tpm = as_tibble(counts_tpm)
- counts_tpm_ <- counts_tpm %>%
- dplyr::select(ens, )
- nrow(counts_tpm)
- nrow(unique(counts_tpm))
- data <- left_join(all, counts_tpm, by=join_by(Geneid==ens))
- data4 <- data %>% dplyr::select(1:11,21:28,12:20)
- write.xlsx(data4, "4_AgRP_POMC_KP_TPM.xlsx")
- #5.Volcano plots -Fig 3b-e####
- asd <- data.frame(all, row.names = 1)
- asd$external_gene_name <- ifelse(is.na(asd$external_gene_name), row.names(asd), asd$external_gene_name)
- asd <- asd[c(1,11,13,14,16,17,19)]
- colnames(asd) <- c("Gene","Log2FC_AP","padj_AP","Log2FC_AK","padj_AK","Log2FC_PK","padj_PK")
- plotlist <- list()
- for (x in 1:3){
- asdx <- asd %>% filter(asd[2*x+1] < 1.1)
- asdx <- asdx %>% filter(asdx[2*x] < 1000)
- asd5 <- asdx %>% filter(asdx[2*x+1] < 0.05 )
- asd1 <- asd5 %>% arrange(asd5[2*x+1])
- asd1 <- asd1 %>% filter(asd1[2*x]>0)
- asd2 <- asd5 %>% arrange(asd5[2*x])
- asd4 <- asd5 %>% arrange(asd5[2*x+1])
- asd4 <- asd4 %>% filter(asd4[2*x]<0)
- asd3 <- asd5 %>% arrange(desc(asd5[2*x]))
- asd1 <- head(asd1,10)
- asd4 <- head(asd4,10)
- asd2 <- head(asd2,10)
- asd3 <- head(asd3,10)
- asd1 <- full_join(full_join(full_join(asd1, asd2),asd3),asd4)
- Gene <- asd1$Gene
- xx <- colnames(asdx)[2*x]
- yy <- colnames(asdx)[2*x+1]
- plotlist[[x]] <- EnhancedVolcano(asdx,
- lab = asdx$Gene,
- x = xx,
- y = yy,
- # xlim = c(-12, 12),
- # ylim = c(0, 10),
- # ylim = c(0, 35),
- selectLab = Gene,
- labSize = 3.0,
- shape= c(16),
- labCol = 'black',
- labFace = 'bold',
- colAlpha = 1,
- title='', subtitle='',
- pCutoff = 0.05,
- FCcutoff = 1,
- col = c('grey30', 'grey30', 'royalblue', 'red2'),
- pointSize = 1,
- drawConnectors = TRUE,
- widthConnectors = 0.5,
- lengthConnectors = unit(0.01, "npc"),
- arrowheads = TRUE,
- boxedLabels = FALSE,
- max.overlaps = 20,
- legendLabels = c('NS', expression(Log[2]~FC), 'p-value', expression(p-adj.~and~log[2]~FC)),
- legendPosition = 'top',
- directionConnectors = "both",
- legendLabSize = 10,
- legendIconSize = 2.0,
- caption = bquote(~Log[2]~"fold change cutoff: 1; adjusted p-value cutoff: 0.05")
- )
- }
- pdf(paste0("5_Volcano_plots.pdf"))
- for (x in 1:3) {
- print(plotlist[[x]])
- }
- dev.off()
- #6.Categories (multiple from KEGG BRITE or Neuropeptides) -Fig 3f,g, etc.####
- a <- data.frame(read_excel("CAM_human.xlsx"))
- colnames(a) = "external_gene_name"
- b <- data.frame(read_excel("ion_channel_human_kegg_brite.xlsx"))
- colnames(b) = "external_gene_name"
- c <- data.frame(read_excel("Neuropeptides - Homo sapiens (human).xlsx"))#Supplementary table 7
- colnames(c) = "external_gene_name"
- d <- data.frame(read_excel("Human_non_coding.xlsx")) #Supplementary table 9
- d <- d[1]
- colnames(d)[1] = "Geneid"
- e <- data.frame(read_excel("All_receptor_brite+ACVR1C+INSR.xlsx"))#Supplementary table 12
- colnames(e) = "external_gene_name"
- f <- data.frame(read_excel("Tfs_human.xlsx"))# Supplementary table 6
- colnames(f) = "external_gene_name"
- g <- data.frame(read_excel("transporter.xlsx"))
- colnames(g) = "external_gene_name"
- i5 <- data4
- j <- dplyr::select(i5,c(1,2))
- categories <- list()
- categories <- list(a,b,c,d,e,f,g)
- for (x in 1:length(categories)){
- categories[[x]] <- left_join(categories[[x]], j, relationship = "many-to-many")
- }
- k <- i5
- for (x in 1:length(categories)){
- categories[[x]] <- left_join(categories[[x]], k, relationship = "many-to-many")
- }
- for (x in 1:length(categories)){
- categories[[x]]$means_AgRP <- rowMeans(categories[[x]][,c(12:14)],na.rm = TRUE)
- categories[[x]]$means_POMC <- rowMeans(categories[[x]][,c(15:16)],na.rm = TRUE)
- categories[[x]]$means_KP <- rowMeans(categories[[x]][,c(17:19)],na.rm = TRUE)
- categories[[x]]$means_ALL <- rowMeans(categories[[x]][,c(12:19)],na.rm = TRUE)
- categories[[x]] <- categories[[x]][rowSums(categories[[x]][,c(12:19)]) > 0,]
- }
- categorynames <- c("CAMs","Ionch","Neuropep","NoncRNAs","Recept","TransFac","Transp")
- Category_lists <- list()
- for (x in 1:length(categories)){
- Category_lists[[x]] <- assign(categorynames[x],categories[[x]])
- }
- names(Category_lists) <- categorynames
- write.xlsx(Category_lists, file = "6_AgRP_POMC_KP_TPM_categorized.xlsx")
- #7.Top transcription factors -Fig 3f, Supplementary table 6####
- data <- data.frame(Category_lists[[6]])
- data <- data %>%
- unique() %>%
- dplyr::select(1,2,20,22,23,25,26,28, 12:19)
- data$external_gene_name <- ifelse(is.na(data$external_gene_name), data$Geneid, data$external_gene_name)
- data <-data %>% filter(is.na(data$Geneid) == FALSE)
- colnames(data)[9:16] <- c("AgRP_1","AgRP_2","AgRP_3","POMC_1","POMC_2","KP_1","KP_2","KP_3")
- data <- data %>%
- mutate(mnAgRP = rowMeans(data[,9:11], na.rm=TRUE)) %>%
- mutate(mnPOMC = rowMeans(data[,12:13], na.rm=TRUE)) %>%
- mutate(mnKP = rowMeans(data[,14:16], na.rm=TRUE))
- data <- data[rowSums((data[9:11]) > 0) >= 3 | rowSums((data[12:13]) > 0) >= 2 | rowSums((data[14:16]) > 0) >= 3, ]
- data <- data %>% mutate(max_mean = apply(data[17:19], 1, max, na.rm=TRUE))
- dataA <- data %>% arrange(desc(mnAgRP)) %>% head(40)
- dataB <- data %>% arrange(desc(mnPOMC)) %>% head(40)
- dataC <- data %>% arrange(desc(mnKP)) %>% head(40)
- dataG <- full_join(full_join(dataA,dataB),dataC)
- for (x in 1:8) {
- dataG[x+8] = 2* sqrt(dataG[x+8] /pi)
- }
- dataG <- dataG %>% arrange(desc(max_mean))
- dataG <- dataG %>% mutate(Position = row_number())
- dataG <- dataG %>%
- mutate(mnAgRP = rowMeans(dataG[,9:11], na.rm=TRUE)) %>%
- mutate(mnPOMC = rowMeans(dataG[,12:13], na.rm=TRUE)) %>%
- mutate(mnKP = rowMeans(dataG[,14:16], na.rm=TRUE))# %>%
- dataG <- dataG %>% mutate(max_mean = apply(dataG[17:19], 1, max, na.rm=TRUE))
- dataH <- dataG %>%
- pivot_longer(cols = c(mnAgRP,mnPOMC, mnKP),
- names_to = "Cell_type",
- values_to = "TPM")
- dataH$Cell_type <- factor(dataH$Cell_type, levels = c("mnAgRP","mnPOMC", "mnKP"))
- ggplot(data = dataH, aes(reorder(external_gene_name,Position), Cell_type))+
- geom_point(aes(size = TPM, colour = TPM),)+
- scale_color_gradient2(low = '#0000FF', mid = '#FFCCFF', high = '#FF0000', midpoint = median(dataH$max_mean), transform = "log2")+
- scale_size_area(max_size = 12)+
- theme_bw()+
- theme(axis.text.x=element_text(angle=45,hjust=1))
- ggsave("7_dotplot_transfact.pdf", width = 500 , height = 120 , units = "mm")
- #8.Significant Transcription factors heatmap & columns -Fig 3g, Supplementary table 6####
- test <- data.frame(inner_join(data,sign_genes), row.names = 1) %>% dplyr::select(8:15)
- colnames(test) <- c("AgRP_1","AgRP_2","AgRP_3","POMC_1","POMC_2","KP_1","KP_2","KP_3")
- pheatmap(test,
- scale = "row",
- color = colorRampPalette(rev(brewer.pal(n =11, name = "RdBu")))(200),
- cellwidth = 10,
- cellheight = 10,
- fontsize = 8,
- cluster_cols = FALSE,
- clustering_distance_cols = "euclidean",
- clustering_method = "average",
- fontsize_row = 6,
- fontsize_col = 6,
- angle_col = 90,
- gaps_col = c(3,5),
- filename = "8_Pheatmap_TFsign.pdf")
- #'testhead' list from heatmap clustering
- testhead <-c("TSHZ2","ISL1","PROX1","ARID5B","CREB5","CREM","NR3C1","ST18","XBP1","FOXO1","CREB3L2","TFCP2L1","ZBTB16","ETV5","KLF9","OTP","BMAL2","BCL6",
- "ZSCAN30","FOXN2","PBX3","MKX","ETV1","BCL11A","ONECUT1","THRB","ZNF462","LEF1","ZFPM2","ZFHX4","ZNF267","GABPB2","CREBZF","PEG3","L3MBTL4",
- "MITF","SOX1","NHLH2","PGR","AR","ZFHX3","ESR1","PLAGL1","SOX14","ZFP30","MYT1L","STAT5A","PKNOX2","FOXD2","NFKBIE") #FDR < 0.05
- testhead2 <- data.frame(testhead)
- testd <- test |> mutate(
- mnAgRP = rowMeans(test[,1:3], na.rm=TRUE),
- mnPOMC = rowMeans(test[,4:5], na.rm=TRUE),
- mnKP = rowMeans(test[,6:8], na.rm=TRUE)
- )
- testd <- testd |> mutate(
- testhead = row.names(testd))
- testd2 <- left_join(testhead2,testd)
- testh2 <- testd2 %>%
- pivot_longer(cols = c(mnAgRP,mnPOMC, mnKP),
- names_to = "Cell_type",
- values_to = "TPM")
- for (x in c("mnAgRP","mnPOMC","mnKP")) {
- testh <- testh2 |> filter(Cell_type == x)
- testh$testhead <- as.character(testh$testhead)
- testh$testhead <- factor(testh$testhead, levels=unique(testh$testhead))
- ggplot(data = testh)+
- geom_col(aes(x= testhead, y = TPM, fill = 'black'))+
- scale_y_continuous(expand = c(0,0))+
- theme_bw()+
- theme(axis.text.x=element_text(angle=45,hjust=1))
- ggsave(paste0("8_mean_TPMs_",x,"_columns.pdf"), width = 500 , height = 100 , units = "mm")
- }
- #9.Neuropeptides dotplots -Fig 4a, Supplementary table 7####
- data <- data.frame(Category_lists[[3]])
- filter = 40
- data <- data %>%
- unique() %>%
- dplyr::select(1,2,20,22,23,25,26,28,12:19)
- data$external_gene_name <- ifelse(is.na(data$external_gene_name), data$Geneid, data$external_gene_name)
- data <-data %>% filter(is.na(data$Geneid) == FALSE)
- colnames(data)[9:16] <- c("AgRP_1","AgRP_2","AgRP_3","POMC_1","POMC_2","KP_1","KP_2","KP_3")
- data <- data %>%
- mutate(mnAgRP = rowMeans(data[,9:11], na.rm=TRUE)) %>%
- mutate(mnPOMC = rowMeans(data[,12:13], na.rm=TRUE)) %>%
- mutate(mnKP = rowMeans(data[,14:16], na.rm=TRUE))
- data <- data[rowMeans(data[9:11]) >= filter | rowMeans(data[12:13]) >= filter | rowMeans(data[14:16]) >= filter, ]
- data <- data[rowSums((data[9:11]) > 0) >= 3 | rowSums((data[12:13]) > 0) >= 2 | rowSums((data[14:16]) > 0) >= 3, ]
- data <- data %>% mutate(max_mean = apply(data[17:19], 1, max, na.rm=TRUE))
- dataG <- data
- for (x in 1:8) {
- dataG[x+8] = 2* sqrt(dataG[x+8] /pi)
- }
- dataG <- dataG %>% arrange(desc(max_mean))
- dataG <- dataG %>% mutate(Position = row_number())
- dataG <- dataG %>%
- mutate(mnAgRP = rowMeans(dataG[,9:11], na.rm=TRUE)) %>%
- mutate(mnPOMC = rowMeans(dataG[,12:13], na.rm=TRUE)) %>%
- mutate(mnKP = rowMeans(dataG[,14:16], na.rm=TRUE))# %>%
- dataG <- dataG %>% mutate(max_mean = apply(dataG[17:19], 1, max, na.rm=TRUE))
- datah <- dataG[c(1:10),]
- dataH <- datah %>%
- pivot_longer(cols = c(mnAgRP,mnPOMC, mnKP),
- names_to = "Cell_type",
- #values_to = "Diam")
- values_to = "TPM")
- dataH$Cell_type <- factor(dataH$Cell_type, levels = c("mnAgRP","mnPOMC", "mnKP"))
- ggplot(data = dataH, aes(reorder(external_gene_name,Position), Cell_type))+
- geom_point(aes(size = ifelse(TPM==0,NA,TPM), colour = TPM),)+
- scale_color_gradient2(low = '#0000FF', mid = '#FFCCFF', high = '#FF0000', midpoint = mean(dataH$max_mean))+#, transform = "log2")+
- scale_size_area(max_size = 12, transform = "identity" )+
- theme_bw()+
- theme(axis.text.x=element_text(angle=45,hjust=1))
- ggsave("9_dotplot_neuropeptides_1.pdf", width = 500 , height = 120 , units = "mm")
- datah <- dataG[-c(1:10),]
- dataH <- datah %>%
- pivot_longer(cols = c(mnAgRP,mnPOMC, mnKP),
- names_to = "Cell_type",
- #values_to = "Diam")
- values_to = "TPM")
- dataH$Cell_type <- factor(dataH$Cell_type, levels = c("mnAgRP","mnPOMC", "mnKP"))
- ggplot(data = dataH, aes(reorder(external_gene_name,Position), Cell_type))+
- geom_point(aes(size = ifelse(TPM==0,NA,TPM), colour = TPM),)+
- scale_color_gradient2(low = '#0000FF', mid = '#FFCCFF', high = '#FF0000', midpoint = mean(dataH$max_mean))+#, transform = "log2")+
- scale_size_area(max_size = 12, transform = "identity" )+
- theme_bw()+
- theme(axis.text.x=element_text(angle=45,hjust=1))
- ggsave("9_dotplot_neuropeptides_2.pdf", width = 500 , height = 120 , units = "mm")
- #10.Neuropeptides columns -Fig 4b, Supplementary table 7####
- data <- data %>% filter(Wald_AgRP_vs_POMC_padj < 0.05 | Wald_AgRP_vs_KP_padj < 0.05 | Wald_POMC_vs_KP_padj < 0.05)
- plotra <- data %>% dplyr::select(1,17:19,9:16)
- means <- plotra %>% dplyr::select(1:4) %>%
- data.frame(row.names = 1)
- points <- plotra %>% dplyr::select(1,5:12) %>%
- data.frame(row.names = 1)
- means_list <- split(means, rownames(means))
- points_list <- split(points, rownames(points))
- genelist <- list()
- for (i in 1:length(rownames(points))) {
- genelist[[i]] <- assign(rownames(points)[i], as.data.frame(t(points_list[[i]])) %>%
- mutate(names = paste0("mn",as.vector(matrix(unlist(strsplit(colnames(points), '_')), nc=2, byrow=TRUE)[,1]))))
- (colnames(genelist[[i]])[1] = "points")
- }
- names(genelist) <- names(points_list)
- meanlist <- list()
- for (i in 1:length(rownames(means))) {
- meanlist[[i]] <- assign(rownames(means)[i], as.data.frame(t(means_list[[i]])) %>%
- mutate(names = colnames(means)))
- (colnames(meanlist[[i]])[1] = "points")
- }
- names(meanlist) <- names(means_list)
- ly <- c(150,11000,5000,300,
- 300,300,1760,1760,
- 1000,80,33000,400,
- 100,300,1760,6000,
- 800,1500,5000,5000,
- 300,600,100)
- noby <- c(6,6,6,6,
- 6,6,6,6,
- 5,6,6,5,
- 5,6,6,6,
- 4,6,6,6,
- 6,6,5)
- plist <- list()
- for (i in 1:length(rownames(plotra))) {
- meanlist[[i]]$names <- factor(meanlist[[i]]$names,
- levels = colnames(means))
- genelist[[i]]$names <- factor(genelist[[i]]$names,
- levels = colnames(means))
- plist[[i]] <- ggplot()+
- geom_bar(data = meanlist[[i]],
- aes(x=names, y=points ,fill=names),
- stat = "identity",
- show.legend = FALSE#,
- )+
- geom_jitter(data = genelist[[i]],
- aes(x=names, y=points ,fill=names),
- position = position_dodge2(width = 0.3),
- show.legend = FALSE,
- shape = 21,
- size = 1,
- stroke = 0.25)+
- theme_classic()+
- labs(title = names(meanlist)[i], x = NULL, y = NULL) +
- theme(axis.text = element_text(colour = "black"),
- axis.text.x = element_text(colour = "black"),
- axis.text.y = element_text(colour = "black"),
- plot.margin = margin(t = 3, r = 1, b = 5, l = 1) ) +
- theme(panel.grid.major = element_line(colour = NA)) +
- theme(plot.title = element_text(size = 10, hjust = 0.5)) +
- scale_fill_manual(values = c("#B1624E","#5CC8D7","#8CC63F")) +
- theme(axis.ticks = element_line(colour = "black"), plot.background = element_rect(colour = NA)) +
- theme(axis.line = element_line(linewidth = 5), axis.title = element_text(size = 7.5), axis.text = element_text(size = 7.5)) +
- theme(axis.line = element_line(linewidth = 0.1), panel.grid.minor = element_line(colour = NA)) +
- theme(axis.ticks = element_line(linewidth = 0.1),
- axis.text.x = element_blank())+
- scale_y_continuous(n.breaks = 6, expand = c(0,0),limits = c(0, ly[i]))
- }
- ggexport(plotlist = plist, filename = "10_Barplots_sign_neuropeptides.pdf",
- nrow = 4, ncol = 6)
- #11.Receptor ENRICHMENT SORTER with FUNCTION -Fig 7, Supplementary table 12####
- data <- data.frame(Category_lists[[5]])
- rawfilter = 5
- TPMfilter = 10
- lFCfilter = 1
- sorter <- function(data,rawfilter,TPMfilter,lFCfilter){
- datasorter <- data |> filter(
- (means_AgRP > TPMfilter &
- rowSums((data[4:6]) >= rawfilter) >= 3) |
- (means_POMC > TPMfilter &
- rowSums((data[7:8]) >= rawfilter) >= 2) |
- (means_KP > TPMfilter &
- rowSums((data[9:11]) >= rawfilter) >= 3)
- )
- datasorter = unique(datasorter)
- AgRPnull <- datasorter |> filter(
- means_AgRP < TPMfilter |
- rowSums((datasorter[4:6]) >= rawfilter) < 3
- )
- POMCnull <- datasorter |> filter(
- means_POMC < TPMfilter |
- rowSums((datasorter[7:8]) >= rawfilter) < 2
- )
- KPnull <- datasorter |> filter(
- (means_KP < TPMfilter |
- rowSums((datasorter[9:11]) >= rawfilter) < 3)
- )
- AgRPsorted <- inner_join(POMCnull,KPnull) |> filter(
- Wald_AgRP_vs_KP_log2FoldChange < -lFCfilter &
- Wald_AgRP_vs_POMC_log2FoldChange < -lFCfilter
- )
- POMCsorted <- inner_join(AgRPnull,KPnull) |> filter(
- Wald_POMC_vs_KP_log2FoldChange < -lFCfilter &
- Wald_AgRP_vs_POMC_log2FoldChange > lFCfilter
- )
- KPsorted <- inner_join(POMCnull,AgRPnull) |> filter(
- Wald_AgRP_vs_KP_log2FoldChange > lFCfilter &
- Wald_POMC_vs_KP_log2FoldChange > lFCfilter
- )
- AgRPnull <- anti_join(anti_join(AgRPnull,POMCsorted),KPsorted)
- POMCnull <- anti_join(anti_join(POMCnull,AgRPsorted),KPsorted)
- KPnull <- anti_join(anti_join(KPnull,POMCsorted),AgRPsorted)
- AgRPPOMCsorted <- inner_join(POMCnull,KPnull) |> filter(
- (Wald_AgRP_vs_KP_log2FoldChange < -lFCfilter &
- Wald_POMC_vs_KP_log2FoldChange < -lFCfilter) &
- (abs(Wald_AgRP_vs_POMC_log2FoldChange) < abs(Wald_AgRP_vs_KP_log2FoldChange) &
- abs(Wald_AgRP_vs_POMC_log2FoldChange) < abs(Wald_POMC_vs_KP_log2FoldChange))
- )
- AgRPPOMCsorter <- inner_join(AgRPnull,KPnull) |> filter(
- (Wald_AgRP_vs_KP_log2FoldChange < -lFCfilter &
- Wald_POMC_vs_KP_log2FoldChange < -lFCfilter) &
- (abs(Wald_AgRP_vs_POMC_log2FoldChange) < abs(Wald_AgRP_vs_KP_log2FoldChange) &
- abs(Wald_AgRP_vs_POMC_log2FoldChange) < abs(Wald_POMC_vs_KP_log2FoldChange))
- )
- AgRPPOMCsorted <- full_join(AgRPPOMCsorted,AgRPPOMCsorter)
- AgRPKPsorted <- inner_join(POMCnull,KPnull) |> filter(
- (Wald_AgRP_vs_POMC_log2FoldChange < -lFCfilter &
- Wald_POMC_vs_KP_log2FoldChange > lFCfilter) &
- (abs(Wald_AgRP_vs_KP_log2FoldChange) < abs(Wald_AgRP_vs_POMC_log2FoldChange) &
- abs(Wald_AgRP_vs_KP_log2FoldChange) < abs(Wald_POMC_vs_KP_log2FoldChange))
- )
- AgRPKPsorter <- inner_join(AgRPnull,POMCnull) |> filter(
- (Wald_AgRP_vs_POMC_log2FoldChange < -lFCfilter &
- Wald_POMC_vs_KP_log2FoldChange > lFCfilter) &
- (abs(Wald_AgRP_vs_KP_log2FoldChange) < abs(Wald_AgRP_vs_POMC_log2FoldChange) &
- abs(Wald_AgRP_vs_KP_log2FoldChange) < abs(Wald_POMC_vs_KP_log2FoldChange))
- )
- AgRPKPsorted <- full_join(AgRPKPsorted,AgRPKPsorter)
- POMCKPsorted <- inner_join(AgRPnull,KPnull) |> filter(
- (Wald_AgRP_vs_POMC_log2FoldChange > lFCfilter &
- Wald_AgRP_vs_KP_log2FoldChange > lFCfilter) &
- (abs(Wald_POMC_vs_KP_log2FoldChange) < abs(Wald_AgRP_vs_KP_log2FoldChange) &
- abs(Wald_POMC_vs_KP_log2FoldChange) < abs(Wald_AgRP_vs_POMC_log2FoldChange))
- )
- POMCKPsorter <- inner_join(AgRPnull,POMCnull) |> filter(
- (Wald_AgRP_vs_POMC_log2FoldChange > lFCfilter &
- Wald_AgRP_vs_KP_log2FoldChange > lFCfilter) &
- (abs(Wald_POMC_vs_KP_log2FoldChange) < abs(Wald_AgRP_vs_KP_log2FoldChange) &
- abs(Wald_POMC_vs_KP_log2FoldChange) < abs(Wald_AgRP_vs_POMC_log2FoldChange))
- )
- POMCKPsorted <- full_join(POMCKPsorted,POMCKPsorter)
- AgRPnull <- anti_join(anti_join(anti_join(AgRPnull,AgRPPOMCsorted),AgRPKPsorted),POMCKPsorted)
- POMCnull <- anti_join(anti_join(anti_join(POMCnull,AgRPPOMCsorted),AgRPKPsorted),POMCKPsorted)
- KPnull <- anti_join(anti_join(anti_join(KPnull,AgRPPOMCsorted),AgRPKPsorted),POMCKPsorted)
- AgRPsorter <- POMCnull |> filter(
- Wald_AgRP_vs_KP_log2FoldChange < -lFCfilter &
- (means_AgRP > TPMfilter &
- rowSums((POMCnull[4:6]) >= rawfilter) >= 3) &
- (means_KP > TPMfilter &
- rowSums((POMCnull[9:11]) >= rawfilter) >= 3)
- )
- AgRPsorted <- full_join(AgRPsorted,AgRPsorter)
- AgRPsorter <- KPnull |> filter(
- Wald_AgRP_vs_POMC_log2FoldChange < -lFCfilter &
- (means_AgRP > TPMfilter &
- rowSums((KPnull[4:6]) >= rawfilter) >= 3) &
- (means_POMC > TPMfilter &
- rowSums((KPnull[7:8]) >= rawfilter) >= 2)
- )
- AgRPsorted <- full_join(AgRPsorted,AgRPsorter)
- POMCsorter <- AgRPnull |> filter(
- Wald_POMC_vs_KP_log2FoldChange < -lFCfilter &
- (means_POMC > TPMfilter &
- rowSums((AgRPnull[7:8]) >= rawfilter) >= 2) &
- (means_KP > TPMfilter &
- rowSums((AgRPnull[9:11]) >= rawfilter) >= 3)
- )
- POMCsorted <- full_join(POMCsorted,POMCsorter)
- POMCsorter <- KPnull |> filter(
- Wald_AgRP_vs_POMC_log2FoldChange > lFCfilter &
- (means_POMC > TPMfilter &
- rowSums((KPnull[7:8]) >= rawfilter) >= 2) &
- (means_AgRP > TPMfilter &
- rowSums((KPnull[4:6]) >= rawfilter) >= 3)
- )
- POMCsorted <- full_join(POMCsorted,POMCsorter)
- KPsorter <- POMCnull |> filter(
- Wald_AgRP_vs_KP_log2FoldChange > lFCfilter &
- (means_KP > TPMfilter &
- rowSums((POMCnull[9:11]) >= rawfilter) >= 3) &
- (means_AgRP > TPMfilter &
- rowSums((POMCnull[4:6]) >= rawfilter) >= 3)
- )
- KPsorted <- full_join(KPsorted,KPsorter)
- KPsorter <- AgRPnull |> filter(
- Wald_POMC_vs_KP_log2FoldChange > lFCfilter &
- (means_KP > TPMfilter &
- rowSums((AgRPnull[9:11]) >= rawfilter) >= 3) &
- (means_POMC > TPMfilter &
- rowSums((AgRPnull[7:8]) >= rawfilter) >= 2)
- )
- KPsorted <- full_join(KPsorted,KPsorter)
- AgRPnull <- anti_join(anti_join(AgRPnull,POMCsorted),KPsorted)
- POMCnull <- anti_join(anti_join(POMCnull,AgRPsorted),KPsorted)
- KPnull <- anti_join(anti_join(KPnull,POMCsorted),AgRPsorted)
- AgRPPOMCsorter <- KPnull |> filter(
- Wald_AgRP_vs_KP_log2FoldChange < -lFCfilter &
- Wald_POMC_vs_KP_log2FoldChange < -lFCfilter &
- (means_AgRP > TPMfilter &
- rowSums((KPnull[4:6]) >= rawfilter) >= 3)&
- (means_POMC > TPMfilter &
- rowSums((KPnull[7:8]) >= rawfilter) >= 2)
- )
- AgRPPOMCsorted <- full_join(AgRPPOMCsorted,AgRPPOMCsorter)
- AgRPKPsorter <- POMCnull |> filter(
- Wald_AgRP_vs_POMC_log2FoldChange < -lFCfilter &
- Wald_POMC_vs_KP_log2FoldChange > lFCfilter &
- (means_AgRP > TPMfilter &
- rowSums((POMCnull[4:6]) >= rawfilter) >= 3)&
- (means_KP > TPMfilter &
- rowSums((POMCnull[9:11]) >= rawfilter) >= 3)
- )
- AgRPKPsorted <- full_join(AgRPKPsorted,AgRPKPsorter)
- POMCKPsorter <- AgRPnull |> filter(
- Wald_AgRP_vs_KP_log2FoldChange > lFCfilter &
- Wald_AgRP_vs_POMC_log2FoldChange > lFCfilter &
- (means_KP > TPMfilter &
- rowSums((AgRPnull[9:11]) >= rawfilter) >= 3)&
- (means_POMC > TPMfilter &
- rowSums((AgRPnull[7:8]) >= rawfilter) >= 2)
- )
- POMCKPsorted <- full_join(POMCKPsorted,POMCKPsorter)
- Null <- full_join(AgRPnull,full_join(POMCnull,KPnull))
- Sorted <- full_join(full_join(full_join(full_join(full_join(AgRPsorted,AgRPPOMCsorted),AgRPKPsorted),POMCsorted),POMCKPsorted),KPsorted)
- AgRPPOMCKPsorted <- anti_join(Null,Sorted)
- datasorted <- anti_join(anti_join(anti_join(anti_join(anti_join(anti_join(anti_join(anti_join(anti_join(
- datasorter,AgRPsorted),POMCsorted),KPsorted),
- AgRPPOMCsorted),AgRPKPsorted),POMCKPsorted),
- AgRPnull),POMCnull),KPnull)
- AgRPenriched <- datasorted |> filter(
- (Wald_AgRP_vs_POMC_log2FoldChange < -lFCfilter |
- Wald_AgRP_vs_KP_log2FoldChange < -lFCfilter) &
- means_AgRP > TPMfilter &
- rowSums((datasorted[4:6]) > rawfilter) >= 3
- )
- POMCenriched <- datasorted |> filter(
- (Wald_AgRP_vs_POMC_log2FoldChange > lFCfilter |
- Wald_POMC_vs_KP_log2FoldChange < -lFCfilter) &
- means_POMC > TPMfilter &
- rowSums((datasorted[7:8]) > rawfilter) >= 2
- )
- KPenriched <- datasorted |> filter(
- (Wald_AgRP_vs_KP_log2FoldChange > lFCfilter |
- Wald_POMC_vs_KP_log2FoldChange > lFCfilter) &
- means_KP > TPMfilter &
- rowSums((datasorted[9:11]) > rawfilter) >= 3
- )
- AgRPPOMCsorter <- inner_join(AgRPenriched,POMCenriched)
- AgRPPOMCsorter <- AgRPPOMCsorter |> filter(
- abs(Wald_AgRP_vs_POMC_log2FoldChange) < abs(Wald_AgRP_vs_KP_log2FoldChange) &
- abs(Wald_AgRP_vs_POMC_log2FoldChange) < abs(Wald_POMC_vs_KP_log2FoldChange)
- )
- AgRPPOMCsorted <- full_join(AgRPPOMCsorted,AgRPPOMCsorter)
- AgRPKPsorter <- inner_join(AgRPenriched,KPenriched)
- AgRPKPsorter <- AgRPKPsorter |> filter(
- abs(Wald_AgRP_vs_KP_log2FoldChange) < abs(Wald_AgRP_vs_POMC_log2FoldChange) &
- abs(Wald_AgRP_vs_KP_log2FoldChange) < abs(Wald_POMC_vs_KP_log2FoldChange)
- )
- AgRPKPsorted <- full_join(AgRPKPsorted,AgRPKPsorter)
- POMCKPsorter <- inner_join(POMCenriched,KPenriched)
- POMCKPsorter <- POMCKPsorter |> filter(
- abs(Wald_POMC_vs_KP_log2FoldChange) < abs(Wald_AgRP_vs_POMC_log2FoldChange) &
- abs(Wald_POMC_vs_KP_log2FoldChange) < abs(Wald_AgRP_vs_KP_log2FoldChange)
- )
- POMCKPsorted <- full_join(POMCKPsorted,POMCKPsorter)
- AgRPsorter <- datasorted |> filter(
- (Wald_AgRP_vs_POMC_log2FoldChange < -lFCfilter &
- Wald_AgRP_vs_KP_log2FoldChange < -lFCfilter) &
- means_AgRP > TPMfilter &
- rowSums((datasorted[4:6]) > rawfilter) >= 3
- )
- POMCsorter <- datasorted |> filter(
- (Wald_AgRP_vs_POMC_log2FoldChange > lFCfilter &
- Wald_POMC_vs_KP_log2FoldChange < -lFCfilter) &
- means_POMC > TPMfilter &
- rowSums((datasorted[7:8]) > rawfilter) >= 2
- )
- KPsorter <- datasorted |> filter(
- (Wald_AgRP_vs_KP_log2FoldChange > lFCfilter &
- Wald_POMC_vs_KP_log2FoldChange > lFCfilter) &
- means_KP > TPMfilter &
- rowSums((datasorted[9:11]) > rawfilter) >= 3
- )
- AgRPsorter <- AgRPsorter |> filter(
- abs(Wald_AgRP_vs_POMC_log2FoldChange) > abs(Wald_POMC_vs_KP_log2FoldChange) &
- abs(Wald_AgRP_vs_KP_log2FoldChange) > abs(Wald_POMC_vs_KP_log2FoldChange)
- )
- POMCsorter <- POMCsorter |> filter(
- abs(Wald_AgRP_vs_POMC_log2FoldChange) > abs(Wald_AgRP_vs_KP_log2FoldChange) &
- abs(Wald_POMC_vs_KP_log2FoldChange) > abs(Wald_AgRP_vs_KP_log2FoldChange)
- )
- KPsorter <- KPsorter |> filter(
- abs(Wald_AgRP_vs_KP_log2FoldChange) > abs(Wald_AgRP_vs_POMC_log2FoldChange) &
- abs(Wald_POMC_vs_KP_log2FoldChange) > abs(Wald_AgRP_vs_POMC_log2FoldChange)
- )
- AgRPsorter <- anti_join(anti_join(AgRPsorter,AgRPPOMCsorter),AgRPKPsorter)
- POMCsorter <- anti_join(anti_join(POMCsorter,AgRPPOMCsorter),POMCKPsorter)
- KPsorter <- anti_join(anti_join(KPsorter,POMCKPsorter),AgRPKPsorter)
- AgRPsorted <- full_join(AgRPsorted,AgRPsorter)
- POMCsorted <- full_join(POMCsorted,POMCsorter)
- KPsorted <- full_join(KPsorted,KPsorter)
- AgRPPOMCKPsorter <- anti_join(datasorted, unique(full_join(full_join(full_join(full_join(full_join(
- AgRPsorted,POMCsorted),KPsorted),
- AgRPPOMCsorted),AgRPKPsorted),POMCKPsorted
- )))
- AgRPPOMCKPsorted <- full_join(AgRPPOMCKPsorted,AgRPPOMCKPsorter)
- sorted <- list(AgRPsorted,POMCsorted,KPsorted,AgRPPOMCsorted,AgRPKPsorted,POMCKPsorted,AgRPPOMCKPsorted)
- sortednames <- c("AgRPsorted","POMCsorted","KPsorted","AgRPPOMCsorted","AgRPKPsorted","POMCKPsorted","AGRPPOMCKPsorted")
- sorted_list <- list()
- for (x in 1:length(sorted)){
- sorted_list[[x]] <- assign(sortednames[x],sorted[[x]])
- }
- names(sorted_list) <- sortednames
- return(sorted_list)
- }
- sorted_list_rec <- sorter(data,rawfilter,TPMfilter,lFCfilter)
- write.xlsx(sorted_list_rec, file = paste0("11_Receptors_sorted_rawreadfilter",rawfilter,"_meanTPMfilter",TPMfilter,"_lFCfilter",lFCfilter,"_0523.xlsx"))
- #12.Receptors dotplots -Fig 7, Supplementary table 12####
- datasorter <- data.frame(Category_lists[[5]])
- datasorter <- datasorter |> filter(
- (means_AgRP > TPMfilter &
- rowSums((datasorter[4:6]) >= rawfilter) >= 3) |
- (means_POMC > TPMfilter &
- rowSums((datasorter[7:8]) >= rawfilter) >= 2) |
- (means_KP > TPMfilter &
- rowSums((datasorter[9:11]) >= rawfilter) >= 3)
- )
- datasorter = unique(datasorter)
- #write.xlsx(datasorter, file = paste0("12_Receptors_sorted_rawreadfilter",rawfilter,"_meanTPMfilter",TPMfilter,"_lFCfilter",lFCfilter,".xlsx"))
- colnames(datasorter)[29:31] <- c("mnAgRP","mnPOMC","mnKP")
- datasorter <- datasorter %>% mutate(max_mean = apply(datasorter[29:31], 1, max, na.rm=TRUE))
- dataG <- datasorter
- dataG <- dataG %>% arrange(desc(max_mean))
- dataG <- dataG %>% mutate(Position = row_number())
- dataH <- dataG %>%
- pivot_longer(cols = c(mnAgRP,mnPOMC, mnKP),
- names_to = "Cell_type",
- values_to = "TPM")
- dataH$Cell_type <- factor(dataH$Cell_type, levels = c("mnAgRP","mnPOMC", "mnKP"))
- dataM <- dataH
- list_of_plots = list()
- list_of_plots[[1]] <- ggplot(data = dataH[dataH$external_gene_name == "ACVR1C",], aes(reorder(external_gene_name,Position), Cell_type))+
- geom_point(aes(size = ifelse(TPM==0,NA,TPM), colour = TPM),)+
- scale_color_gradient2(low = '#0000FF', mid = '#FFCCFF', high = '#FF0000', midpoint = median(dataM$max_mean))+#, transform = "log2")+
- scale_size_area(max_size = 12, transform = "identity" )+
- theme_bw()+
- theme(axis.text.x=element_text(hjust=1))#, angle=45))
- dataH = dataH[dataH$external_gene_name != "ACVR1C",]
- list_of_plots[[2]] <- ggplot(data = dataH[1:45,], aes(reorder(external_gene_name,Position), Cell_type))+
- geom_point(aes(size = ifelse(TPM==0,NA,TPM), colour = TPM),)+
- scale_color_gradient2(low = '#0000FF', mid = '#FFCCFF', high = '#FF0000', midpoint = median(dataM$max_mean))+#, transform = "log2")+
- scale_size_area(max_size = 12, transform = "identity" )+
- theme_bw()+
- theme(axis.text.x=element_text(hjust=1))#, angle=45))
- dataH = dataH[-c(1:45),]
- for (x in 1:9) {
- a = x*63-62 #x*y-(y-1)
- b = x*63 #x*y
- dataI = dataH[a:b,]
- plot <- ggplot(data = dataI, aes(reorder(external_gene_name,Position), Cell_type))+
- geom_point(aes(size = ifelse(TPM==0,NA,TPM), colour = TPM),)+
- scale_color_gradient2(low = '#0000FF', mid = '#FFCCFF', high = '#FF0000', midpoint = median(dataM$max_mean))+#, transform = "log2")+
- scale_size_area(max_size = 12, transform = "identity" )+
- theme_bw()+
- theme(axis.text.x=element_text(hjust=1))#, angle=45))
- list_of_plots[[x+2]] <- assign(paste0(x+2, ". receptors"),plot)
- }
- ggsave(
- filename = "12_Receptors_0523.pdf",
- plot = marrangeGrob(list_of_plots, nrow=1, ncol=1),
- width = 11.5, height = 2.5
- )
- #13.GWAS sorted enrichment -Fig 6, Table 1, Supplementary table 10, 11####
- APfilter1 = rawfilter
- APfilter2 = TPMfilter
- A <- data.frame(read_excel("Visceral_Adipose_Tissue_Quantity.xlsx"))
- B <- data.frame(read_excel("Waist_Circumference.xlsx"))
- C <- data.frame(read_excel("Hip_Circumference.xlsx"))
- D <- data.frame(read_excel("Fat_Pad_Mass.xlsx"))
- E <- data.frame(read_excel("Overnutrition.xlsx"))
- F <- data.frame(read_excel("Abdominal_Adipose_Tissue_Measurement.xlsx"))
- G <- data.frame(read_excel("Body_Fat_Percentage.xlsx"))
- H <- data.frame(read_excel("Eating_Disorder.xlsx"))
- I <- data.frame(read_excel("Waist-Hip_Ratio.xlsx"))
- J <- data.frame(read_excel("Body_Mass_Index.xlsx"))
- K <- data.frame(read_excel("Metabolic_Syndrome.xlsx"))
- S <- data.frame(read_excel("BMI-adjusted_hip_circumference.tsv.xlsx"))
- T <- data.frame(read_excel("BMI-adjusted_waist_circumference.tsv.xlsx"))
- U <- data.frame(read_excel("Body_weight_without child traits.tsv.xlsx"))
- M <- data4
- M <- M |> filter(Wald_AgRP_vs_POMC_log2FoldChange < 1000 | Wald_AgRP_vs_KP_log2FoldChange < 1000 | Wald_POMC_vs_KP_log2FoldChange < 1000)
- a <- A$DISEASE.TRAIT %>% unique()
- b <- B$DISEASE.TRAIT %>% unique()
- c <- C$DISEASE.TRAIT %>% unique()
- d <- D$DISEASE.TRAIT %>% unique()
- e <- E$DISEASE.TRAIT %>% unique()
- f <- F$DISEASE.TRAIT %>% unique()
- g <- G$DISEASE.TRAIT %>% unique()
- h <- H$DISEASE.TRAIT %>% unique()
- i <- I$DISEASE.TRAIT %>% unique()
- j <- J$DISEASE.TRAIT %>% unique()
- k <- K$DISEASE.TRAIT %>% unique()
- s <- S$DISEASE.TRAIT %>% unique()
- t <- T$DISEASE.TRAIT %>% unique()
- u <- U$DISEASE.TRAIT %>% unique()
- A$CHR_ID <- as.character(A$CHR_ID)
- B$CHR_ID <- as.character(B$CHR_ID)
- C$CHR_ID <- as.character(C$CHR_ID)
- D$CHR_ID <- as.character(D$CHR_ID)
- E$CHR_ID <- as.character(E$CHR_ID)
- F$CHR_ID <- as.character(F$CHR_ID)
- G$CHR_ID <- as.character(G$CHR_ID)
- H$CHR_ID <- as.character(H$CHR_ID)
- I$CHR_ID <- as.character(I$CHR_ID)
- J$CHR_ID <- as.character(J$CHR_ID)
- K$CHR_ID <- as.character(K$CHR_ID)
- S$CHR_ID <- as.character(S$CHR_ID)
- T$CHR_ID <- as.character(T$CHR_ID)
- U$CHR_ID <- as.character(U$CHR_ID)
- A$CHR_POS <- as.character(A$CHR_POS)
- B$CHR_POS <- as.character(B$CHR_POS)
- C$CHR_POS <- as.character(C$CHR_POS)
- D$CHR_POS <- as.character(D$CHR_POS)
- E$CHR_POS <- as.character(E$CHR_POS)
- F$CHR_POS <- as.character(F$CHR_POS)
- G$CHR_POS <- as.character(G$CHR_POS)
- H$CHR_POS <- as.character(H$CHR_POS)
- I$CHR_POS <- as.character(I$CHR_POS)
- J$CHR_POS <- as.character(J$CHR_POS)
- K$CHR_POS <- as.character(K$CHR_POS)
- S$CHR_POS <- as.character(S$CHR_POS)
- T$CHR_POS <- as.character(T$CHR_POS)
- U$CHR_POS <- as.character(U$CHR_POS)
- A$RISK.ALLELE.FREQUENCY <- as.character(A$RISK.ALLELE.FREQUENCY)
- B$RISK.ALLELE.FREQUENCY <- as.character(B$RISK.ALLELE.FREQUENCY)
- C$RISK.ALLELE.FREQUENCY <- as.character(C$RISK.ALLELE.FREQUENCY)
- D$RISK.ALLELE.FREQUENCY <- as.character(D$RISK.ALLELE.FREQUENCY)
- E$RISK.ALLELE.FREQUENCY <- as.character(E$RISK.ALLELE.FREQUENCY)
- F$RISK.ALLELE.FREQUENCY <- as.character(F$RISK.ALLELE.FREQUENCY)
- G$RISK.ALLELE.FREQUENCY <- as.character(G$RISK.ALLELE.FREQUENCY)
- H$RISK.ALLELE.FREQUENCY <- as.character(H$RISK.ALLELE.FREQUENCY)
- I$RISK.ALLELE.FREQUENCY <- as.character(I$RISK.ALLELE.FREQUENCY)
- J$RISK.ALLELE.FREQUENCY <- as.character(J$RISK.ALLELE.FREQUENCY)
- K$RISK.ALLELE.FREQUENCY <- as.character(K$RISK.ALLELE.FREQUENCY)
- S$RISK.ALLELE.FREQUENCY <- as.character(S$RISK.ALLELE.FREQUENCY)
- T$RISK.ALLELE.FREQUENCY <- as.character(T$RISK.ALLELE.FREQUENCY)
- U$RISK.ALLELE.FREQUENCY <- as.character(U$RISK.ALLELE.FREQUENCY)
- L <- full_join(A,full_join(B,full_join(C,full_join(D,full_join(E,full_join(F,full_join(G,full_join(H,full_join(I,full_join(J,full_join(K,full_join(S,full_join(T,U)))))))))))))
- L <- unique(L)
- l <- L$MAPPED_TRAIT %>% unique()
- N <- L %>% filter(L$P.VALUE < 5*10^-8)#GWAS filter
- n <- N$SNP_GENE_IDS %>% unique()
- n <- n[is.na(n) == FALSE]
- n1 <- n[grepl(" - ",n) == FALSE]
- n11 <- n1[grepl(",",n1)]
- n12 <- n1[grepl(";",n1)]
- n1 <- n1[grepl(",",n1) == FALSE]
- n1 <- n1[grepl(";",n1) == FALSE]
- n1 <- n1[grepl(" x ",n1) == FALSE]
- n1 <- as.data.frame(n1)
- n12 <- as.data.frame(n12)
- n12 <- separate_longer_delim(cols = "n12", delim = "; ", n12) %>% unique()
- n1 <- full_join(n1, n12, by = join_by(n1 == n12))
- n11 <- as.data.frame(n11)
- n11 <- separate_longer_delim(cols = "n11", delim = ", ", n11) %>% unique()
- n1 <- full_join(n1, n11, by = join_by(n1 == n11))
- n1 <- unique(n1)
- M$means_AgRP <- rowMeans(M[,c(12:14)],na.rm = TRUE)
- M$means_POMC <- rowMeans(M[,c(15:16)],na.rm = TRUE)
- M$means_KP <- rowMeans(M[,c(17:19)],na.rm = TRUE)
- M$means_ALL <- rowMeans(M[,c(12:19)],na.rm = TRUE)
- sorted_list <- sorter(M,APfilter1,APfilter2,lFCfilter)
- AgRPgenelist <- sorted_list$AgRPsorted
- POMCgenelist <- sorted_list$POMCsorted
- KPgenelist <- sorted_list$KPsorted
- AgRPPOMCgenelist <- sorted_list$AgRPPOMCsorted
- AgRPKPgenelist <- sorted_list$AgRPKPsorted
- POMCKPgenelist <- sorted_list$POMCKPsorted
- AgRPPOMCKPgenelist <-sorted_list$AGRPPOMCKPsorted
- AgRPGWAS <- inner_join(AgRPgenelist, n1, by = join_by(Geneid == n1)) %>% dplyr::select(1,2,3) %>% mutate(popul = "AgRP")
- POMCGWAS <- inner_join(POMCgenelist, n1, by = join_by(Geneid == n1)) %>% dplyr::select(1,2,3) %>% mutate(popul = "POMC")
- KPGWAS <- inner_join(KPgenelist, n1, by = join_by(Geneid == n1)) %>% dplyr::select(1,2,3) %>% mutate(popul = "KP")
- AgRPPOMCGWAS <- inner_join(AgRPPOMCgenelist, n1, by = join_by(Geneid == n1)) %>% dplyr::select(1,2,3) %>% mutate(popul = "AgRP-POMC")
- AgRPKPGWAS <- inner_join(AgRPKPgenelist, n1, by = join_by(Geneid == n1)) %>% dplyr::select(1,2,3) %>% mutate(popul = "AgRP-KP")
- POMCKPGWAS <- inner_join(POMCKPgenelist, n1, by = join_by(Geneid == n1)) %>% dplyr::select(1,2,3) %>% mutate(popul = "POMC-KP")
- AgRPPOMCKPGWAS <-inner_join(AgRPPOMCKPgenelist, n1, by = join_by(Geneid == n1)) %>% dplyr::select(1,2,3) %>% mutate(popul = "AgRP-POMC-KP")
- GWAScelltype <- full_join(full_join(full_join(full_join(full_join(full_join(AgRPGWAS,POMCGWAS),KPGWAS),AgRPPOMCGWAS),AgRPKPGWAS),POMCKPGWAS),AgRPPOMCKPGWAS)
- N <- N %>% mutate(exact_gene = NA, searched_genes = NA, neuron_type = NA)
- for (x in 1:length(N$SNP_GENE_IDS)) {
- for (y in 1:length(GWAScelltype$Geneid)) {
- if(grepl(paste0("^", GWAScelltype[y,1], "$"), N$SNP_GENE_IDS[x]) > 0){
- N$exact_gene[x] = GWAScelltype[y,1]
- #N$searched_genes = #add gene string to dataframe cell, de itt nem kell
- N$neuron_type[x] = GWAScelltype[y,4]
- } else if(grepl(GWAScelltype[y,1], N$SNP_GENE_IDS[x]) > 0){
- N$searched_genes[x] = paste0(N$searched_genes[x], " _ ", GWAScelltype[y,1])
- if(is.na(N$neuron_type[x]) == TRUE){
- N$neuron_type[x] = GWAScelltype[y,4]
- }
- } else {}
- }
- }
- Q = list(A,B,C,D,E,F,G,H,I,J,K,S,T,U)
- for (x in 1:length(Q)) {
- Q[[x]] = left_join(Q[[x]],N)
- }
- q = c("VATQ","WC","HC","FPM","On","AATM","BFP","ED","WHR","BMI","MS","BaHC","BaWC","BWwoct")
- Trait_lists <- list()
- for (x in 1:length(q)){
- Trait_lists[[x]] <- assign(q[x],Q[[x]])
- }
- names(Trait_lists) <- q
- write.xlsx(Trait_lists, file = paste0("13_GWAS_trait_lists_rawreadfilter",APfilter1,"_meanTPMfilter",APfilter2,"_lFCfilter",lFCfilter,"_0523.xlsx"))#
- for (x in 1:length(Trait_lists)) {
- Trait_lists[[x]] <- Trait_lists[[x]] %>% arrange(P.VALUE) %>% arrange(SNP_GENE_IDS)
- for (y in 2:length(Trait_lists[[x]]$SNP_GENE_IDS)) {
- if (is.na(Trait_lists[[x]]$SNP_GENE_IDS[y]) ==FALSE & Trait_lists[[x]]$SNP_GENE_IDS[y] == Trait_lists[[x]]$SNP_GENE_IDS[y-1]){
- Trait_lists[[x]]$PUBMEDID[y] <- "XXXXXXXXXXXXXXX"
- }
- }
- Trait_lists[[x]] <- Trait_lists[[x]] %>% filter(PUBMEDID != "XXXXXXXXXXXXXXX") %>% filter(is.na(SNP_GENE_IDS) == FALSE)
- }
- write.xlsx(Trait_lists, file = paste0("13_GWAS_trait_lists_rawreadfilter",APfilter1,"_meanTPMfilter",APfilter2,"_lFCfilter",lFCfilter,"_UNIQUE_0523.xlsx"))#
- R = list(AgRPGWAS,POMCGWAS,KPGWAS,AgRPPOMCGWAS,AgRPKPGWAS,POMCKPGWAS,AgRPPOMCKPGWAS)
- for (x in 1:length(R)) {
- R[[x]] = left_join(R[[x]], M)
- }
- r = c("AgRPGWAS","POMCGWAS","KPGWAS","AgRPPOMCGWAS","AgRPKPGWAS","POMCKPGWAS","AgRPPOMCKPGWAS")
- AgRPPOMC_GWAS_lists <- list()
- for (x in 1:length(r)){
- AgRPPOMC_GWAS_lists[[x]] <- assign(r[x],R[[x]])
- }
- names(AgRPPOMC_GWAS_lists) <- r
- V = list(AgRPgenelist,POMCgenelist,KPgenelist,AgRPPOMCgenelist,AgRPKPgenelist,POMCKPgenelist,AgRPPOMCKPgenelist)
- for (x in 1:length(R)) {
- V[[x]] = left_join(V[[x]], R[[x]])
- }
- v = c("AgRPgenelist","POMCgenelist","KPgenelist","AgRPPOMCgenelist","AgRPKPgenelist","POMCKPgenelist","AgRPPOMCKPgenelist")
- AgRPPOMC_genelist_lists <- list()
- for (x in 1:length(v)){
- AgRPPOMC_genelist_lists[[x]] <- assign(v[x],V[[x]])
- }
- names(AgRPPOMC_genelist_lists) <- v
- Numbers <- data.frame(matrix(ncol=14,nrow=17, dimnames=list(NULL, q)))
- row.names(Numbers) <- c("Sign_SNP_GENE_IDS","Exact_gene_match","Exact_gene_match_AgRP","Exact_gene_match_POMC","Exact_gene_match_KP"
- ,"Exact_gene_match_AgRP_POMC","Exact_gene_match_AgRP_KP","Exact_gene_match_POMC_KP","Exact_gene_match_AgRP_POMC_KP"
- ,"Total_gene_match","Total_gene_match_AgRP","Total_gene_match_POMC","Total_gene_match_KP"
- ,"Total_gene_match_AgRP_POMC","Total_gene_match_AgRP_KP","Total_gene_match_POMC_KP","Total_gene_match_AgRP_POMC_KP")
- Numbers <- data.frame(t(Numbers))
- Genelists <- list()
- for (z in 1:length(Trait_lists)) {
- AA <- Trait_lists[[z]]
- AA <- AA %>% filter(P.VALUE < 5*10^-8)
- AA <- AA %>% dplyr::select(18,39,40,41) %>% unique()
- aa <- AA %>% dplyr::select(1) %>% unique()
- if(length(aa$SNP_GENE_IDS) != length(AA$SNP_GENE_IDS)){print("not unique genes ")
- print(z)}
- AA1 <- AA[is.na(AA$SNP_GENE_IDS)==FALSE,] %>% unique()
- Numbers$Sign_SNP_GENE_IDS[z] <- rbind(length(AA1$SNP_GENE_IDS))
- AA2 <- AA1[is.na(AA1$exact_gene)==FALSE,]
- Numbers$Exact_gene_match[z] <- length(AA2$SNP_GENE_IDS)
- AA3 <- AA2[grepl("AgRP-POMC", AA2$neuron_type) == FALSE &
- grepl("AgRP-KP", AA2$neuron_type) == FALSE &
- grepl("AgRP-POMC-KP", AA2$neuron_type) == FALSE &
- grepl("AgRP", AA2$neuron_type),]
- Numbers$Exact_gene_match_AgRP[z] <- length(AA3$SNP_GENE_IDS)
- AA4 <- AA2[grepl("AgRP-POMC", AA2$neuron_type) == FALSE &
- grepl("POMC-KP", AA2$neuron_type) == FALSE &
- grepl("AgRP-POMC-KP", AA2$neuron_type) == FALSE &
- grepl("POMC", AA2$neuron_type),]
- Numbers$Exact_gene_match_POMC[z] <- length(AA4$SNP_GENE_IDS)
- AA5 <- AA2[grepl("AgRP-KP", AA2$neuron_type) == FALSE &
- grepl("POMC-KP", AA2$neuron_type) == FALSE &
- grepl("AgRP-POMC-KP", AA2$neuron_type) == FALSE &
- grepl("KP", AA2$neuron_type),]
- Numbers$Exact_gene_match_KP[z] <- length(AA5$SNP_GENE_IDS)
- AA6 <- AA2[grepl("AgRP-POMC-KP", AA2$neuron_type) == FALSE &
- grepl("AgRP-POMC", AA2$neuron_type),]
- Numbers$Exact_gene_match_AgRP_POMC[z] <- length(AA6$SNP_GENE_IDS)
- AA7 <- AA2[grepl("AgRP-KP", AA2$neuron_type),]
- Numbers$Exact_gene_match_AgRP_KP[z] <- length(AA7$SNP_GENE_IDS)
- AA8 <- AA2[grepl("AgRP-POMC-KP", AA2$neuron_type) == FALSE &
- grepl("POMC-KP", AA2$neuron_type),]
- Numbers$Exact_gene_match_POMC_KP[z] <- length(AA8$SNP_GENE_IDS)
- AA9 <- AA2[grepl("AgRP-POMC-KP", AA2$neuron_type),]
- Numbers$Exact_gene_match_AgRP_POMC_KP[z] <- length(AA9$SNP_GENE_IDS)
- AA15 <- AA1[is.na(AA1$exact_gene) & is.na(AA1$searched_genes) ==FALSE, ]
- if (length(AA15$SNP_GENE_IDS) >0){
- #AA_neutype_sum_exceptions <- length(AA15$SNP_GENE_IDS)
- AA15$searched_genes <- gsub("NA _ ", "", AA15$searched_genes)
- aa15 <- AA15$searched_genes
- aa15 <- separate_longer_delim(AA15, cols = 'searched_genes', delim = " _ ") %>% unique()
- aa15 <- separate_longer_delim(aa15, cols = 'SNP_GENE_IDS', delim = ", ") %>% unique()
- aa15 <- aa15[aa15$SNP_GENE_IDS == aa15$searched_genes,] %>% unique()
- AA16 <- NA
- if (is.na(aa15$searched_genes[1]) == FALSE) {
- for (x in 1:length(aa15$searched_genes)) {
- for (y in 1:length(AA15$SNP_GENE_IDS)) {
- if (grepl(aa15$searched_genes[x], AA15$SNP_GENE_IDS[y])){
- AA16 <- rbind(AA16, aa15[x,])
- }}
- }
- AA16 <-AA16[is.na(AA16$SNP_GENE_IDS) == FALSE,]
- AA16 <- unique(AA16)
- AA2 <- rbind(AA2, AA16) %>% unique()
- AA18 <- AA16[grepl("AgRP-POMC", AA16$neuron_type) == FALSE &
- grepl("AgRP-KP", AA16$neuron_type) == FALSE &
- grepl("AgRP-POMC-KP", AA16$neuron_type) == FALSE &
- grepl("AgRP", AA16$neuron_type),]
- AA3 <- rbind(AA3, AA18) %>% unique()
- AA19 <- AA16[grepl("AgRP-POMC", AA16$neuron_type) == FALSE &
- grepl("POMC-KP", AA16$neuron_type) == FALSE &
- grepl("AgRP-POMC-KP", AA16$neuron_type) == FALSE &
- grepl("POMC", AA16$neuron_type),]
- AA4 <- rbind(AA4, AA19) %>% unique()
- AA17 <- AA16[grepl("AgRP-KP", AA16$neuron_type) == FALSE &
- grepl("POMC-KP", AA16$neuron_type) == FALSE &
- grepl("AgRP-POMC-KP", AA16$neuron_type) == FALSE &
- grepl("KP", AA16$neuron_type),]
- AA5 <- rbind(AA5, AA17) %>% unique()
- AA14 <- AA16[grepl("AgRP-POMC-KP", AA16$neuron_type) == FALSE &
- grepl("AgRP-POMC", AA16$neuron_type),]
- AA6 <- rbind(AA6, AA14) %>% unique()
- AA13 <- AA16[grepl("AgRP-KP", AA16$neuron_type),]
- AA7 <- rbind(AA7, AA13) %>% unique()
- AA12 <- AA16[grepl("AgRP-POMC-KP", AA16$neuron_type) == FALSE &
- grepl("POMC-KP", AA16$neuron_type),]
- AA8 <- rbind(AA8, AA12) %>% unique()
- AA11 <- AA16[grepl("AgRP-POMC-KP", AA16$neuron_type),]
- AA9 <- rbind(AA9, AA11) %>% unique()
- }}
- Numbers$Total_gene_match[z] <- length(AA2$SNP_GENE_IDS)
- Numbers$Total_gene_match_AgRP[z] <- length(AA3$SNP_GENE_IDS)
- Numbers$Total_gene_match_POMC[z] <- length(AA4$SNP_GENE_IDS)
- Numbers$Total_gene_match_KP[z] <- length(AA5$SNP_GENE_IDS)
- Numbers$Total_gene_match_AgRP_POMC[z] <- length(AA6$SNP_GENE_IDS)
- Numbers$Total_gene_match_AgRP_KP[z] <- length(AA7$SNP_GENE_IDS)
- Numbers$Total_gene_match_POMC_KP[z] <- length(AA8$SNP_GENE_IDS)
- Numbers$Total_gene_match_AgRP_POMC_KP[z] <- length(AA9$SNP_GENE_IDS)
- AA20 <- AA2 %>% mutate(Geneid = paste(exact_gene, searched_genes)) %>% dplyr::select(5)
- AA20$Geneid <- gsub(" NA", "", AA20$Geneid)
- AA20$Geneid <- gsub("NA ", "", AA20$Geneid)
- colnames(AA20) <- names(Trait_lists[z])
- Genelists[[z]] <- assign(names(Trait_lists[z]),AA20)
- }
- Numbers <- Numbers %>% mutate(Traits = row.names(Numbers)) %>% dplyr::select(18,1:17)
- write.xlsx(Numbers, file = paste0("13_GWAS_venn_numbers_rawreadfilter",APfilter1,"_meanTPMfilter",APfilter2,"_lFCfilter",lFCfilter,"_0523.xlsx"))#
- for (x in 1:length(Genelists)) {
- Genelists[[x]] <- Genelists[[x]] %>% mutate(Trait = names(Genelists[[x]]))
- colnames(Genelists[[x]])[1] <- "Geneid"
- }
- for (x in 1:length(AgRPPOMC_GWAS_lists)) {
- for (y in 1:length(Genelists)) {
- AgRPPOMC_GWAS_lists[[x]] <- left_join(data.frame(AgRPPOMC_GWAS_lists[[x]]),data.frame(Genelists[[y]]))
- colnames(AgRPPOMC_GWAS_lists[[x]])[length(colnames(AgRPPOMC_GWAS_lists[[x]]))] <- q[y]
- }
- AgRPPOMC_GWAS_lists[[x]] <- unique(AgRPPOMC_GWAS_lists[[x]])
- }
- write.xlsx(AgRPPOMC_GWAS_lists, file = paste0("13_AgRP-POMC_GWAS_lists_rawreadfilter",APfilter1,"_meanTPMfilter",APfilter2,"_lFCfilter",lFCfilter,".xlsx"))#
- for (x in 1:length(AgRPPOMC_genelist_lists)) {
- for (y in 1:length(Genelists)) {
- AgRPPOMC_genelist_lists[[x]] <- left_join(data.frame(AgRPPOMC_genelist_lists[[x]]),data.frame(Genelists[[y]]))
- colnames(AgRPPOMC_genelist_lists[[x]])[length(colnames(AgRPPOMC_genelist_lists[[x]]))] <- q[y]
- }
- AgRPPOMC_genelist_lists[[x]] <- unique(AgRPPOMC_genelist_lists[[x]])
- }
- write.xlsx(AgRPPOMC_genelist_lists, file = paste0("13_AgRP-POMC_genelist_lists_rawreadfilter",APfilter1,"_meanTPMfilter",APfilter2,"_lFCfilter",lFCfilter,".xlsx"))#
- #14.GWAS Venn -Fig 6, Table 1, Supplementary table 10, 11####
- fitlist <- list()
- fitlist[[1]] <- euler(c('AgRP' = length(AgRPgenelist$Geneid),
- 'POMC' = length(POMCgenelist$Geneid),
- 'KP' = length(KPgenelist$Geneid),
- 'AgRP&POMC' = length(AgRPPOMCgenelist$Geneid),
- 'AgRP&KP' = length(AgRPKPgenelist$Geneid),
- 'POMC&KP' = length(POMCKPgenelist$Geneid),
- 'AgRP&POMC&KP' = length(AgRPPOMCKPgenelist$Geneid)
- ))
- fitlist[[2]] <- euler(c('AgRP' = length(AgRPGWAS$Geneid),
- 'POMC' = length(POMCGWAS$Geneid),
- 'KP' = length(KPGWAS$Geneid),
- 'AgRP&POMC' = length(AgRPPOMCGWAS$Geneid),
- 'AgRP&KP' = length(AgRPKPGWAS$Geneid),
- 'POMC&KP' = length(POMCKPGWAS$Geneid),
- 'AgRP&POMC&KP' = length(AgRPPOMCKPGWAS$Geneid)
- ))
- fitlist[[3]] <- euler(c('AgRP' = length(AgRPGWAS$Geneid)/length(AgRPgenelist$Geneid)*100,
- 'POMC' = length(POMCGWAS$Geneid)/length(POMCgenelist$Geneid)*100,
- 'KP' = length(KPGWAS$Geneid)/length(KPgenelist$Geneid)*100,
- 'AgRP&POMC' = length(AgRPPOMCGWAS$Geneid)/length(AgRPPOMCgenelist$Geneid)*100,
- 'AgRP&KP' = length(AgRPKPGWAS$Geneid)/length(AgRPKPgenelist$Geneid)*100,
- 'POMC&KP' = length(POMCKPGWAS$Geneid)/length(POMCKPgenelist$Geneid)*100,
- 'AgRP&POMC&KP' = length(AgRPPOMCKPGWAS$Geneid)/length(AgRPPOMCKPgenelist$Geneid)*100
- ))
- AgRP_receptors <- sorted_list_rec[[1]]
- POMC_receptors <- sorted_list_rec[[2]]
- KP_receptors <- sorted_list_rec[[3]]
- AgRPPOMC_receptors <- sorted_list_rec[[4]]
- AgRPKP_receptors <- sorted_list_rec[[5]]
- POMCKP_receptors <- sorted_list_rec[[6]]
- AgRPPOMCKP_receptors <- sorted_list_rec[[7]]
- fitlist[[4]] <- euler(c('AgRP' = length(AgRP_receptors$Geneid),
- 'POMC' = length(POMC_receptors$Geneid),
- 'KP' = length(KP_receptors$Geneid),
- 'AgRP&POMC' = length(AgRPPOMC_receptors$Geneid),
- 'AgRP&KP' = length(AgRPKP_receptors$Geneid),
- 'POMC&KP' = length(POMCKP_receptors$Geneid),
- 'AgRP&POMC&KP' = length(AgRPPOMCKP_receptors$Geneid)
- ))
- AgRP_GWASreceptors <- inner_join(AgRPGWAS,AgRP_receptors[2])
- POMC_GWASreceptors <- inner_join(POMCGWAS,POMC_receptors[2])
- KP_GWASreceptors <- inner_join(KPGWAS,KP_receptors[2])
- AgRPPOMC_GWASreceptors <- inner_join(AgRPPOMCGWAS,AgRPPOMC_receptors[2])
- AgRPKP_GWASreceptors <- inner_join(AgRPKPGWAS,AgRPKP_receptors[2])
- POMCKP_GWASreceptors <- inner_join(POMCKPGWAS,POMCKP_receptors[2])
- AgRPPOMCKP_GWASreceptors <- inner_join(AgRPPOMCKPGWAS,AgRPPOMCKP_receptors[2])
- fitlist[[5]] <- euler(c('AgRP' = length(AgRP_GWASreceptors$Geneid),
- 'POMC' = length(POMC_GWASreceptors$Geneid),
- 'KP' = length(KP_GWASreceptors$Geneid),
- 'AgRP&POMC' = length(AgRPPOMC_GWASreceptors$Geneid),
- 'AgRP&KP' = length(AgRPKP_GWASreceptors$Geneid),
- 'POMC&KP' = length(POMCKP_GWASreceptors$Geneid),
- 'AgRP&POMC&KP' = length(AgRPPOMCKP_GWASreceptors$Geneid)
- ))
- fitlist[[6]] <- euler(c('AgRP' = length(AgRP_receptors$Geneid)/length(AgRPgenelist$Geneid)*100,
- 'POMC' = length(POMC_receptors$Geneid)/length(POMCgenelist$Geneid)*100,
- 'KP' = length(KP_receptors$Geneid)/length(KPgenelist$Geneid)*100,
- 'AgRP&POMC' = length(AgRPPOMC_receptors$Geneid)/length(AgRPPOMCgenelist$Geneid)*100,
- 'AgRP&KP' = length(AgRPKP_receptors$Geneid)/length(AgRPKPgenelist$Geneid)*100,
- 'POMC&KP' = length(POMCKP_receptors$Geneid)/length(POMCKPgenelist$Geneid)*100,
- 'AgRP&POMC&KP' = length(AgRPPOMCKP_receptors$Geneid)/length(AgRPPOMCKPgenelist$Geneid)*100
- ))
- fitlist[[7]] <- euler(c('AgRP' = length(AgRP_GWASreceptors$Geneid)/length(AgRPGWAS$Geneid)*100,
- 'POMC' = length(POMC_GWASreceptors$Geneid)/length(POMCGWAS$Geneid)*100,
- 'KP' = length(KP_GWASreceptors$Geneid)/length(KPGWAS$Geneid)*100,
- 'AgRP&POMC' = length(AgRPPOMC_GWASreceptors$Geneid)/length(AgRPPOMCGWAS$Geneid)*100,
- # 'AgRP&KP' = length(AgRPKP_GWASreceptors$Geneid)/length(AgRPKPGWAS$Geneid)*100,
- 'POMC&KP' = length(POMCKP_GWASreceptors$Geneid)/length(POMCKPGWAS$Geneid)*100,
- 'AgRP&POMC&KP' = length(AgRPPOMCKP_GWASreceptors$Geneid)/length(AgRPPOMCKPGWAS$Geneid)*100
- ))
- fitlist[[8]] <- euler(c('AgRP' = length(AgRP_GWASreceptors$Geneid)/length(AgRP_receptors$Geneid)*100,
- 'POMC' = length(POMC_GWASreceptors$Geneid)/length(POMC_receptors$Geneid)*100,
- 'KP' = length(KP_GWASreceptors$Geneid)/length(KP_receptors$Geneid)*100,
- 'AgRP&POMC' = length(AgRPPOMC_GWASreceptors$Geneid)/length(AgRPPOMC_receptors$Geneid)*100,
- 'AgRP&KP' = length(AgRPKP_GWASreceptors$Geneid)/length(AgRPKP_receptors$Geneid)*100,
- 'POMC&KP' = length(POMCKP_GWASreceptors$Geneid)/length(POMCKP_receptors$Geneid)*100,
- 'AgRP&POMC&KP' = length(AgRPPOMCKP_GWASreceptors$Geneid)/length(AgRPPOMCKP_receptors$Geneid)*100
- ))
- plotnames <- c("Genelist co-expression |lFC|>1","GWAS list co-expression |lFC|>1","1./2. %",
- "Receptor genes |lFC|>1","Receptor GWAS |lFC|>1","1./4. %","2./5. %","4./5. %")
- plots <- list()
- for (x in 1:length(plotnames)) {
- main <- plotnames[x]
- fit <- fitlist[[x]]
- plots[[x]] = plot(fit, fill=c('coral2', 'steelblue','gold'),
- quantities = TRUE,
- labels = c('AgRP','POMC','KP'),
- legend = FALSE,
- main = main
- )
- }
- pdf("14_GWAS_genelist_Venn_plots.pdf")
- for (x in 1:length(plots)) {
- print(plots[[x]])
- }
- dev.off()
- #15. -Fig 9c####
- data <- read_excel("Human_POMC_VL_DM_all_.xlsx") # ~ Supplementary table 16
- data$external_gene_name <- ifelse(is.na(data$external_gene_name), data$Geneid, data$external_gene_name)
- data2 <- data
- #normalize based on TPM
- data2 <- data2 %>% mutate(
- N_POMC_1210L = (TPM_POMC_1210L - apply(data[c(12,14)], 1, min, na.rm=TRUE))/apply(data[c(12,14)], 1, max, na.rm=TRUE),
- N_POMC_146L = (TPM_POMC_146L - apply(data[c(13,15)], 1, min, na.rm=TRUE))/apply(data[c(13,15)], 1, max, na.rm=TRUE),
- N_POMC_1210M = (TPM_POMC_1210M - apply(data[c(12,14)], 1, min, na.rm=TRUE))/apply(data[c(12,14)], 1, max, na.rm=TRUE),
- N_POMC_146M = (TPM_POMC_146M - apply(data[c(13,15)], 1, min, na.rm=TRUE))/apply(data[c(13,15)], 1, max, na.rm=TRUE)
- )
- data2 <- data2[(
- (rowSums((data2[,8:9]) > 4) == 2 & rowMeans(data2[,12:13]) >= 10)| (rowSums((data2[,10:11]) > 4) == 2 & rowMeans(data2[,14:15]) >= 10)
- ) , ]
- data2 <- data2 %>% filter((lFC_POMC_1210*lFC_POMC_146) > 0)
- data2 <- data2 %>% filter(
- apply(data2[c(12,14)], 1, min, na.rm=TRUE) > 10 |apply(data2[c(13,15)], 1, min, na.rm=TRUE) > 10 )
- #receptors
- receptors <- categories[[5]]
- data2 <- data.frame(unique(inner_join(data2, receptors, by = join_by(external_gene_name == Gene_symbol))))
- data2 <- data2 %>% mutate(
- p1210Ldev = N_POMC_1210L - N_POMC_1210M,
- p146Ldev = N_POMC_146L - N_POMC_146M,
- pLmean = (lFC_POMC_1210+lFC_POMC_146)/2,
- pLdev = lFC_POMC_1210-lFC_POMC_146
- )
- data2 <- data2 %>%
- filter(
- abs(lFC_POMC_1210) > 0.2, #threshold
- abs(lFC_POMC_146) > 0.2, #thresholds
- abs(pLmean) > 0.5 #threshold
- )
- data2 <- data2 %>% arrange(rowMeans(data2[,24:25]))
- data2 <- data2 %>% mutate(
- position = as.numeric(row.names(data2))
- )
- rownames(data2) <- data2$external_gene_name
- data3 <- data2 %>%
- pivot_longer(cols = c(p1210Ldev,p146Ldev),
- names_to = "Sample",
- values_to = "Deviation")
- data3$Sample <- factor(data3$Sample, levels = c("p1210Ldev","p146Ldev"))
- data3 <- data3 %>% mutate(
- external_gene_name = reorder(external_gene_name, position),
- size_value = ifelse(Sample == "p1210Ldev",
- sqrt(apply(data3[c(12,14)], 1, max, na.rm=TRUE)),
- sqrt(apply(data3[c(13,15)], 1, max, na.rm=TRUE)))
- )
- p<- ggplot(data3, aes(y = reorder(external_gene_name, position), x = Deviation, color = Sample)) +
- geom_segment(
- aes(x = 0, xend = Deviation, y = reorder(external_gene_name, position), yend = reorder(external_gene_name, position)),
- linewidth = 1,
- alpha = 0.75
- ) +
- geom_point(
- aes(size = size_value),
- alpha = 0.95#,
- ) +
- scale_color_manual(values = c(
- "p1210" = "#1b9e77",
- "p146" = "#d95f02"
- )) +
- scale_size_continuous(
- range = c(0.5, 10),
- breaks = c(1,5, 10, 50, 100),
- labels = c(1,25, 100, 2500, 10000),
- name = "Expression"
- ) +
- labs(
- x = "Enrichment",
- y = NULL,
- color = "Sample"
- ) +
- theme_minimal(base_size = 13) +
- theme(
- panel.grid.major.y = element_blank(),
- legend.position = "right"
- )
- ggsave("lolliplot_VL_DM.pdf", plot = p, width = 24, height = 24, units = "cm")
- #16.Human-mouse comparison -Fig 8, Supplementary table 13, 14, 15####
- data <- data.frame(read_excel("H_M_Agrp_POMC_Neuropeptides.xlsx")) # ~ Supplementary table 14
- #Fig 8a:
- colnames(data)[c(7,8,9)] <- c("hAgRP","mAgRPfed","mAgRPfast")
- data2 <- data %>% mutate(max_AgRP_mean = apply(data[c(7,8,9)], 1, max, na.rm=TRUE))
- data2 <- data2 %>% filter(max_AgRP_mean > 40)
- data2 <- data2 %>% arrange(desc(max_AgRP_mean))
- data2 <- data2 %>% mutate(Position = row_number())
- data3 <- data2 %>%
- pivot_longer(cols = c(hAgRP,mAgRPfed, mAgRPfast),
- names_to = "Cell_type",
- values_to = "TPM")
- data3$Cell_type <- factor(data3$Cell_type, levels = c("hAgRP","mAgRPfed","mAgRPfast"))
- df_plot <- data3 %>%
- group_by(GS_human) %>%
- mutate(
- gene_mean = mean(TPM, na.rm = TRUE),
- deviation = (TPM - gene_mean) / gene_mean
- ) %>%
- ungroup() %>%
- group_by(GS_human) %>%
- mutate(
- grand_mean = mean(TPM, na.rm = TRUE)
- ) %>%
- ungroup() %>%
- mutate(
- GS_human = fct_reorder(GS_human, grand_mean, .desc = FALSE),
- size_value = sqrt(TPM)
- )
- p <- ggplot(df_plot, aes(y = GS_human, x = deviation, color = Cell_type)) +
- geom_segment(
- aes(x = 0, xend = deviation, y = GS_human, yend = GS_human),
- linewidth = 1,
- alpha = 0.75#,
- ) +
- geom_point(
- aes(size = size_value),
- alpha = 0.95#,
- ) +
- scale_color_manual(values = c(
- "hAgRP" = "#1b9e77",
- "mAgRPfed" = "#d95f02",
- "mAgRPfast" = "#7570b3"
- )) +
- scale_size_continuous(
- range = c(0.5, 10),
- breaks = c(1,5, 10, 50, 100),
- labels = c(1,25, 100, 2500, 10000)
- )
- ggsave("Human-Mouse_AgRP_Neuropeptides_lolliplot_forSCALES.pdf", plot = p, width = 24, height = 24, units = "cm") #for Fig 8a
- df_long <- data2 %>%
- pivot_longer(
- cols = c(hAgRP,mAgRPfed, mAgRPfast),
- names_to = "Cell_type",
- values_to = "TPM"
- ) %>%
- mutate(TPM = as.numeric(TPM))
- gene_order <- df_long %>%
- group_by(GS_human) %>%
- arrange(desc(max_AgRP_mean)) %>%
- pull(GS_human)
- df_scaled <- df_long %>%
- group_by(GS_human) %>%
- mutate(
- gene_max = max(TPM, na.rm = TRUE),
- TPM_0_10 = ifelse(gene_max == 0, 0, TPM / gene_max * 10)
- ) %>%
- ungroup() %>%
- arrange(max_AgRP_mean) %>%
- mutate(
- GS_human = factor(GS_human, levels = unique(gene_order))
- )
- radar_df <- df_scaled %>%
- select(Cell_type, GS_human, TPM_0_10) %>%
- pivot_wider(names_from = GS_human, values_from = TPM_0_10) %>%
- as.data.frame()
- radar_df <- radar_df %>% mutate(xxx = NA) %>% select(24,1:23)
- rownames(radar_df) <- radar_df$Cell_type
- radar_df$Cell_type <- NULL
- radar_plot_df <- rbind(
- rep(10, ncol(radar_df)),
- rep(0, ncol(radar_df)),
- radar_df
- )
- colnames(radar_plot_df) <- colnames(radar_df)
- rownames(radar_plot_df)[1:2] <- c("Max", "Min")
- line_cols <- c(
- "hAgRP" = "#1b9e77",
- "mAgRPfed" = "#d95f02",
- "mAgRPfast" = "#7570b3"
- )
- fill_cols <- c(
- rgb(27, 158, 119, maxColorValue = 255, alpha = 70),
- rgb(217, 95, 2, maxColorValue = 255, alpha = 70),
- rgb(117, 112, 179, maxColorValue = 255, alpha = 70)
- )
- op <- par(mar = c(2, 2, 3, 2))
- radarchart( # for Fig 8a
- radar_plot_df,
- axistype = 1,
- seg = 5,
- pcol = unname(line_cols[rownames(radar_df)]),
- pfcol = fill_cols,
- plwd = 2,
- plty = 1,
- cglcol = "grey70",
- cglty = 1,
- cglwd = 0.8,
- axislabcol = "grey30",
- vlcex = 0.9,
- title = "Neuropeptides in AgRP"
- )
- legend(
- "topright",
- legend = rownames(radar_df),
- col = unname(line_cols[rownames(radar_df)]),
- lty = 1,
- lwd = 2,
- bty = "n",
- cex = 0.9
- )
- par(op)
- #Fig 8b:
- colnames(data)[c(13,14,15)] <- c("hPOMC","mPOMCfed","mPOMCfast")
- data2 <- data %>% mutate(max_POMC_mean = apply(data[c(13,14,15)], 1, max, na.rm=TRUE))
- data2 <- data2 %>% filter(max_POMC_mean > 40)
- data2 <- data2 %>% arrange(desc(max_AgRP_mean))
- data2 <- data2 %>% mutate(Position = row_number())
- data3 <- data2 %>%
- pivot_longer(cols = c(hPOMC,mPOMCfed, mPOMCfast),
- names_to = "Cell_type",
- values_to = "TPM")
- data3$Cell_type <- factor(data3$Cell_type, levels = c("hPOMC","mPOMCfed","mPOMCfast"))
- df_plot <- data3 %>%
- group_by(GS_human) %>%
- mutate(
- gene_mean = mean(TPM, na.rm = TRUE),
- deviation = (TPM - gene_mean) / gene_mean
- ) %>%
- ungroup() %>%
- group_by(GS_human) %>%
- mutate(
- grand_mean = mean(TPM, na.rm = TRUE)
- ) %>%
- ungroup() %>%
- mutate(
- GS_human = fct_reorder(GS_human, grand_mean, .desc = FALSE),
- size_value = sqrt(TPM)
- )
- p <- ggplot(df_plot, aes(y = GS_human, x = deviation, color = Cell_type)) +
- geom_segment(
- aes(x = 0, xend = deviation, y = GS_human, yend = GS_human),
- linewidth = 1,
- alpha = 0.75
- ) +
- geom_point(
- aes(size = size_value),
- alpha = 0.95
- ) +
- scale_color_manual(values = c(
- "hPOMC" = "#1b9e77",
- "mPOMCfed" = "#d95f02",
- "mPOMCfast" = "#7570b3"
- )) +
- scale_size_continuous(
- range = c(0.5, 10),
- breaks = c(1,5, 10, 50, 100),
- labels = c(1,25, 100, 2500, 10000)
- )
- ggsave("Human-Mouse_POMC_Neuropeptides_lolliplot_forSCALES.pdf", plot = p, width = 24, height = 24, units = "cm")#for Fig 8b
- df_long <- data2 %>%
- pivot_longer(
- cols = c(hPOMC,mPOMCfed, mPOMCfast),
- names_to = "Cell_type",
- values_to = "TPM"
- ) %>%
- mutate(TPM = as.numeric(TPM))
- gene_order <- df_long %>%
- group_by(GS_human) %>%
- arrange(desc(max_POMC_mean)) %>%
- pull(GS_human)
- df_scaled <- df_long %>%
- group_by(GS_human) %>%
- mutate(
- gene_max = max(TPM, na.rm = TRUE),
- TPM_0_10 = ifelse(gene_max == 0, 0, TPM / gene_max * 10)
- ) %>%
- ungroup() %>%
- arrange(max_POMC_mean) %>%
- mutate(
- GS_human = factor(GS_human, levels = unique(gene_order))
- )
- radar_df <- df_scaled %>%
- select(Cell_type, GS_human, TPM_0_10) %>%
- pivot_wider(names_from = GS_human, values_from = TPM_0_10) %>%
- as.data.frame()
- radar_df <- radar_df %>% mutate(xxx = NA) %>% select(25,1:24)
- rownames(radar_df) <- radar_df$Cell_type
- radar_df$Cell_type <- NULL
- radar_plot_df <- rbind(
- rep(10, ncol(radar_df)),
- rep(0, ncol(radar_df)),
- radar_df
- )
- colnames(radar_plot_df) <- colnames(radar_df)
- rownames(radar_plot_df)[1:2] <- c("Max", "Min")
- line_cols <- c(
- "hPOMC" = "#1b9e77",
- "mPOMCfed" = "#d95f02",
- "mPOMCfast" = "#7570b3"
- )
- fill_cols <- c(
- rgb(27, 158, 119, maxColorValue = 255, alpha = 70),
- rgb(217, 95, 2, maxColorValue = 255, alpha = 70),
- rgb(117, 112, 179, maxColorValue = 255, alpha = 70)
- )
- op <- par(mar = c(2, 2, 3, 2))
- radarchart( #for Fig 8b
- radar_plot_df,
- axistype = 1,
- seg = 5,
- pcol = unname(line_cols[rownames(radar_df)]),
- pfcol = fill_cols,
- plwd = 2,
- plty = 1,
- cglcol = "grey70",
- cglty = 1,
- cglwd = 0.8,
- axislabcol = "grey30",
- vlcex = 0.9,
- title = "Neuropeptides in POMC"
- )
- legend(
- "topright",
- legend = rownames(radar_df),
- col = unname(line_cols[rownames(radar_df)]),
- lty = 1,
- lwd = 2,
- bty = "n",
- cex = 0.9
- )
- par(op)
- #Fig 8c
- dat1 <- read_excel("MAP_HUMAN_Mouse.xlsx") # ~ Supplementary table 13
- dat1 <- dat1 %>% filter(GS_human == "INSR" | GS_human == "ACVR1C")
- dat2 <- data.frame(read_excel("Sum_receptors.xlsx")) # ~ Supplementary table 15
- data <- full_join(dat2, dat1)
- colnames(data)[c(7,8,9)] <- c("hAgRP","mAgRPfed","mAgRPfast")
- colnames(data)[c(13,14,15)] <- c("hPOMC","mPOMCfed","mPOMCfast")
- data <- data %>% mutate(max_AgRP_mean = apply(data[c(7,8,9)], 1, max, na.rm=TRUE))
- data <- data %>% mutate(max_POMC_mean = apply(data[c(13,14,15)], 1, max, na.rm=TRUE))
- data <- data %>% mutate(max_mean = apply(data[c(7,8,9,13,14,15)], 1, max, na.rm=TRUE))
- data2 <- data %>% filter(max_AgRP_mean > 40)
- datah <- data2 %>% arrange(desc(hAgRP)) %>% head(40)
- datam1 <- data2 %>% arrange(desc(mAgRPfed)) %>% head(40)
- datam2 <- data2 %>% arrange(desc(mAgRPfast)) %>% head(40)
- data3 <- data %>% filter(max_POMC_mean > 40)
- datph <- data3 %>% arrange(desc(hPOMC)) %>% head(40)
- datpm1 <- data3 %>% arrange(desc(mPOMCfed)) %>% head(40)
- datpm2 <- data3 %>% arrange(desc(mPOMCfast)) %>% head(40)
- data4 <- unique(full_join(datph,unique(full_join(datpm1,unique(full_join(datpm2,unique(full_join(datah,unique(full_join(datam1,datam2))))))))))
- #data4 <- data4[-c(20,75,78),] #eliminate comparison duplicate - many-to-one
- data4 <- data4 %>% arrange(desc(max_mean))
- data4 <- data4 %>% mutate(Position = row_number())# %>% select(-c(46:50))
- data5 <- data4 %>%
- pivot_longer(cols = c(hAgRP,mAgRPfed, mAgRPfast, hPOMC, mPOMCfed, mPOMCfast),
- names_to = "Cell_type",
- values_to = "TPM")
- data5$Cell_type <- factor(data5$Cell_type, levels = c("hAgRP","mAgRPfed", "mAgRPfast", "hPOMC","mPOMCfed","mPOMCfast"))
- data5b <- data5 %>%
- mutate(TPM_rel = ifelse(TPM == 0 | is.na(TPM), NA_real_, TPM / max_mean))
- p <- ggplot(data = data5b, aes(reorder(GS_human, Position), Cell_type, colour = TPM)) +
- geom_point(aes(size = TPM_rel)) +
- scale_color_gradient2(low = "#0000FF",high = "#FF0000", mid = "#FFCCFF", midpoint = 100,transform = "log10",
- limits = c(1, max(data5b$TPM, na.rm=TRUE)),
- oob = squish) +
- scale_size_area(max_size = 12) +
- theme_bw() +
- theme(axis.text.x = element_text(hjust = 1, angle = 90))
- ggsave("Human-Mouse_top40_Receptors.pdf", plot = p, width = 100, height = 10, units = "cm") #Fig 8c
Human_AgRP_POMC_KP_ILCMSeq_codes.R at commit 52ffeb7, no license · at the source
Overview
- Laboratory of Reproductive Neurobiology, Hun-Ren Institute of Experimental Medicine, Budapest, Hungary
- Roska Tamás Doctoral School of Sciences and Technology, Faculty of Information Technology and Bionics, Pázmány Péter Catholic University, Budapest, Hungary
- Department of Biochemistry and Molecular Biology, Faculty of Medicine, University of Debrecen, Debrecen, Hungary
- Department of Pathology and Experimental Cancer Research, Semmelweis University, Budapest, Hungary
Abstract
We present and validate a pioneering ‘IHC/
Reproduced under the paper's license (CC BY), from the paper cited above.
Repository
Its files are read in the Code ↔ Paper reader above, with 6 matches between paragraphs and lines of code.
goczbalazs/PRJNA1305226_1305334
52ffeb7eba3678a3fb7fae47592e80d4beb50835, 27 April 2026Availability: 1 check, the latest on 27 September 2026: the link answers
- 27 September 2026: the link answers
5 files
- Bash scripts for reanalysis of PRJNA281954.sh, Shell, 37 lines, 1 match
- Human_AgRP_POMC_KP_ILCMS
eq_codes.R , R, 1,554 lines, 4 matches - R scripts for Human_POMC_VL_DM.R, R, 57 lines
- R scripts for reanalysis of PRJNA281954.R, R, 519 lines, 1 match
- README.md, Text, 4 lines
Code availability
Analyses were performed in R (v4.5.0). The main packages used were DESeq2 (v1.44.0), tidyverse (v2.0.0), ggplot2 (v3.5.2), cluster (v2.1.8.1), pheatmap (v1.0.12), EnhancedVolcano (v1.22.0), eulerr (v7.0.2), and fmsb (v0.7.6). Additional packages used for file handling and graphical formatting included openxlsx (v4.2.8), ggfortify (v0.4.17), RColorBrewer (v1.1-3), ggrepel (v0.9.6), gridExtra (v2.3), ggpubr (v0.6.0), and scales (v1.4.0). Custom scripts are available at https://
Reproduced under the paper's license (CC BY), from the paper cited above.
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;
- 4 scripts, each with its path and the digest of its content;
- 6 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
- bioproject:PRJNA1305226, at NCBI BioProject; found in “Data availability”
Data Availability Statement
The human RNA-seq data generated in this study have been deposited in the NCBI Sequence Read Archive under the BioProject accession codes PRJNA1305226 (http://
Analyses were performed in R (v4.5.0). The main packages used were DESeq2 (v1.44.0), tidyverse (v2.0.0), ggplot2 (v3.5.2), cluster (v2.1.8.1), pheatmap (v1.0.12), EnhancedVolcano (v1.22.0), eulerr (v7.0.2), and fmsb (v0.7.6). Additional packages used for file handling and graphical formatting included openxlsx (v4.2.8), ggfortify (v0.4.17), RColorBrewer (v1.1-3), ggrepel (v0.9.6), gridExtra (v2.3), ggpubr (v0.6.0), and scales (v1.4.0). Custom scripts are available at https://
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, 11 authors, 2 keywords, 10 MeSH terms, 1 funder, 52 references, 1 RRID.
Cite
This paper
Takács, S., Skrapits, K., Göcz, B., Rumpler, É., Sárvári, M., Göblyös, B., Biri, D., Póliska, S., Rácz, G., Matolcsy, A., & Hrabovszky, E. (2026). Transcriptome profiling of human hypothalamic agouti-related protein and proopiomelanocortin neurons regulating energy homeostasis. Nature communications, 17(1), 9801. https://
BibTeX
@article{takacs2026trans
author = {Takács, Szabolcs and Skrapits, Katalin and Göcz, Balázs and Rumpler, Éva and Sárvári, Miklós and Göblyös, Barbara and Biri, Dalma and Póliska, Szilárd and Rácz, Gergely and Matolcsy, András and Hrabovszky, Erik},
title = {{Transcriptome profiling of human hypothalamic agouti-related protein and proopiomelanocortin neurons regulating energy homeostasis}},
journal = {Nature communications},
year = {2026},
month = aug,
volume = {17},
number = {1},
pages = {9801},
publisher = {Nature Portfolio},
issn = {2041-1723},
doi = {10.1038/
url = {https://
pmid = {42736279},
pmcid = {PMC13575109}
}
RIS
TY - JOUR
AU - Takács, Szabolcs
AU - Skrapits, Katalin
AU - Göcz, Balázs
AU - Rumpler, Éva
AU - Sárvári, Miklós
AU - Göblyös, Barbara
AU - Biri, Dalma
AU - Póliska, Szilárd
AU - Rácz, Gergely
AU - Matolcsy, András
AU - Hrabovszky, Erik
TI - Transcriptome profiling of human hypothalamic agouti-related protein and proopiomelanocortin neurons regulating energy homeostasis
T2 - Nature communications
J2 - Nat Commun
PY - 2026
DA - 2026/
VL - 17
IS - 1
SP - 9801
SN - 2041-1723
PB - Nature Portfolio
DO - 10.1038/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1038/
"type": "article-journal",
"title": "Transcriptome profiling of human hypothalamic agouti-related protein and proopiomelanocortin neurons regulating energy homeostasis",
"container-title": "Nature communications",
"author": [
{
"family": "Takács",
"given": "Szabolcs"
},
{
"family": "Skrapits",
"given": "Katalin"
},
{
"family": "Göcz",
"given": "Balázs"
},
{
"family": "Rumpler",
"given": "Éva"
},
{
"family": "Sárvári",
"given": "Miklós"
},
{
"family": "Göblyös",
"given": "Barbara"
},
{
"family": "Biri",
"given": "Dalma"
},
{
"family": "Póliska",
"given": "Szilárd"
},
{
"family": "Rácz",
"given": "Gergely"
},
{
"family": "Matolcsy",
"given": "András"
},
{
"family": "Hrabovszky",
"given": "Erik"
}
],
"container-title-short":
"volume": "17",
"issue": "1",
"page": "9801",
"DOI": "10.1038/
"PMID": "42736279",
"PMCID": "PMC13575109",
"ISSN": "2041-1723",
"publisher": "Nature Portfolio",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
8,
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.1016/j.jbc.2023.105121 [code]
- Development of a versatile LCM-Seq method for spatial transcriptomics of fluorescently tagged cholinergic neuron populations.Journal: The Journal of biological chemistryIn common: Subread (featureCounts), STAR, DESeq2, 3 other tools, genetics / omics, cellular / molecular, 6 references, 2 authors
- [2] doi:10.1016/j.jbc.2024.108150 [code]
- Laser-capture microdissection for spatial transcriptomics of immunohistochemically detected neurons.Journal: The Journal of biological chemistryIn common: Subread (featureCounts), STAR, tidyverse, histology / microscopy, genetics / omics, cellular / molecular, 8 references, author Erik Hrabovszky
- [3] doi:10.1073/pnas.2113749119 [code]
- Transcriptome profiling of kisspeptin neurons from the mouse arcuate nucleus reveals new mechanisms in estrogenic control of fertility.Journal: Proceedings of the National Academy of Sciences of the United States of AmericaIn common: Subread (featureCounts), STAR, genetics / omics, cellular / molecular, 1 reference, 3 authors
- [4] doi:10.1073/pnas.2512855122 [code]
- Neuronal plasticity at puberty in mouse hypothalamic &
lt;i& gt;Kiss1& lt;/ i& gt; neurons that control fertility. Journal: Proceedings of the National Academy of Sciences of the United States of AmericaIn common: Subread (featureCounts), STAR, DESeq2, 3 other tools, 2 authors - [5] 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: Subread (featureCounts), STAR, DESeq2, 4 other tools, genetics / omics, 4 references
- [6] doi:10.1126/sciadv.aed2952 [code]
- Activation of transposable elements is linked to a region- and cell type-specific interferon response in Parkinson's disease.Journal: Science advancesIn common: Subread (featureCounts), STAR, DESeq2, 4 other tools, cellular / molecular, 4 references
- [7] doi:10.1128/mbio.01746-22 [code]
- Plasmodium falciparum and TNF-α Differentially Regulate Inflammatory and Barrier Integrity Pathways in Human Brain Endothelial Cells.Journal: mBioIn common: Subread (featureCounts), STAR, DESeq2, 3 other tools, genetics / omics, cellular / molecular, 4 references
- [8] doi:10.1016/j.xgen.2023.100399 [code]
- Multiple genes in a single GWAS risk locus synergistically mediate aberrant synaptic development and function in human neurons.Journal: Cell genomicsIn common: Subread (featureCounts), STAR, DESeq2, 4 other tools, genetics / omics, cellular / molecular, 2 references
- [9] doi:10.1038/s43856-025-00942-3 [code]
- Protection against APOE4-associated phenotypes with the longevity-promoting intervention 17α-estradiol in middle-aged male mice.Journal: Communications medicineIn common: Subread (featureCounts), STAR, DESeq2, 3 other tools, genetics / omics, 4 references
- [10] doi:10.1038/s41586-026-10512-9 [code]
- Astrocyte glucocorticoid receptor signalling restricts neuronal plasticity.Journal: NatureIn common: Subread (featureCounts), STAR, DESeq2, 4 other tools, 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.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 4 scripts, and 6 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:a7c6c5dfeee3ad93…
Add the badge to the code's README
If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.
Markdown
<!-- oscr-badge:start -->
[](https://openscicode.org/badge/doi/10.1038/s41467-026-76688-w)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.1038/s41467-026-76688-w.svg
:target: https://openscicode.org/badge/doi/10.1038/s41467-026-76688-w
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1038/s41467-026-76688-w"><img src="https://openscicode.org/badge/doi/10.1038/s41467-026-76688-w.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".
If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge 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: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.
Report a mismatch between the code and the paper · Report a code error (signed in)
Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.
Report a reproduction failure (signed in)
Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
