diff --git a/scripts/functions/bp_lineage.R b/scripts/functions/bp_lineage.R index debd8e9..643d0a5 100644 --- a/scripts/functions/bp_lineage.R +++ b/scripts/functions/bp_lineage.R @@ -5,9 +5,9 @@ ######################################## lin_count_bp <- function( lf_data = lin_lf + , all_lineages = F , x_categ = "sel_lineages" , y_count = "p_count" - , all_lineages = F , use_lineages = c("L1", "L2", "L3", "L4") , bar_fill_categ = "count_categ" , display_label_col = "p_count" diff --git a/scripts/functions/consurfP.R b/scripts/functions/consurfP.R index f976c62..35d4a08 100644 --- a/scripts/functions/consurfP.R +++ b/scripts/functions/consurfP.R @@ -238,12 +238,31 @@ wideP_consurf <- function(plotdf my_xlim = length(unique(plotdf[[xvar_colname]])); my_xlim ymin = min(plotdf[[yvar_colname]]); ymin ymax = max(plotdf[[yvar_colname]]); ymax + # DEBUG + # x_factor = as.factor(plotdf[[xvar_colname]]) + # y_colour_factor = as.factor(plotdf[[yvar_colourN_colname]]) + # cat('XXXX THIS:', str(x_factor)) + # + # g = ggplot(plotdf, aes_string(x = x_factor) + # , y = yvar_colname + # , colour = y_colour_factor) + g = ggplot(plotdf, aes_string(x = sprintf("factor(%s)", xvar_colname) , y = yvar_colname , colour = sprintf("factor(%s)", yvar_colourN_colname) - )) - # "if SPECIAL do SPECIAL THING, otherwise do NORMAL THING" + )) + # g = ggplot(plotdf, aes_string(x = "position") + # , y = "consurf_score" + # , colour = "consurf_colour_rev") + # g = ggplot(plotdf, aes_string(x = "position") + # , y = "consurf_score" + # , colour = "consurf_colour_rev") + + # DEBUG + #g0=g + + "if SPECIAL do SPECIAL THING, otherwise do NORMAL THING" if (plot_type == "bar"){ g0 = g + geom_bar(stat = "identity") @@ -260,15 +279,15 @@ wideP_consurf <- function(plotdf } if (plot_error_bars){ - g0 = g0 + + g0 = g0 + geom_errorbar(aes(ymin = eval(parse(text = lower_EB_colname)) , ymax = eval(parse(text = upper_EB_colname)) )) }else{ - - g0 = g0 - - } + + g0 = g0 + + } #--------------------- # add axis formatting diff --git a/scripts/functions/lf_bp.R b/scripts/functions/lf_bp.R index 90d7381..c88f805 100644 --- a/scripts/functions/lf_bp.R +++ b/scripts/functions/lf_bp.R @@ -8,7 +8,7 @@ lf_bp <- function(lf_df = lf_duet , p_title = "DUET-DDG" - , colour_categ = "duet_outcome" + , colour_categ = "outcome" , x_grp = "mutation_info_labels" , y_var = "param_value" , facet_var = "param_type" diff --git a/scripts/functions/logoP_snp.R b/scripts/functions/logoP_snp.R index fbd8f10..db5c9c8 100644 --- a/scripts/functions/logoP_snp.R +++ b/scripts/functions/logoP_snp.R @@ -52,8 +52,8 @@ LogoPlotSnps <- function(plot_df { # handle funky omit_snp_count. DOES NOT WORK YET - if (class(omit_snp_count != 'numeric')){ - omit_snp_count <- as.numeric(unlist(str_extract_all(thing, regex("[0-9]")))) + if (class(omit_snp_count) != "numeric"){ + omit_snp_count <- as.numeric(unlist(str_extract_all(omit_snp_count, regex("[0-9]+")))) } ############################################ # Data processing for logo plot for nsSNPS diff --git a/scripts/functions/my_pairs_panel.R b/scripts/functions/my_pairs_panel.R index 808417f..7928fd5 100644 --- a/scripts/functions/my_pairs_panel.R +++ b/scripts/functions/my_pairs_panel.R @@ -40,7 +40,7 @@ my_corr_pairs <- function (corr_data_all ###################################################################### my_pp = function (x, smooth = TRUE, scale = FALSE, density = TRUE, ellipses = TRUE, - digits = 2, method = "pearson", pch = 20, lm = FALSE, cor = TRUE, + digits = 2, method = "spearman", pch = 20, lm = FALSE, cor = TRUE, jiggle = FALSE, factor = 2, hist.col = "cyan", show.points = TRUE, rug = TRUE, breaks = "Sturges", cex.cor = 1, wt = NULL, smoother = FALSE, stars = FALSE, ci = FALSE, alpha = 0.05, ...) diff --git a/scripts/functions/stability_count_bp.R b/scripts/functions/stability_count_bp.R index f6cd975..1a38059 100644 --- a/scripts/functions/stability_count_bp.R +++ b/scripts/functions/stability_count_bp.R @@ -15,8 +15,8 @@ theme_set(theme_grey()) ## ...opt args #========================================================== stability_count_bp <- function(plotdf - , df_colname = "duet_outcome" - , leg_title = "DUET" + , df_colname = "" + , leg_title = "" , ats = 25 # axis text size , als = 22 # axis label size , lts = 20 # legend text size