added stat_bp_stability.R which needs to be a function for generating stat plots
This commit is contained in:
parent
6d9412d232
commit
6e01ef22c0
1 changed files with 51 additions and 0 deletions
51
scripts/functions/stat_bp_stability.R
Normal file
51
scripts/functions/stat_bp_stability.R
Normal file
|
@ -0,0 +1,51 @@
|
|||
my_stat_ps = compare_means(param_value~mutation_info, group.by = "param_type"
|
||||
, data = df_lf_ps, paired = FALSE, p.adjust.method = "BH")
|
||||
|
||||
y_value = "param_value"
|
||||
|
||||
stat_bp_mut <- function(df
|
||||
, x_bp_cateog = "mutation_info"
|
||||
, y_var = "param_value"
|
||||
, facet_var = "param_type"
|
||||
, scales = "free_y"
|
||||
, title = ""
|
||||
, col_categ = "duet_outcome"
|
||||
, grp_comp = "my_comparisons"
|
||||
, stat_method = "wilcox.test"
|
||||
, my_paired = FALSE
|
||||
#, stat_label = "p.format")
|
||||
, stat_label = "p.signif" )
|
||||
|
||||
p1 = ggplot(df_lf_ps, aes(x = mutation_info
|
||||
, y = eval(parse(text = y_value)) )) +
|
||||
facet_wrap(~ param_type
|
||||
, nrow = 1
|
||||
, scales = "free_y") +
|
||||
geom_boxplot(fill = "white", outlier.colour = NA
|
||||
#, position = position_dodge(width = 0.9)
|
||||
, width = 0.2) +
|
||||
geom_point(position = position_jitterdodge(dodge.width=0.01)
|
||||
, alpha = 0.5
|
||||
, show.legend = FALSE
|
||||
, aes(colour = factor(duet_outcome))) +
|
||||
theme(axis.text.x = element_text(size = my_ats)
|
||||
, axis.text.y = element_text(size = my_ats
|
||||
, angle = 0
|
||||
, hjust = 1
|
||||
, vjust = 0)
|
||||
, axis.title.x = element_text(size = my_ats)
|
||||
, axis.title.y = element_text(size = my_ats)
|
||||
, plot.title = element_text(size = my_pts , hjust = 0.5, colour = "black", face = "bold")
|
||||
, strip.background = element_rect(fill = "khaki2")
|
||||
, strip.text.x = element_text(size = my_fls, colour = "black")
|
||||
, legend.title = element_text(color = "black", size = my_als)
|
||||
, legend.text = element_text(size = my_ats)
|
||||
, legend.direction = "vertical") +
|
||||
labs(title = "DUET"
|
||||
, x = ""
|
||||
, y = "")+
|
||||
stat_compare_means(comparisons = my_comparisons
|
||||
, method = "wilcox.test"
|
||||
, paired = FALSE
|
||||
#, label = "p.format")
|
||||
, label = "p.signif")
|
Loading…
Add table
Add a link
Reference in a new issue