various changes

This commit is contained in:
Tanushree Tunstall 2022-03-02 11:44:04 +00:00
parent 2274f01f23
commit 6c6709e41e
6 changed files with 198 additions and 29 deletions

View file

@ -0,0 +1,63 @@
############################################################################
# merged_df3 = read.csv("~/git/Data/cycloserine/output/alr_all_params.csv"); source("~/git/LSHTM_analysis/config/alr.R")
# if ( tolower(gene) == "alr") {
# aa_pos_lig1 = NULL
# aa_pos_lig2 = NULL
# aa_pos_lig3 = NULL
# p_title = gene
# }
source("~/git/LSHTM_analysis/scripts/plotting/get_plotting_dfs.R")
###########################################################################
# merged_df3 = read.csv("~/git/Data/ethambutol/output/embb_all_params.csv"); source("~/git/LSHTM_analysis/config/embb.R")
# if ( tolower(gene) == "embb") {
# aa_pos_lig1 = aa_pos_ca
# aa_pos_lig2 = aa_pos_cdl
# aa_pos_lig3 = aa_pos_dsl
# p_title = gene
# }
source("~/git/LSHTM_analysis/scripts/plotting/get_plotting_dfs.R")
###########################################################################
merged_df3 = read.csv("~/git/Data/streptomycin/output/gid_all_params.csv")
source("~/git/LSHTM_analysis/config/gid.R")
if ( tolower(gene) == "gid") {
aa_pos_lig1 = aa_pos_rna
aa_pos_lig2 = aa_pos_sam
aa_pos_lig3 = aa_pos_amp
p_title = gene
}
source("~/git/LSHTM_analysis/scripts/plotting/get_plotting_dfs.R")
###########################################################################
# merged_df3 = read.csv("~/git/Data/isoniazid/output/katg_all_params.csv"); source("~/git/LSHTM_analysis/config/katg.R")
# if ( tolower(gene) == "katg") {
# aa_pos_lig1 = aa_pos_hem
# aa_pos_lig2 = NULL
# aa_pos_lig3 = NULL
# p_title = gene
# }
source("~/git/LSHTM_analysis/scripts/plotting/get_plotting_dfs.R")
###########################################################################
# merged_df3 = read.csv("~/git/Data/pyrazinamide/output/pnca_all_params.csv"); source("~/git/LSHTM_analysis/config/pnca.R")
# if ( tolower(gene) == "pnca") {
# aa_pos_lig1 = aa_pos_fe
# aa_pos_lig2 = NULL
# aa_pos_lig3 = NULL
# p_title = gene
# }
source("~/git/LSHTM_analysis/scripts/plotting/get_plotting_dfs.R")
###########################################################################
merged_df3 = read.csv("~/git/Data/rifampicin/output/rpob_all_params.csv"); source("~/git/LSHTM_analysis/config/rpob.R")
if ( tolower(gene) == "rpob") {
aa_pos_lig1 = NULL
aa_pos_lig2 = NULL
aa_pos_lig3 = NULL
p_title = gene
}
source("~/git/LSHTM_analysis/scripts/plotting/get_plotting_dfs.R")
#########################################################################

View file

@ -15,13 +15,13 @@ source("~/git/LSHTM_analysis/scripts/functions/consurfP.R")
# p_title = gene
# }
###########################################################################
merged_df3 = read.csv("~/git/Data/ethambutol/output/embb_all_params.csv"); source("~/git/LSHTM_analysis/config/embb.R")
if ( tolower(gene) == "embb") {
aa_pos_lig1 = aa_pos_ca
aa_pos_lig2 = aa_pos_cdl
aa_pos_lig3 = aa_pos_dsl
p_title = gene
}
# merged_df3 = read.csv("~/git/Data/ethambutol/output/embb_all_params.csv"); source("~/git/LSHTM_analysis/config/embb.R")
# if ( tolower(gene) == "embb") {
# aa_pos_lig1 = aa_pos_ca
# aa_pos_lig2 = aa_pos_cdl
# aa_pos_lig3 = aa_pos_dsl
# p_title = gene
# }
###########################################################################
# merged_df3 = read.csv("~/git/Data/streptomycin/output/gid_all_params.csv"); source("~/git/LSHTM_analysis/config/gid.R")
# if ( tolower(gene) == "gid") {
@ -47,13 +47,13 @@ if ( tolower(gene) == "embb") {
# p_title = gene
# }
###########################################################################
# merged_df3 = read.csv("~/git/Data/rifampicin/output/rpob_all_params.csv"); source("~/git/LSHTM_analysis/config/rpob.R")
# if ( tolower(gene) == "rpob") {
# aa_pos_lig1 = NULL
# aa_pos_lig2 = NULL
# aa_pos_lig3 = NULL
# p_title = gene
# }
merged_df3 = read.csv("~/git/Data/rifampicin/output/rpob_all_params.csv"); source("~/git/LSHTM_analysis/config/rpob.R")
if ( tolower(gene) == "rpob") {
aa_pos_lig1 = NULL
aa_pos_lig2 = NULL
aa_pos_lig3 = NULL
p_title = gene
}
#########################################################################
consurf_palette1 = c("0" = "yellow2"
@ -99,15 +99,19 @@ wideP_consurf(plotdf = merged_df3
, "1" = "Variable"
, "2", "3", "4", "5", "6", "7", "8"
, "9" = "Conserved")
, panel_col = "black"
, panel_col_fill = "black"
# axes title and label sizes
, x_axts = 8
, x_axts = 8
, y_axts = 12
, x_axls = 12
, y_axls = 15
, default_xtc = "black"
, ptitle = p_title
, xlab = ""
, xlab = "" # ylab is above
, pts = 20
# x-axis: text colour
, xtext_colour_aa = F

View file

@ -16,10 +16,10 @@ LP1<- LogoPlotCustomH (plot_df = merged_df3
, x_axis_colname = "position"
, y_axis_colname = "or_mychisq"
, symbol_colname = "mutant_type"
, y_axis_log = T
, y_axis_log = F
, log_value = log10
, y_axis_increment = 100
, rm_empty_y = T
, y_axis_increment = 50
, rm_empty_y = F
, my_logo_col = 'chemistry'
, x_lab = "Wild-type position"
, y_lab = "Odds Ratio"
@ -45,7 +45,7 @@ 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.# DD
, omit_snp_count = c(0)# can be 0,1, 2, etc.# DD
, my_logo_col = "chemistry" #DD
, x_lab = "Wild-type position"
, y_lab = "nsSNP count"
@ -75,8 +75,9 @@ LP2<- LogoPlotSnps(plot_df = merged_df3
# to select a small dataset: see test_ed_pfm_data.R
#####################################################
LP3<- LogoPlotMSA(msaSeq_mut = msa_seq
, msaSeq_wt = wt_seq
LP3<- LogoPlotMSA(unified_msa
#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
@ -90,7 +91,7 @@ LP3<- LogoPlotMSA(msaSeq_mut = msa_seq
#, y_lab_mut
, x_ats = 10
, x_tangle = 90
, y_ats = 15
, y_ats = 12
, y_tangle = 0
, x_tts = 13
, y_tts = 13
@ -106,7 +107,7 @@ 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)
, rel_heights = c(0.8/2, 0.5/2, 0.7/2)
, align = "hv")
out_logoP