Merge branch 'master' of https://git.tunstall.in/tanu/LSHTM_analysis
This commit is contained in:
commit
d61d11e020
6 changed files with 33 additions and 14 deletions
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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, ...)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue