added more scripts

This commit is contained in:
Tanushree Tunstall 2022-08-24 20:04:29 +01:00
parent 9aed99e805
commit 11b936f09b
9 changed files with 148 additions and 117 deletions

View file

@ -54,7 +54,8 @@ plp_pos_paper = sort(unique(c(66, 70, 112, 196, 227, 237, 252, 254, 255, 388)))
aa_pos_plp = sort(unique(c(plp_pos_paper, 66, 70, 112, 237, 252, 254, 255, 196)))
#######################################################################
# this is post inspection on chimera
remove_pos = c(295, 314, 342, 343, 344)
#===============
# Active site aa
#===============
@ -63,31 +64,40 @@ active_aa_pos = sort(unique(c(aa_ligplus_dcs
, aa_arpeg_dcs
, aa_pos_paper
, aa_pos_plp)))
active_aa_pos = active_aa_pos[!active_aa_pos%in%remove_pos]
#=================
# Drug binding aa
#=================
aa_pos_dcs = sort(unique(c(aa_ligplus_dcs
, aa_plip_dcs
, aa_arpeg_dcs)))
aa_pos_drug = aa_pos_dcs
aa_pos_dcs = aa_pos_dcs[!aa_pos_dcs%in%remove_pos]
aa_pos_drug = aa_pos_dcs
#===============
# Co-factor: PLP aa
#===============
aa_pos_plp = aa_pos_plp
#aa_pos_plp = aa_pos_plp[!aa_pos_plp%in%remove_pos]
#===============
# Hbond aa
#===============
aa_pos_dcs_hbond = sort(unique(c(aa_ligplus_dcs_hbond
, aa_plip_dcs_hbond)))
aa_pos_dcs_hbond = aa_pos_dcs_hbond[!aa_pos_dcs_hbond%in%remove_pos]
#=======================
# Other interactions aa
#=======================
aa_pos_dcs_other = active_aa_pos[!active_aa_pos%in%aa_pos_dcs_hbond]
aa_pos_dcs_other = aa_pos_dcs_other[!aa_pos_dcs_other%in%remove_pos]
c3 = length(aa_pos_dcs_other) == length(active_aa_pos) - length(aa_pos_dcs_hbond)
#######################################################################
@ -144,4 +154,17 @@ aa_pos_lig2 = NULL
aa_pos_lig3 = NULL
tile_map=data.frame(tile=c("ALR","PLP"),
tile_colour=c("green","navyblue")) #darkslategrey
tile_colour=c("green","navyblue")) #darkslategrey
######
chain_suffix = ".A"
toString(paste0(aa_pos_drug, chain_suffix))
toString(paste0(aa_pos_plp, chain_suffix))
toString(paste0(active_aa_pos, chain_suffix))
common_pos = aa_pos_drug[aa_pos_drug%in%aa_pos_plp]
cat("\nCommon interacting partners:", length(common_pos))
common_pos
toString(paste0(common_pos, chain_suffix))

View file

