adde format_results_dynamut2.py and ran shiny scripts for barplots

This commit is contained in:
Tanushree Tunstall 2021-08-19 16:25:38 +01:00
parent 8cdf720702
commit f7aac58081
9 changed files with 235 additions and 59 deletions

View file

@ -22,7 +22,14 @@ stability_count_bp <- function(plotdf
, leg_text_size = 20
, leg_title_size = 22
, yaxis_title = "Number of nsSNPs"
, bp_plot_title = ""){
, bp_plot_title = ""
, label_categories = c("Destabilising", "Stabilising")
, title_colour = "chocolate4"
, subtitle_text = NULL
, subtitle_size = 20
, subtitle_colour = "pink"
#, leg_position = c(0.73,0.8) # within plot area
, leg_position = "top"){
OutPlot_count = ggplot(plotdf, aes(x = eval(parse(text = df_colname)))) +
geom_bar(aes(fill = eval(parse(text = df_colname))), show.legend = TRUE) +
@ -35,14 +42,20 @@ stability_count_bp <- function(plotdf
, axis.title.x = element_blank()
, axis.title.y = element_text(size = axis_label_size)
, axis.text.y = element_text(size = axis_text_size)
, legend.position = c(0.73,0.8)
, legend.position = leg_position
, legend.text = element_text(size = leg_text_size)
, legend.title = element_text(size = leg_title_size)
, plot.title = element_text(size = axis_label_size)) +
labs(title = bp_plot_title
, y = yaxis_title) +
, plot.title = element_text(size = axis_label_size
, colour = title_colour)
, plot.subtitle = element_text(size = subtitle_size
, hjust = 0.5
, colour = subtitle_colour)) +
labs(title = bp_plot_title
, subtitle = subtitle_text
, y = yaxis_title) +
scale_fill_discrete(name = leg_title
, labels = c("Destabilising", "Stabilising"))
#, labels = c("Destabilising", "Stabilising")
, labels = label_categories)
return(OutPlot_count)
}