Skip to content

Commit

Permalink
Merge pull request nf-core#32 from itrujnara/bug_fixes
Browse files Browse the repository at this point in the history
Fixed Venn diagram bug
  • Loading branch information
itrujnara authored May 24, 2024
2 parents f2d0a43 + 199b282 commit f85f4f5
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions bin/plot_orthologs.R
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,20 @@ for (i in colnames(data)[4:ncol(data)-1]) {
venn.data[[i]] <- hits
}

venn_plot_dark <- ggVennDiagram(venn.data, set_color = text_color_darkmode) +
theme_dark +
theme(panel.grid = element_blank(), axis.text = element_text(color = "transparent"), legend.position = "none")
if (length(venn.data) < 2) { # If there are less than 2 methods, ggVenn does not work
venn_plot_dark <- fallback_plot()
venn_plot_light <- fallback_plot()
} else {
venn_plot_dark <- ggVennDiagram(venn.data, set_color = text_color_darkmode) +
theme_dark +
theme(panel.grid = element_blank(), axis.text = element_text(color = "transparent"), legend.position = "none")

ggsave(paste0(args[2], "_venn_dark.png"), plot = venn_plot_dark, width = 6, height = 6, dpi = 300)
venn_plot_light <- ggVennDiagram(venn.data, set_color = text_color_lightmode) +
theme_light +
theme(panel.grid = element_blank(), axis.text = element_text(color = "transparent"), legend.position = "none")
}

venn_plot_light <- ggVennDiagram(venn.data, set_color = text_color_lightmode) +
theme_light +
theme(panel.grid = element_blank(), axis.text = element_text(color = "transparent"), legend.position = "none")
ggsave(paste0(args[2], "_venn_dark.png"), plot = venn_plot_dark, width = 6, height = 6, dpi = 300)

ggsave(paste0(args[2], "_venn_light.png"), plot = venn_plot_light, width = 6, height = 6, dpi = 300)

Expand Down

0 comments on commit f85f4f5

Please sign in to comment.