colour changes

This commit is contained in:
Tanushree Tunstall 2022-08-13 15:40:25 +01:00
parent c6a720770d
commit c8f3ddf892
5 changed files with 34 additions and 17 deletions

View file

@ -124,6 +124,8 @@ bp_stability_hmap <- function(plot_df = merged_df3
, axis.title.y = element_text(size = my_yaxts ) , axis.title.y = element_text(size = my_yaxts )
, plot.title = element_text(size = my_pts , plot.title = element_text(size = my_pts
, hjust = 0.5) , hjust = 0.5)
, panel.grid = element_blank()
, panel.background = element_rect(fill = "transparent", colour=NA)
) + ) +
labs(title = p_title labs(title = p_title

View file

@ -2,7 +2,8 @@
generate_distance_colour_map = function(plot_df, generate_distance_colour_map = function(plot_df,
xvar_colname = "position", xvar_colname = "position",
lig_dist_colname = "ligand_distance", lig_dist_colname = "ligand_distance",
lig_dist_colours = c("green", "yellow", "orange", "red"), #lig_dist_colours = c("green", "yellow", "orange", "red"),
lig_dist_colours = c("tan", "black"),
debug = TRUE debug = TRUE
) )
{ {
@ -74,9 +75,9 @@ generate_distance_legend = function(plot_df,
geom_tile(aes(fill = .data[[lig_dist_colname]]) geom_tile(aes(fill = .data[[lig_dist_colname]])
, colour = "white") + , colour = "white") +
scale_fill_gradient2(midpoint = lig_mean scale_fill_gradient2(midpoint = lig_mean
, low = "green" , low = "tan"
, mid = "yellow" , mid = "grey50"
, high = "red" , high = "black"
, breaks = labels , breaks = labels
, limits = c(lig_min, lig_max) , limits = c(lig_min, lig_max)
, labels = labelsD , labels = labelsD

View file

@ -201,7 +201,7 @@ LogoPlotSnps <- function(plot_df
cat('\nSelected colour scheme:', my_logo_col cat('\nSelected colour scheme:', my_logo_col
, "\nUsing grey theme") , "\nUsing grey theme")
theme_bgc = "grey" theme_bgc = "white"
xfont_bgc = "black" xfont_bgc = "black"
yfont_bgc = "black" yfont_bgc = "black"
xtt_col = "black" xtt_col = "black"

View file

@ -31,20 +31,21 @@ position_annotation=function(plot_df, bg="transparent"){
scale_x_discrete("Position", labels=factor(plot_df$position)) + scale_x_discrete("Position", labels=factor(plot_df$position)) +
scale_color_manual(values = c( scale_color_manual(values = c(
"brown"="brown", "brown"="brown",
"purple"="purple", "green"="green",
"transparent"="transparent", "transparent"="transparent",
"blue"="blue", "cyan"="cyan", "slategrey"="slategrey",
"cornflowerblue"="cornflowerblue" "navyblue"="navyblue",
"purple"="purple"
), ),
expand=c(0,0) expand=c(0,0)
) + ) +
scale_fill_manual(values = c( scale_fill_manual(values = c(
"brown"="brown", "brown"="brown",
"purple"="purple", "green"="green",
"transparent"="transparent", "transparent"="transparent",
"blue"="blue", "slategrey"="slategrey",
"cyan"="cyan", "navyblue"="navyblue",
"cornflowerblue"="cornflowerblue" "purple"="purple"
), ),
expand=c(0,0) expand=c(0,0)
) + ) +

View file

@ -321,12 +321,25 @@ svg('/tmp/foo.svg', width=10, height=10, )
corr_plotting_df = corr_df_ps corr_plotting_df = corr_df_ps
ggpairs(corr_plotting_df, columns = 1:(ncol(corr_plotting_df)-1) ggpairs(corr_plotting_df, columns = 1:(ncol(corr_plotting_df)-1),
, upper = list(continuous = wrap('cor', method = "spearman")) upper = list(continuous = wrap('cor',
, aes(colour = factor(dst_mode), alpha = 0.5) method = "spearman",
, title="correlogram with ggpairs()") + title="ρ",
digits=2,
title_args=c(colour="black")
)
),
lower = list(
continuous = wrap("points", alpha = 0.7, size=0.5),
combo = wrap("dot", alpha = 0.7, size=0.5)
),
aes(colour = factor(ifelse(corr_plotting_df$dst_mode==0, "S", "R")), alpha = 0.5),
title="Stability") +
scale_colour_manual(values = c("red", "blue")) + scale_colour_manual(values = c("red", "blue")) +
scale_fill_manual(values = c("red", "blue")) scale_fill_manual(values = c("red", "blue")) +
theme(
text = element_text(size=12, face="bold")
)
dev.off() dev.off()