moved plotting_func to functions and replaced 3 basic_barplots scripts with 1
This commit is contained in:
parent
b9d176afa4
commit
ff7522eca2
9 changed files with 287 additions and 237 deletions
|
@ -1,9 +1,10 @@
|
|||
setwd("~/git/LSHTM_analysis/scripts/plotting/functions")
|
||||
getwd()
|
||||
|
||||
# =================
|
||||
# Test function
|
||||
# ==================
|
||||
#############################################################
|
||||
#===========================================
|
||||
# load functions, data, dirs, hardocded vars
|
||||
# that will be used in testing the functions
|
||||
#===========================================
|
||||
source("../plotting_data.R")
|
||||
infile = "/home/tanu/git/Data/streptomycin/output/gid_comb_stab_struc_params.csv"
|
||||
pd_df = plotting_data(infile)
|
||||
|
@ -12,30 +13,91 @@ my_df_u = pd_df[[2]]
|
|||
my_df_u_lig = pd_df[[3]]
|
||||
dup_muts = pd_df[[4]]
|
||||
|
||||
source("../plotting_globals.R")
|
||||
drug = "streptomycin"
|
||||
gene = "gid"
|
||||
|
||||
import_dirs(drug, gene)
|
||||
|
||||
#=====================
|
||||
# functions to test
|
||||
#=====================
|
||||
source("stability_count_bp.R")
|
||||
source("position_count_bp.R")
|
||||
|
||||
##################################################################
|
||||
# ------------------------------
|
||||
# barplot for mscm stability
|
||||
# ------------------------------
|
||||
basic_bp_duet = paste0(tolower(gene), "_basic_barplot_PS.svg")
|
||||
plot_basic_bp_duet = paste0(plotdir,"/", basic_bp_duet)
|
||||
|
||||
svg(plot_basic_bp_duet)
|
||||
print(paste0("plot filename:", basic_bp_duet))
|
||||
|
||||
# function only
|
||||
stability_count_bp(plotdf = my_df_u
|
||||
, df_colname = "duet_outcome"
|
||||
, leg_title = "DUET outcome")
|
||||
|
||||
dev.off()
|
||||
|
||||
# ------------------------------
|
||||
# barplot for ligand affinity
|
||||
# ------------------------------
|
||||
basic_bp_ligand = paste0(tolower(gene), "_basic_barplot_LIG.svg")
|
||||
plot_basic_bp_ligand = paste0(plotdir, "/", basic_bp_ligand)
|
||||
|
||||
svg(plot_basic_bp_ligand)
|
||||
print(paste0("plot filename:", basic_bp_ligand))
|
||||
|
||||
# function only
|
||||
stability_count_bp(plotdf = my_df_u_lig
|
||||
, df_colname = "ligand_outcome"
|
||||
, leg_title = "Ligand outcome"
|
||||
, bp_plot_title = "Sites < 10 Ang of ligand"
|
||||
)
|
||||
, bp_plot_title = "Sites < 10 Ang of ligand")
|
||||
|
||||
dev.off()
|
||||
# ------------------------------
|
||||
# barplot for foldX
|
||||
# ------------------------------
|
||||
basic_bp_foldx = paste0(tolower(gene), "_basic_barplot_foldx.svg")
|
||||
plot_basic_bp_foldx = paste0(plotdir,"/", basic_bp_foldx)
|
||||
|
||||
svg(plot_basic_bp_foldx)
|
||||
print(paste0("plot filename:", plot_basic_bp_foldx))
|
||||
|
||||
stability_count_bp(plotdf = my_df_u
|
||||
, df_colname = "foldx_outcome"
|
||||
, leg_title = "FoldX outcome")
|
||||
dev.off()
|
||||
#===============================================================
|
||||
# ------------------------------
|
||||
# barplot for nssnp site count: all
|
||||
# ------------------------------
|
||||
pos_count_duet = paste0(tolower(gene), "_position_count_PS.svg")
|
||||
plot_pos_count_duet = paste0(plotdir, "/", pos_count_duet)
|
||||
|
||||
svg(plot_pos_count_duet)
|
||||
print(paste0("plot filename:", plot_pos_count_duet))
|
||||
|
||||
# function only
|
||||
site_snp_count_bp(plotdf = my_df_u
|
||||
, df_colname = "position")
|
||||
|
||||
dev.off()
|
||||
# ------------------------------
|
||||
# barplot for nssnp site count: within 10 Ang
|
||||
# ------------------------------
|
||||
pos_count_ligand = paste0(tolower(gene), "_position_count_LIG.svg")
|
||||
plot_pos_count_ligand = paste0(plotdir, "/", pos_count_ligand)
|
||||
|
||||
svg(plot_pos_count_ligand)
|
||||
print(paste0("plot filename:", plot_pos_count_ligand))
|
||||
|
||||
# function only
|
||||
site_snp_count_bp(plotdf = my_df_u_lig
|
||||
, df_colname = "position")
|
||||
|
||||
dev.off()
|
||||
#===============================================================
|
Loading…
Add table
Add a link
Reference in a new issue