added corr plots as function for interactive graphs on shiny
This commit is contained in:
parent
c0c30fd527
commit
0c16937b68
2 changed files with 28 additions and 3 deletions
|
@ -1,3 +1,28 @@
|
||||||
|
my_corr_pairs <- function (corr_data){
|
||||||
|
|
||||||
|
OutPlot_corr = pairs.panels(corr_data
|
||||||
|
, method = "spearman" # correlation method
|
||||||
|
, hist.col = "grey" ##00AFBB
|
||||||
|
, density = TRUE # show density plots
|
||||||
|
, ellipses = F # show correlation ellipses
|
||||||
|
, stars = T
|
||||||
|
, rug = F
|
||||||
|
, breaks = "Sturges"
|
||||||
|
, show.points = T
|
||||||
|
#, bg = c("#f8766d", "#00bfc4")[unclass(factor(corr_ps$duet_outcome))] # foldx colours are reveresed
|
||||||
|
#, pch = 21 # for bg
|
||||||
|
, jitter = T
|
||||||
|
, alpha = 1
|
||||||
|
, cex = 1.8
|
||||||
|
, cex.axis = 2
|
||||||
|
, cex.labels = 3.5
|
||||||
|
, cex.cor = 1
|
||||||
|
, smooth = F)
|
||||||
|
return(OutPlot_corr)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
######################################################################
|
||||||
my_pp = function (x, smooth = TRUE, scale = FALSE, density = TRUE, ellipses = TRUE,
|
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 = "pearson", pch = 20, lm = FALSE, cor = TRUE,
|
||||||
jiggle = FALSE, factor = 2, hist.col = "cyan", show.points = TRUE,
|
jiggle = FALSE, factor = 2, hist.col = "cyan", show.points = TRUE,
|
||||||
|
|
|
@ -415,7 +415,7 @@ dim(corr_data_ps)
|
||||||
#--------------------------------------
|
#--------------------------------------
|
||||||
my_corr_colnames = c("Mutation"
|
my_corr_colnames = c("Mutation"
|
||||||
, "DUET"
|
, "DUET"
|
||||||
, "Foldx"
|
, "FoldX"
|
||||||
#, "Mutation class"
|
#, "Mutation class"
|
||||||
, "ASA"
|
, "ASA"
|
||||||
, "RSA"
|
, "RSA"
|
||||||
|
@ -476,7 +476,7 @@ if (nrow(corr_ps_df3) == nrow(merged_df3) && nrow(merged_df3_comp) == check1) {
|
||||||
# Data for Correlation plots: LIG
|
# Data for Correlation plots: LIG
|
||||||
#=================================
|
#=================================
|
||||||
cat("\n=========================================="
|
cat("\n=========================================="
|
||||||
, "\nCORR PLOTS data: PS"
|
, "\nCORR PLOTS data: LIG"
|
||||||
, "\n===========================================")
|
, "\n===========================================")
|
||||||
|
|
||||||
df_lig = merged_df2_lig
|
df_lig = merged_df2_lig
|
||||||
|
@ -577,7 +577,7 @@ if (nrow(corr_lig_df3) == nrow(merged_df3_lig) && nrow(merged_df3_comp_lig) == c
|
||||||
identical(corr_data_lig, corr_lig_df2)
|
identical(corr_data_lig, corr_lig_df2)
|
||||||
identical(corr_data_ps, corr_ps_df2)
|
identical(corr_data_ps, corr_ps_df2)
|
||||||
|
|
||||||
rm(df_ps, df_lig, corr_data_ps, corr_data_lig)
|
#rm(df_ps, df_lig, corr_data_ps, corr_data_lig)
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
# End of script
|
# End of script
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue