Visualizing Upregulated and Downregulated Genes in GO and KEGG Pathway Analyses
0
1
Entering edit mode
12 weeks ago
roxana ▴ 10

Hi Biostar community,

I am conducting GO and KEGG pathway enrichment analyses on RNA-Seq data. My goal is to visualize both upregulated and downregulated genes in a single plot for each analysis. Here's the issue:

For GO enrichment analysis, I am using the clusterProfiler package in R with the enrichGO() function for both upregulated and downregulated genes. However, I'm having trouble creating a combined dotplot that distinguishes between the upregulated and downregulated terms in the same visualization.

For KEGG pathway analysis, I am using enrichKEGG() for both sets of genes and facing a similar issue. I would like to combine the pathways enriched in upregulated and downregulated genes in one plot for better comparison, but I can't figure out how to merge these results in the same visualization.

What would be the best approach to achieve this for both GO and KEGG analyses? Any code examples or tips would be greatly appreciated!

Thank you!

RNA-Seq • 361 views
ADD COMMENT
0
Entering edit mode

Depends on the output your are getting, say its something like below, saved in a dataframe df that countains your FoldEnrichment values, GO_Term, LogFDR which is the log of the false discovery rate, and Count, which is the number of genes from your data that are present in the tested GO gene set, you could do something like the following to get a dot plot:

     plot <- ggplot(data=df, aes(FoldEnrichment, fct_reorder(GO_Term_ID, FoldEnrichment, .desc = FALSE), #use fct_reorder to arrange by Fold enrichment
                        colour = LogFDR, size = Count)) + 

  geom_point() +
  scale_color_gradient(low = "red", high = "royal blue") + 
  theme_bw() +
  scale_x_continuous( limits = c(0,4.5)) +
  ylab("GO Biological Process") +
  xlab("Fold Enrichment") +
  labs(color = "-Log10(FDR)", size = "Gene Count")+
  theme(plot.title.position = "plot", 
        plot.title = element_text(hjust =0.5),
        #create some space around the graph
        plot.margin = unit (c(0.2, 0.2, 0.2, 0.2), "cm"),
        legend.title = element_text(hjust = 0.5, size = 10),
        legend.position = "right",
         axis.title.y = element_text(size = 12),
        axis.title.x = element_text(size = 12))
 plot

example_go_dot_plot

ADD REPLY

Login before adding your answer.

Traffic: 1521 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6