Commit 21ab53a6 authored by Holger Brandl's avatar Holger Brandl

fixed plotting issue

parent f3d79628
...@@ -261,7 +261,7 @@ term_barplot_files = erPlotData %>% do({ ...@@ -261,7 +261,7 @@ term_barplot_files = erPlotData %>% do({
ac ac
## old version ## old version
# logPlot <- enrResultsGrp %>% # enrPlot <- enrResultsGrp %>%
# ## fix factor order # ## fix factor order
# # mutate(Term=reorder(Term, -qvalue) %>% reorder(as.integer(as.factor(ontology)))) %>% # # mutate(Term=reorder(Term, -qvalue) %>% reorder(as.integer(as.factor(ontology)))) %>%
# mutate(fixed_width_term = reorder(fixed_width_term, - qvalue)) %>% # mutate(fixed_width_term = reorder(fixed_width_term, - qvalue)) %>%
...@@ -273,10 +273,10 @@ term_barplot_files = erPlotData %>% do({ ...@@ -273,10 +273,10 @@ term_barplot_files = erPlotData %>% do({
# ggtitle(label) + # ggtitle(label) +
# scale_y_log10() # scale_y_log10()
# print(logPlot) # print(enrPlot)
## new version using dotplot https://bioconductor.org/packages/devel/bioc/vignettes/clusterProfiler/inst/doc/clusterProfiler.html#dotplot ## new version using dotplot https://bioconductor.org/packages/devel/bioc/vignettes/clusterProfiler/inst/doc/clusterProfiler.html#dotplot
enrResultsGrp %>% ungroup %>% enrPlot = enrResultsGrp %>% ungroup %>%
## fix factor order ## fix factor order
mutate(fixed_width_term = reorder(fixed_width_term, gene_ratio)) %>% mutate(fixed_width_term = reorder(fixed_width_term, gene_ratio)) %>%
ggplot(aes(fixed_width_term, gene_ratio, size=Count, fill = qvalue, color = ontology)) + ggplot(aes(fixed_width_term, gene_ratio, size=Count, fill = qvalue, color = ontology)) +
...@@ -299,11 +299,11 @@ term_barplot_files = erPlotData %>% do({ ...@@ -299,11 +299,11 @@ term_barplot_files = erPlotData %>% do({
str_replace_all(" ", "_") str_replace_all(" ", "_")
# ggsave(paste0("enrichmed_terms__", fileNameLabel, ".pdf")) # ggsave(paste0("enrichmed_terms__", fileNameLabel, ".pdf"))
# print(logPlot) # print(enrPlot)
stopifnot(str_length(fileNameLabel) > 0) stopifnot(str_length(fileNameLabel) > 0)
tmpPng <- paste0(figDir, "/enrterms__", fileNameLabel, ".png") tmpPng <- paste0(figDir, "/enrterms__", fileNameLabel, ".png")
ggsave(tmpPng, logPlot, width = 10, height = 2 + round(nrow(enrResultsGrp) / 5), limitsize = FALSE) ggsave(tmpPng, enrPlot, width = 10, height = 2 + round(nrow(enrResultsGrp) / 5), limitsize = FALSE)
data.frame(file = tmpPng) data.frame(file = tmpPng)
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment