added placeholder defaults for functions in R to make sure that R shiny layput works with a data set for meeting tomorrow

This commit is contained in:
Tanushree Tunstall 2022-02-14 19:33:00 +00:00
parent 0460ca1708
commit d38521e03a
11 changed files with 120 additions and 83 deletions

View file

@ -1,5 +1,5 @@
source("~/git/LSHTM_analysis/config/gid.R")
#source("~/git/LSHTM_analysis/config/pnca.R")
#source("~/git/LSHTM_analysis/config/gid.R")
source("~/git/LSHTM_analysis/config/pnca.R")
#source("~/git/LSHTM_analysis/config/embb.R")
#source("~/git/LSHTM_analysis/config/katg.R")
#source("~/git/LSHTM_analysis/config/alr.R")
@ -12,7 +12,7 @@ source("~/git/LSHTM_analysis/scripts/plotting/get_plotting_dfs.R")
# mainly OR
# script: logoP_or.R
################################
LogoPlotCustomH (plot_df = merged_df3
LP1<- LogoPlotCustomH (plot_df = merged_df3
, x_axis_colname = "position"
, y_axis_colname = "or_mychisq"
, symbol_colname = "mutant_type"
@ -25,10 +25,10 @@ LogoPlotCustomH (plot_df = merged_df3
, y_lab = "Odds Ratio"
, x_ats = 10 # text size
, x_tangle = 90 # text angle
, y_ats = 22
, y_ats = 15
, y_tangle = 0
, x_tts = 19 # title size
, y_tts = 22
, x_tts = 13 # title size
, y_tts = 13
#, leg_pos = c(0.05,-0.12)
, leg_pos = "top"
, leg_dir = "horizontal"
@ -36,30 +36,29 @@ LogoPlotCustomH (plot_df = merged_df3
, leg_tts = 16 # leg title size
)
########################################
# Logo plot showing nsSNPs by positions
# wild-type and mutant aa
# script: logoP_snp.R
########################################
LogoPlotSnps(plot_df = merged_df3
LP2<- LogoPlotSnps(plot_df = merged_df3
, x_axis_colname = "position"
, symbol_mut_colname = "mutant_type"
, symbol_wt_colname = "wild_type"
, omit_snp_count = c(1)# can be 0,1, 2, etc.
, my_logo_col = "chemistry"
, omit_snp_count = c(1)# can be 0,1, 2, etc.# DD
, my_logo_col = "chemistry" #DD
, x_lab = "Wild-type position"
, y_lab = "nsSNP count"
, x_ats = 10 # text size
, x_tangle = 90 # text angle
, y_ats = 18
, x_ats = 10
, x_tangle = 90
, y_ats = 15
, y_tangle = 0
, x_tts = 18 # title size
, y_tts = 18
, x_tts = 13
, y_tts = 13
, leg_pos = "top" # can be top, left, right and bottom or c(0.8, 0.9)
, leg_dir = "horizontal" # can be vertical or horizontal
, leg_ts = 14 # leg text size
, leg_tts = 16 # leg title size
, leg_ts = 14
, leg_tts = 16
)
####################################################
@ -76,13 +75,12 @@ LogoPlotSnps(plot_df = merged_df3
# to select a small dataset: see test_ed_pfm_data.R
#####################################################
LogoPlotMSA(msaSeq_mut = msa_seq
LP3<- LogoPlotMSA(msaSeq_mut = msa_seq
, msaSeq_wt = wt_seq
, logo_type = c("EDLogo") # "EDLogo", bits_pfm", "probability_pfm", "bits_raw", "probability_raw")
, EDScore_type = c("log")
, bg_prob = NULL
, my_logo_col = "taylor"
, my_logo_col = "chemistry"
#, plot_positions = c(5:10, 92, 195, 118:119)
, x_axis_offset = 0.02
, x_axis_offset_filtered = 0.05
@ -101,3 +99,14 @@ LogoPlotMSA(msaSeq_mut = msa_seq
, leg_ts = 16
, leg_tts = 16
)
out_logoP = cowplot::plot_grid(LP3, LP1, LP2
, nrow = 3
, ncol = 1
, rel_width = c(1/3, 0.5/3, 1/3)
, rel_heights = c(1, 1, 1)
, align = "hv")
out_logoP