fix many plot functions to stop them using the "g=ggplot()" pattern,

which annoyingly throws away lots of useful data that RShiny needs for
clickable plots. Also split the "flame bar" for ligand distance out into
separate functions in generate_distance_colour_map.R. This can now be
easily incorporated into any "wide" graph showing all positions.
This commit is contained in:
Tanushree Tunstall 2022-08-03 18:56:14 +01:00
parent e498d46f8b
commit bdbc97c40a
8 changed files with 1323 additions and 725 deletions

View file

@ -105,9 +105,9 @@ site_snp_count_bp <- function (plotdf
# not sure if to use with sort or directly
my_x = sort(unique(snpsBYpos_df$snpsBYpos))
g = ggplot(snpsBYpos_df, aes(x = snpsBYpos))
OutPlot_pos_count = g + geom_bar(aes (alpha = 0.5)
, show.legend = FALSE) +
ggplot(snpsBYpos_df, aes(x = snpsBYpos)) +
geom_bar(aes (alpha = 0.5)
, show.legend = FALSE) +
scale_x_continuous(breaks = unique(snpsBYpos_df$snpsBYpos)) +
geom_label(stat = "count", aes(label = ..count..)
, color = "black"
@ -126,14 +126,11 @@ site_snp_count_bp <- function (plotdf
, colour = title_colour)
, plot.subtitle = element_text(size = subtitle_size
, hjust = 0.5
, colour = subtitle_colour)) +
, colour = subtitle_colour)) +
labs(title = bp_plot_title
, subtitle = subtitle_text
, x = xaxis_title
, y = yaxis_title)
return(OutPlot_pos_count)
}
########################################################################