@ -28,9 +28,12 @@ aa_arpeg_rfp = c(170, 428, 429, 430, 431, 432
, 607, 674)
##############################################################
remove_pos = c(170, 674, 604)
active_aa_pos = sort(unique(c(aa_plip_rfp
, aa_plip_5uhc_rfp
, aa_arpeg_rfp)))
active_aa_pos = active_aa_pos[!active_aa_pos%in%remove_pos]
##############################################################
cat("\nNo. of active site residues for gene"
, gene, ":"
@ -42,11 +45,14 @@ aa_pos_rfp = sort(unique(c(aa_plip_rfp
, aa_plip_5uhc_rfp
, aa_arpeg_rfp)))
aa_pos_rfp = aa_pos_rfp[!aa_pos_rfp%in%remove_pos]
aa_pos_drug = aa_pos_rfp
aa_pos_rfp_hbond = sort(unique(c(aa_plip_rfp_hbond
, aa_plip_5uhc_rfp_hbond)))
aa_pos_rfp_hbond = aa_pos_rfp_hbond[!aa_pos_rfp_hbond%in%remove_pos]
cat("\n==================================================="
, "\nActive site residues for", gene, "comprise of..."
, "\n==================================================="
@ -62,3 +68,7 @@ aa_pos_lig3 = NULL
tile_map=data.frame(tile=c("RPO","DPA","CDL","Ca"),
tile_colour=c("green","darkslategrey","navyblue","purple"))
####
chain_suffix = ".C"
print(toString(paste0(aa_pos_drug, chain_suffix)))

View file

@ -3,26 +3,25 @@ source("/home/tanu/git/LSHTM_analysis/scripts/plotting/plotting_thesis/alr/sensi
##############################################################
# PE count
#lig-- na--ppi2--stab
# pe_colour_map = c("DD_lig" = "#ffd700" # gold
# , "SS_lig" = "#f0e68c" # khaki
#
# , "DD_nucleic_acid"= "#a0522d" # sienna
# , "SS_nucleic_acid"= "#d2b48c" # tan
#
# , "DD_ppi2" = "#da70d6" # orchid
# , "SS_ppi2" = "#ff1493" # deeppink
#
# , "DD_stability" = "#f8766d" # red
# , "SS_stability" = "#00BFC4") # blue
#pe_colour_map = c("DD_lig" = "#f0e68c" # khaki
# , "SS_lig" = "#ffd700" # gold
# , "DD_nucleic_acid"= "#d2b48c" # sandybrown
# , "SS_nucleic_acid"= "#a0522d" # sienna
# , "DD_ppi2" = "#da70d6" # orchid
# , "SS_ppi2" = "#ff1493" # deeppink
# , "DD_stability" = "#f8766d" # red
# , "SS_stability" = "#00BFC4") # blue
table(str_df_plot_cols$pe_effect_outcome)
##############################################################
#===========
#PE count
#PE count: lig, ppi2, stab
#===========
rects <- data.frame(x=1:6,
colors = c("#ffd700" ,
"#f0e68c" ,
colors = c("#f0e68c" ,
"#ffd700" ,
"#da70d6" ,
"#ff1493" ,

View file

@ -261,6 +261,8 @@ if (nrow(dd_lig) == table(str_df_plot_cols$pe_effect_outcome)[['DD_lig']]){
dd_lig_pos = dd_lig[[pos_colname]]
}else{
stop("Abort: DD affinity colour numbers mismtatch")
print(toString(paste0(dd_lig_pos, chain_suffix)))
}
# +ve Lig Aff
@ -272,13 +274,9 @@ if (!empty(ss_lig)){
stop("Abort: SS affinity colour numbers mismtatch")
}
#put in chimera cmd
paste0(dd_lig_pos, chain_suffix)
paste0(ss_lig_pos, chain_suffix)
print(toString(paste0(ss_lig_pos, chain_suffix)))
}
#===================================================
#-------------------
# PPI2 Affinity
@ -289,6 +287,8 @@ if (nrow(dd_ppi2) == table(str_df_plot_cols$pe_effect_outcome)[['DD_ppi2']]){
dd_ppi2_pos = dd_ppi2[[pos_colname]]
}else{
stop("Abort: DD PPI2 colour numbers mismtatch")
print(toString(paste0(dd_ppi2_pos,chain_suffix)))
}
# +ve PPI2
@ -297,11 +297,11 @@ if (nrow(ss_ppi2) == table(str_df_plot_cols$pe_effect_outcome)[['SS_ppi2']]){
ss_ppi2_pos = ss_ppi2[[pos_colname]]
}else{
stop("Abort: SS PPI2 colour numbers mismtatch")
print(toString(paste0(ss_ppi2_pos,chain_suffix)))
}
#put in chimera cmd
paste0(dd_ppi2_pos,chain_suffix)
paste0(ss_ppi2_pos,chain_suffix)
#=========================================================
#------------------------
@ -323,9 +323,9 @@ if (nrow(ss_stability) == table(str_df_plot_cols$pe_effect_outcome)[['SS_stabil
stop("Abort: SS Stability colour numbers mismtatch")
}
#put in chimera cmd
# stabiliting first as it has less numbers
paste0(ss_stability_pos, chain_suffix)
paste0(dd_stability_pos, chain_suffix)
# put in chimera cmd
print(toString(paste0(dd_stability_pos, chain_suffix)))
print(toString(paste0(ss_stability_pos, chain_suffix)))
####################################################################

View file

@ -3,29 +3,30 @@ source("/home/tanu/git/LSHTM_analysis/scripts/plotting/plotting_thesis/gid/sensi
##############################################################
# PE count
#lig-- na--ppi2--stab
# pe_colour_map = c("DD_lig" = "#ffd700" # gold
# , "SS_lig" = "#f0e68c" # khaki
#
# , "DD_nucleic_acid"= "#a0522d" # sienna
# , "SS_nucleic_acid"= "#d2b48c" # tan
#
# , "DD_ppi2" = "#da70d6" # orchid
# , "SS_ppi2" = "#ff1493" # deeppink
#
# , "DD_stability" = "#f8766d" # red
# , "SS_stability" = "#00BFC4") # blue
#pe_colour_map = c("DD_lig" = "#f0e68c" # khaki
# , "SS_lig" = "#ffd700" # gold
# , "DD_nucleic_acid"= "#d2b48c" # sandybrown
# , "SS_nucleic_acid"= "#a0522d" # sienna
# , "DD_ppi2" = "#da70d6" # orchid
# , "SS_ppi2" = "#ff1493" # deeppink
# , "DD_stability" = "#f8766d" # red
# , "SS_stability" = "#00BFC4") # blue
table(str_df_plot_cols$pe_effect_outcome)
##############################################################
#===========
#PE count
#PE count:
# lig, na, stability
#===========
rects <- data.frame(x=1:6,
colors = c("#ffd700" ,
"#f0e68c" ,
colors = c("#f0e68c" ,
"#ffd700" ,
"#a0522d" ,
"#d2b48c" ,
"#a0522d" ,
"#f8766d" ,
"#00BFC4")

View file

@ -3,29 +3,26 @@ source("/home/tanu/git/LSHTM_analysis/scripts/plotting/plotting_thesis/katg/sens
##############################################################
# PE count
#lig-- na--ppi2--stab
# pe_colour_map = c("DD_lig" = "#ffd700" # gold
# , "SS_lig" = "#f0e68c" # khaki
#
# , "DD_nucleic_acid"= "#a0522d" # sienna
# , "SS_nucleic_acid"= "#d2b48c" # tan
#
# , "DD_ppi2" = "#da70d6" # orchid
# , "SS_ppi2" = "#ff1493" # deeppink
#
# , "DD_stability" = "#f8766d" # red
# , "SS_stability" = "#00BFC4") # blue
#pe_colour_map = c("DD_lig" = "#f0e68c" # khaki
# , "SS_lig" = "#ffd700" # gold
# , "DD_nucleic_acid"= "#d2b48c" # sandybrown
# , "SS_nucleic_acid"= "#a0522d" # sienna
# , "DD_ppi2" = "#da70d6" # orchid
# , "SS_ppi2" = "#ff1493" # deeppink
# , "DD_stability" = "#f8766d" # red
# , "SS_stability" = "#00BFC4") # blue
table(str_df_plot_cols$pe_effect_outcome)
##############################################################
#===========
#PE count
#PE count:
# lig, ppi2, stability
#===========
rects <- data.frame(x=1:6,
colors = c("#ffd700" ,
"#f0e68c" ,
#"#a0522d" ,
#"#d2b48c" ,
colors = c("#f0e68c" ,
"#ffd700" ,
"#da70d6" ,
"#ff1493" ,
@ -37,9 +34,6 @@ rects <- data.frame(x=1:6,
rects$text = c("-ve Lig"
, "+ve Lig"
#, "-ve\nNuc.Acid"
#, "+ve\nNuc.Acid"
, "-ve PPI2"
, "+ve PPI2"

View file

@ -7,9 +7,8 @@
#=============
# Data: Input
#==============
#source("~/git/LSHTM_analysis/config/rpob.R")
#source("~/git/LSHTM_analysis/scripts/plotting/get_plotting_dfs.R")
source("~/git/LSHTM_analysis/config/rpob.R")
source("~/git/LSHTM_analysis/scripts/plotting/get_plotting_dfs.R")
#cat("\nSourced plotting cols as well:", length(plotting_cols))

View file

@ -4,28 +4,29 @@ source("/home/tanu/git/LSHTM_analysis/scripts/plotting/plotting_thesis/rpob/sens
##############################################################
# PE count
#lig-- na--ppi2--stab
# pe_colour_map = c("DD_lig" = "#ffd700" # gold
# , "SS_lig" = "#f0e68c" # khaki
#
# , "DD_nucleic_acid"= "#a0522d" # sienna
# , "SS_nucleic_acid"= "#d2b48c" # tan
#
# , "DD_ppi2" = "#da70d6" # orchid
# , "SS_ppi2" = "#ff1493" # deeppink
#
# , "DD_stability" = "#f8766d" # red
# , "SS_stability" = "#00BFC4") # blue
pe_colour_map = c("DD_lig" = "#f0e68c" # khaki
, "SS_lig" = "#ffd700" # gold
, "DD_nucleic_acid"= "#d2b48c" # sandybrown
, "SS_nucleic_acid"= "#a0522d" # sienna
, "DD_ppi2" = "#da70d6" # orchid
, "SS_ppi2" = "#ff1493" # deeppink
, "DD_stability" = "#f8766d" # red
, "SS_stability" = "#00BFC4") # blue
table(str_df_plot_cols$pe_effect_outcome)
##############################################################
#===========
#PE count
#===========
rects <- data.frame(x=1:8,
colors = c("#ffd700" ,
"#f0e68c" ,
colors = c("#f0e68c" ,
"#ffd700" ,
"#a0522d" ,
"#d2b48c" ,
"#a0522d" ,
"#da70d6" ,
"#ff1493" ,

View file

@ -1,13 +1,11 @@
#!/usr/bin/env Rscript
#source("~/git/LSHTM_analysis/config/alr.R")
#source("~/git/LSHTM_analysis/config/embb.R")
#source("~/git/LSHTM_analysis/config/katg.R")
#source("~/git/LSHTM_analysis/config/gid.R")
#source("~/git/LSHTM_analysis/config/pnca.R")
#source("~/git/LSHTM_analysis/config/rpob.R")
# get plotting dfs
#source("~/git/LSHTM_analysis/scripts/plotting/get_plotting_dfs.R")
#=======
# output
#=======
outdir_images = paste0("~/git/Writing/thesis/images/results/", tolower(gene), "/")
cat("plots will output to:", outdir_images)
########################################################
if (length(merged_df3$position) == length(merged_df3$X5uhc_position) ){
pos_colname = "X5uhc_position"
@ -240,26 +238,32 @@ head(str_df_plot_cols)
# colour based on effect
table(str_df_plot_cols$pe_effect_outcome)
# colors = c("#ffd700" #gold
# , "#f0e68c" #khaki
# , "#da70d6"# orchid
# , "#ff1493"# deeppink
# , "#a0522d" #sienna
# , "#d2b48c" # tan
# , "#00BFC4" #, "#007d85" #blue
# , "#F8766D" )# red
# oops SS should be brighter/darker
# pe_colour_map = c("DD_lig" = "#ffd700" # gold
# , "SS_lig" = "#f0e68c" # khaki
#
# , "DD_nucleic_acid"= "#a0522d" # sienna
# , "SS_nucleic_acid"= "#d2b48c" # sandybrown
#
# , "DD_ppi2" = "#da70d6" # orchid
# , "SS_ppi2" = "#ff1493" # deeppink
#
# , "DD_stability" = "#f8766d" # red
# , "SS_stability" = "#00BFC4") # blue
pe_colour_map = c("DD_lig" = "#ffd700" # gold
, "SS_lig" = "#f0e68c" # khaki
, "DD_nucleic_acid"= "#a0522d" # sienna
, "SS_nucleic_acid"= "#d2b48c" # tan
, "DD_ppi2" = "#da70d6" # orchid
, "SS_ppi2" = "#ff1493" # deeppink
, "DD_stability" = "#f8766d" # red
, "SS_stability" = "#00BFC4") # blue
pe_colour_map = c("DD_lig" = "#f0e68c" # khaki
, "SS_lig" = "#ffd700" # gold
, "DD_nucleic_acid"= "#d2b48c" # sandybrown
, "SS_nucleic_acid"= "#a0522d" # sienna
, "DD_ppi2" = "#da70d6" # orchid
, "SS_ppi2" = "#ff1493" # deeppink
, "DD_stability" = "#f8766d" # red
, "SS_stability" = "#00BFC4") # blue
#unlist(d[c('a', 'a', 'c', 'b')], use.names=FALSE)
@ -320,8 +324,8 @@ if (nrow(ss_lig) == table(str_df_plot_cols$pe_effect_outcome)[['SS_lig']]){
}
#put in chimera cmd
paste0(dd_lig_pos, ".C")
paste0(ss_lig_pos, ".C")
toString(paste0(dd_lig_pos, ".C"))
toString(paste0(ss_lig_pos, ".C"))
#===================================================
#------------------------
@ -344,8 +348,8 @@ if (nrow(ss_nca) == table(str_df_plot_cols$pe_effect_outcome)[['SS_nucleic_acid
}
#put in chimera cmd
paste0(dd_nca_pos, ".C")
paste0(ss_nca_pos, ".C")
toString(paste0(dd_nca_pos, ".C"))
toString(paste0(ss_nca_pos, ".C"))
#===================================================
#-------------------
# PPI2 Affinity
@ -367,8 +371,8 @@ if (nrow(ss_ppi2) == table(str_df_plot_cols$pe_effect_outcome)[['SS_ppi2']]){
}
#put in chimera cmd
paste0(dd_ppi2_pos, ".C")
paste0(ss_ppi2_pos, ".C")
toString(paste0(dd_ppi2_pos, ".C"))
toString(paste0(ss_ppi2_pos, ".C"))
#=========================================================
#------------------------
@ -391,8 +395,8 @@ if (nrow(ss_stability) == table(str_df_plot_cols$pe_effect_outcome)[['SS_stabil
}
#put in chimera cmd
# stabiliting first as it has less numbers
paste0(ss_stability_pos, ".C")
paste0(dd_stability_pos, ".C")
toString(paste0(dd_stability_pos, ".C"))
toString(paste0(ss_stability_pos, ".C"))
####################################################################