This commit is contained in:
Tanushree Tunstall 2022-08-29 18:23:43 +01:00
parent 6441be21ab
commit 8f97ab7cc8
4 changed files with 17 additions and 15 deletions

View file

@ -65,8 +65,8 @@ cat("\n==================================================="
aa_pos_lig1 = NULL aa_pos_lig1 = NULL
aa_pos_lig2 = NULL aa_pos_lig2 = NULL
aa_pos_lig3 = NULL aa_pos_lig3 = NULL
tile_map=data.frame(tile=c("RPO","DPA","CDL","Ca"), tile_map=data.frame(tile=c("RFP"),
tile_colour=c("green","darkslategrey","navyblue","purple")) tile_colour=c("green"))
#### ####

View file

@ -29,6 +29,7 @@ lin_count_bp <- function( lf_data = lin_lf
, y_log10 = FALSE , y_log10 = FALSE
, y_scale_percent = FALSE , y_scale_percent = FALSE
, y_label = c("Count", "SNP diversity") , y_label = c("Count", "SNP diversity")
, ...
#, y_label = c("Count") #, y_label = c("Count")
) { ) {
if(!all_lineages){ if(!all_lineages){

View file

@ -36,7 +36,7 @@ lin_count_bp_diversity <- function( lf_data = lin_wf
, subtitle_text = NULL , subtitle_text = NULL
, sts = 20 , sts = 20
, subtitle_colour = "#350E20FF" #brown , subtitle_colour = "#350E20FF" #brown
) { , ...) {
if(!all_lineages){ if(!all_lineages){
lf_data = lf_data[lf_data[[x_categ]]%in%use_lineages,] lf_data = lf_data[lf_data[[x_categ]]%in%use_lineages,]
} }

View file

@ -79,11 +79,12 @@ LogoPlotCustomH <- function(plot_df
#------------------- #-------------------
if (y_axis_log){ if (y_axis_log){
log_colname = paste0("log_", y_axis_colname) log_colname = paste0("log10_", y_axis_colname)
plot_df[log_colname] = log_value(plot_df[y_axis_colname]) #plot_df[log_colname] = log_value(plot_df[y_axis_colname])
#plot_df[[log_colname]] = log10(plot_df[y_axis_colname])
logo_df = plot_df[, c(x_axis_colname, symbol_colname, log_colname)] logo_df = plot_df[, c(x_axis_colname, symbol_colname, log_colname)]
logo_df_plot = logo_df[, c(x_axis_colname, symbol_colname, log_colname)] logo_df_plot = logo_df[, c(x_axis_colname, symbol_colname, log_colname)]
logo_df_plot = logo_df_plot %>% spread(x_axis_colname, y_axis_colname, fill = 0.0) logo_df_plot = logo_df_plot %>% spread(x_axis_colname, log_colname, fill = 0.0)
rownames(logo_df_plot) = logo_df_plot$mutant_type rownames(logo_df_plot) = logo_df_plot$mutant_type
logo_df_plot$mutant_type = NULL logo_df_plot$mutant_type = NULL
logo_dfP_wf=as.matrix(logo_df_plot) logo_dfP_wf=as.matrix(logo_df_plot)
@ -151,15 +152,15 @@ LogoPlotCustomH <- function(plot_df
ytt_col = "black" ytt_col = "black"
} }
if (y_axis_log){ # if (y_axis_log){
#
if (grepl("Log", y_lab)){ # if (grepl("Log", y_lab)){
y_lab = y_lab # y_lab = y_lab
#
}else{ # }else{
y_lab = paste("Log", y_lab) # y_lab = paste("Log", y_lab)
} # }
} # }
plot_grid( plot_grid(
ggplot() + ggplot() +
geom_logo(logo_dfP_wf geom_logo(logo_dfP_wf