diff --git a/bin/plot_tree_summary.R b/bin/plot_tree_summary.R index d280aae..44de8a6 100755 --- a/bin/plot_tree_summary.R +++ b/bin/plot_tree_summary.R @@ -129,7 +129,7 @@ for (i in 2:length(column_headers)) { if (plot_type == "bar") { bar_plot <- ggplot(data, aes(x = as.numeric(!!sym(column_name)), y = factor(species, levels = rev(tree$tip.label)))) + geom_bar(stat = "identity", fill = "darkblue") + - geom_text(aes(label = !!sym(column_name)), hjust = -0.1, size = args$text_size) + # Add text labels + geom_text(aes(label = as.numeric(!!sym(column_name)), x = 0), hjust = -0.1, color = "white", size = args$text_size) + # Place text at the base of the bar theme_minimal() + theme(axis.title.y = element_blank(), axis.text.y = element_blank(), @@ -137,8 +137,10 @@ for (i in 2:length(column_headers)) { axis.title.x = element_blank(), axis.text.x = element_blank(), axis.ticks.x = element_blank(), - panel.grid.major.y = element_blank(), # Remove horizontal grid lines - panel.grid.minor.y = element_blank(), + panel.grid.major = element_blank(), # Remove vertical grid lines + panel.grid.minor = element_blank(), # Remove minor grid lines + panel.background = element_blank(), # Remove grey background + plot.background = element_blank(), # Remove any outer plot background plot.margin = margin(0, 0, 0, 0)) + labs(x = column_name) + ggtitle(column_name) diff --git a/bin/plot_tree_summary2.R b/bin/plot_tree_summary2.R index be7b926..2142c8b 100755 --- a/bin/plot_tree_summary2.R +++ b/bin/plot_tree_summary2.R @@ -88,7 +88,7 @@ tree_plot <- ggtree(tree) + geom_tiplab() + coord_cartesian(clip="off") + ggtitle("Phylogenetic Tree") + - theme(plot.margin = margin(10, 150, 10, 10)) # Increase margins + theme(plot.margin = margin(10, 70, 10, 10)) # Increase margins pdf ("Tree_only.pdf") tree_plot diff --git a/modules/local/tree_summary.nf b/modules/local/tree_summary.nf index 2303cf1..c7bde84 100644 --- a/modules/local/tree_summary.nf +++ b/modules/local/tree_summary.nf @@ -37,8 +37,8 @@ process TREE_SUMMARY { sed \'s/.prot.fa.largestIsoform.fa//g\' Quast_to_plot.tsv > Quast_to_plot_final.tsv # Run summary plot - /usr/bin/Rscript ${projectDir}/bin/plot_tree_summary2.R tree.nw Busco_to_plot_final.tsv - /usr/bin/Rscript ${projectDir}/bin/plot_tree_summary.R tree.nw Quast_to_plot_final.tsv + /usr/bin/Rscript ${projectDir}/bin/plot_tree_summary2.R tree.nw Busco_to_plot_final.tsv --tree_size 0.6 + /usr/bin/Rscript ${projectDir}/bin/plot_tree_summary.R tree.nw Quast_to_plot_final.tsv --tree_size 0.6 cat <<-END_VERSIONS > versions.yml "${task.process}":