SNP -> SAV for thesis plots

This commit is contained in:
Tanushree Tunstall 2023-02-19 17:43:22 +00:00
parent 777d3765cf
commit db7e2912e1
31 changed files with 145 additions and 145 deletions

View file

@ -85,7 +85,7 @@ foo2 = foo[foo$ligand_distance<10,]
table(foo2$ligand_outcome)
#############################
# wide plots SNP
# wide plots SAV
# DRUG
length(aa_pos_drug); aa_pos_drug
drug = foo[foo$position%in%aa_pos_drug,]

View file

@ -76,7 +76,7 @@ foo2 = foo[foo$ligand_distance<10,]
table(foo2$ligand_outcome)
#############################
# wide plots SNP
# wide plots SAV
# DRUG
length(aa_pos_drug); aa_pos_drug
drug = foo[foo$position%in%aa_pos_drug,]

View file

@ -41,7 +41,7 @@ my_yals = 13 # y axis label size
my_lls = 13 # legend label size
d_lab_size = 5
#===============================
# lineage sample and SNP count
# lineage sample and SAV count
#===============================
lin_countP = lin_count_bp(lf_data = lineage_dfL[['lin_lf']]
, all_lineages = F
@ -58,7 +58,7 @@ lin_countP = lin_count_bp(lf_data = lineage_dfL[['lin_lf']]
, my_xals = my_xals # x axis label size
, my_yals = my_yals # y axis label size
, my_lls = my_lls # legend label size
, bar_col_labels = c("nsSNPs", "Total Samples")
, bar_col_labels = c("SAVs", "Total Samples")
, bar_col_values = c("grey50", "gray75")
, bar_leg_name = ""
, leg_location = "top"
@ -68,7 +68,7 @@ lin_countP = lin_count_bp(lf_data = lineage_dfL[['lin_lf']]
)
lin_countP
#===============================
# lineage SNP diversity count
# lineage SAV diversity count
#===============================
lin_diversityP = lin_count_bp_diversity(lf_data = lineage_dfL[['lin_wf']]
, x_categ = "sel_lineages"
@ -87,8 +87,8 @@ lin_diversityP = lin_count_bp_diversity(lf_data = lineage_dfL[['lin_wf']]
, y_log10 = F
, y_scale_percent = F
, leg_location = "top"
, y_label = "Percent" #"SNP diversity"
, bp_plot_title = "nsSNP diversity"
, y_label = "Percent" #"SAV diversity"
, bp_plot_title = "SAV diversity"
, title_colour = "black" #"chocolate4"
, subtitle_text = NULL
, sts = 10

View file

@ -1,5 +1,5 @@
#!/usr/bin/env Rscript
source("/home/tanu/git/LSHTM_analysis/scripts/plotting/plotting_thesis/alr/alr_lineage_bp_dist.R")
source("/home/sethp/git/LSHTM_analysis/scripts/plotting/plotting_thesis/alr/alr_lineage_bp_dist.R")
###########################################
# TASK: generate plots for lineage

View file

@ -65,7 +65,7 @@ mLigP = stability_count_bp(plotdf = df3_lig
, df_colname = "ligand_outcome"
#, leg_title = "mCSM-lig"
#, bp_plot_title = paste(common_bp_title, "ligand")
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "none"
, subtitle_text = "mCSM\nLig"
, bar_fill_values = c("#F8766D", "#00BFC4")
@ -113,7 +113,7 @@ if (tolower(gene)%in%geneL_ppi2){
#, label_categories = labels_ppi2
#, bp_plot_title = paste(common_bp_title, "PP-interface")
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "none"
, subtitle_text = "mCSM\nPPI2"
, bar_fill_values = c("#F8766D", "#00BFC4")
@ -138,7 +138,7 @@ if (tolower(gene)%in%geneL_na){
#, label_categories =
#, bp_plot_title = paste(common_bp_title, "Dist to NA")
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "none"
, subtitle_text = "mCSM\nNA"
, bar_fill_values = c("#F8766D", "#00BFC4")
@ -162,7 +162,7 @@ common_bp_title = paste0("Sites <", DistCutOff, angstroms_symbol)
posC_lig = site_snp_count_bp(plotdf = df3_lig
, df_colname = "position"
, xaxis_title = "Number of nsSNPs"
, xaxis_title = "Number of SAVs"
, yaxis_title = "Number of Sites"
, subtitle_colour = "chocolate4"
, subtitle_text = ""
@ -180,7 +180,7 @@ posC_lig
if (tolower(gene)%in%geneL_ppi2){
posC_ppi2 = site_snp_count_bp(plotdf = df3_ppi2
, df_colname = "position"
, xaxis_title = "Number of nsSNPs"
, xaxis_title = "Number of SAVs"
, yaxis_title = "Number of Sites"
, subtitle_colour = "chocolate4"
, subtitle_text = ""
@ -199,7 +199,7 @@ if (tolower(gene)%in%geneL_ppi2){
if (tolower(gene)%in%geneL_na){
posC_nca = site_snp_count_bp(plotdf = df3_na
, df_colname = "position"
, xaxis_title = "Number of nsSNPs"
, xaxis_title = "Number of SAVs"
, yaxis_title = "Number of Sites"
, subtitle_colour = "chocolate4"
, subtitle_text = ""
@ -217,7 +217,7 @@ if (tolower(gene)%in%geneL_na){
#------------------------------
posC_all = site_snp_count_bp(plotdf = df3
, df_colname = "position"
, xaxis_title = "Number of nsSNPs"
, xaxis_title = "Number of SAVs"
, yaxis_title = "Number of Sites"
, subtitle_colour = "chocolate4"
, subtitle_text = "All mutations sites"
@ -233,7 +233,7 @@ consurfP = stability_count_bp(plotdf = df3
, df_colname = "consurf_outcome"
#, leg_title = "ConSurf"
#, label_categories = labels_consurf
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "top"
, subtitle_text = "ConSurf"
, bar_fill_values = consurf_colours_no_isd # from globals
@ -262,7 +262,7 @@ duetP = stability_count_bp(plotdf = df3
, df_colname = "duet_outcome"
, leg_title = "mCSM-DUET"
#, label_categories = labels_duet
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "none"
, subtitle_text = "mCSM-DUET"
, bar_fill_values = c("#F8766D", "#00BFC4")
@ -331,7 +331,7 @@ proveanP = stability_count_bp(plotdf = df3
, df_colname = "provean_outcome"
#, leg_title = "PROVEAN"
#, label_categories = labels_provean
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "none" # top
, subtitle_text = "PROVEAN"
, bar_fill_values = c("#D01C8B", "#F1B6DA") # light pink and deep

View file

@ -68,7 +68,7 @@ mLigP = stability_count_bp(plotdf = df3_lig
, df_colname = "ligand_outcome"
#, leg_title = "mCSM-lig"
#, bp_plot_title = paste(common_bp_title, "ligand")
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "none"
, subtitle_text = "mCSM\nLig"
, bar_fill_values = c("#F8766D", "#00BFC4")
@ -116,7 +116,7 @@ if (tolower(gene)%in%geneL_ppi2){
#, label_categories = labels_ppi2
#, bp_plot_title = paste(common_bp_title, "PP-interface")
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "none"
, subtitle_text = "mCSM\nPPI2"
, bar_fill_values = c("#F8766D", "#00BFC4")
@ -141,7 +141,7 @@ if (tolower(gene)%in%geneL_na){
#, label_categories =
#, bp_plot_title = paste(common_bp_title, "Dist to NA")
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "none"
, subtitle_text = "mCSM\nNA"
, bar_fill_values = c("#F8766D", "#00BFC4")
@ -165,7 +165,7 @@ common_bp_title = paste0("Sites <", DistCutOff, angstroms_symbol)
posC_lig = site_snp_count_bp(plotdf = df3_lig
, df_colname = "position"
, xaxis_title = "Number of nsSNPs"
, xaxis_title = "Number of SAVs"
, yaxis_title = "Number of Sites"
, subtitle_colour = "chocolate4"
, subtitle_text = ""
@ -183,7 +183,7 @@ posC_lig
if (tolower(gene)%in%geneL_ppi2){
posC_ppi2 = site_snp_count_bp(plotdf = df3_ppi2
, df_colname = "position"
, xaxis_title = "Number of nsSNPs"
, xaxis_title = "Number of SAVs"
, yaxis_title = "Number of Sites"
, subtitle_colour = "chocolate4"
, subtitle_text = ""
@ -202,7 +202,7 @@ if (tolower(gene)%in%geneL_ppi2){
if (tolower(gene)%in%geneL_na){
posC_nca = site_snp_count_bp(plotdf = df3_na
, df_colname = "position"
, xaxis_title = "Number of nsSNPs"
, xaxis_title = "Number of SAVs"
, yaxis_title = "Number of Sites"
, subtitle_colour = "chocolate4"
, subtitle_text = ""
@ -220,7 +220,7 @@ if (tolower(gene)%in%geneL_na){
#------------------------------
posC_all = site_snp_count_bp(plotdf = df3
, df_colname = "position"
, xaxis_title = "Number of nsSNPs"
, xaxis_title = "Number of SAVs"
, yaxis_title = "Number of Sites"
, subtitle_colour = "chocolate4"
, subtitle_text = "All mutations sites"
@ -235,7 +235,7 @@ consurfP = stability_count_bp(plotdf = df3
, df_colname = "consurf_outcome"
#, leg_title = "ConSurf"
#, label_categories = labels_consurf
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "top"
, subtitle_text = "ConSurf"
, bar_fill_values = consurf_colours # from globals
@ -264,7 +264,7 @@ duetP = stability_count_bp(plotdf = df3
, df_colname = "duet_outcome"
, leg_title = "mCSM-DUET"
#, label_categories = labels_duet
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "none"
, subtitle_text = "mCSM-DUET"
, bar_fill_values = c("#F8766D", "#00BFC4")
@ -333,7 +333,7 @@ proveanP = stability_count_bp(plotdf = df3
, df_colname = "provean_outcome"
#, leg_title = "PROVEAN"
#, label_categories = labels_provean
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "none" # top
, subtitle_text = "PROVEAN"
, bar_fill_values = c("#D01C8B", "#F1B6DA") # light pink and deep

View file

@ -78,7 +78,7 @@ foo2 = foo[foo$ligand_distance<10,]
table(foo2$ligand_outcome)
#############################
# wide plots SNP
# wide plots SAV
# DRUG
length(aa_pos_drug); aa_pos_drug
drug = foo[foo$position%in%aa_pos_drug,]

View file

@ -67,7 +67,7 @@ mLigP = stability_count_bp(plotdf = df3_lig
, df_colname = "ligand_outcome"
#, leg_title = "mCSM-lig"
#, bp_plot_title = paste(common_bp_title, "ligand")
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "none"
, subtitle_text = "mCSM\nLig"
, bar_fill_values = c("#F8766D", "#00BFC4")
@ -115,7 +115,7 @@ if (tolower(gene)%in%geneL_ppi2){
#, label_categories = labels_ppi2
#, bp_plot_title = paste(common_bp_title, "PP-interface")
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "none"
, subtitle_text = "mCSM\nPPI2"
, bar_fill_values = c("#F8766D", "#00BFC4")
@ -140,7 +140,7 @@ if (tolower(gene)%in%geneL_na){
#, label_categories =
#, bp_plot_title = paste(common_bp_title, "Dist to NA")
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "none"
, subtitle_text = "mCSM\nNA"
, bar_fill_values = c("#F8766D", "#00BFC4")
@ -164,7 +164,7 @@ common_bp_title = paste0("Sites <", DistCutOff, angstroms_symbol)
posC_lig = site_snp_count_bp(plotdf = df3_lig
, df_colname = "position"
, xaxis_title = "Number of nsSNPs"
, xaxis_title = "Number of SAVs"
, yaxis_title = "Number of Sites"
, subtitle_colour = "chocolate4"
, subtitle_text = ""
@ -182,7 +182,7 @@ posC_lig
if (tolower(gene)%in%geneL_ppi2){
posC_ppi2 = site_snp_count_bp(plotdf = df3_ppi2
, df_colname = "position"
, xaxis_title = "Number of nsSNPs"
, xaxis_title = "Number of SAVs"
, yaxis_title = "Number of Sites"
, subtitle_colour = "chocolate4"
, subtitle_text = ""
@ -201,7 +201,7 @@ if (tolower(gene)%in%geneL_ppi2){
if (tolower(gene)%in%geneL_na){
posC_nca = site_snp_count_bp(plotdf = df3_na
, df_colname = "position"
, xaxis_title = "Number of nsSNPs"
, xaxis_title = "Number of SAVs"
, yaxis_title = "Number of Sites"
, subtitle_colour = "chocolate4"
, subtitle_text = ""
@ -219,7 +219,7 @@ if (tolower(gene)%in%geneL_na){
#------------------------------
posC_all = site_snp_count_bp(plotdf = df3
, df_colname = "position"
, xaxis_title = "Number of nsSNPs"
, xaxis_title = "Number of SAVs"
, yaxis_title = "Number of Sites"
, subtitle_colour = "chocolate4"
, subtitle_text = "All mutations sites"
@ -234,7 +234,7 @@ consurfP = stability_count_bp(plotdf = df3
, df_colname = "consurf_outcome"
#, leg_title = "ConSurf"
#, label_categories = labels_consurf
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "top"
, subtitle_text = "ConSurf"
, bar_fill_values = consurf_colours # from globals
@ -263,7 +263,7 @@ duetP = stability_count_bp(plotdf = df3
, df_colname = "duet_outcome"
, leg_title = "mCSM-DUET"
#, label_categories = labels_duet
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "none"
, subtitle_text = "mCSM-DUET"
, bar_fill_values = c("#F8766D", "#00BFC4")
@ -332,7 +332,7 @@ proveanP = stability_count_bp(plotdf = df3
, df_colname = "provean_outcome"
#, leg_title = "PROVEAN"
#, label_categories = labels_provean
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "none" # top
, subtitle_text = "PROVEAN"
, bar_fill_values = c("#D01C8B", "#F1B6DA") # light pink and deep

View file

@ -76,7 +76,7 @@ foo2 = foo[foo$ligand_distance<10,]
table(foo2$ligand_outcome)
#############################
# wide plots SNP
# wide plots SAV
# DRUG
length(aa_pos_drug); aa_pos_drug
drug = foo[foo$position%in%aa_pos_drug,]

View file

@ -68,7 +68,7 @@ mLigP = stability_count_bp(plotdf = df3_lig
, df_colname = "ligand_outcome"
#, leg_title = "mCSM-lig"
#, bp_plot_title = paste(common_bp_title, "ligand")
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "none"
, subtitle_text = "mCSM\nLig"
, bar_fill_values = c("#F8766D", "#00BFC4")
@ -116,7 +116,7 @@ if (tolower(gene)%in%geneL_ppi2){
#, label_categories = labels_ppi2
#, bp_plot_title = paste(common_bp_title, "PP-interface")
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "none"
, subtitle_text = "mCSM\nPPI2"
, bar_fill_values = c("#F8766D", "#00BFC4")
@ -141,7 +141,7 @@ if (tolower(gene)%in%geneL_na){
#, label_categories =
#, bp_plot_title = paste(common_bp_title, "Dist to NA")
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "none"
, subtitle_text = "mCSM\nNA"
, bar_fill_values = c("#F8766D", "#00BFC4")
@ -165,7 +165,7 @@ common_bp_title = paste0("Sites <", DistCutOff, angstroms_symbol)
posC_lig = site_snp_count_bp(plotdf = df3_lig
, df_colname = "position"
, xaxis_title = "Number of nsSNPs"
, xaxis_title = "Number of SAVs"
, yaxis_title = "Number of Sites"
, subtitle_colour = "chocolate4"
, subtitle_text = ""
@ -183,7 +183,7 @@ posC_lig
if (tolower(gene)%in%geneL_ppi2){
posC_ppi2 = site_snp_count_bp(plotdf = df3_ppi2
, df_colname = "position"
, xaxis_title = "Number of nsSNPs"
, xaxis_title = "Number of SAVs"
, yaxis_title = "Number of Sites"
, subtitle_colour = "chocolate4"
, subtitle_text = ""
@ -202,7 +202,7 @@ if (tolower(gene)%in%geneL_ppi2){
if (tolower(gene)%in%geneL_na){
posC_nca = site_snp_count_bp(plotdf = df3_na
, df_colname = "position"
, xaxis_title = "Number of nsSNPs"
, xaxis_title = "Number of SAVs"
, yaxis_title = "Number of Sites"
, subtitle_colour = "chocolate4"
, subtitle_text = ""
@ -220,7 +220,7 @@ if (tolower(gene)%in%geneL_na){
#------------------------------
posC_all = site_snp_count_bp(plotdf = df3
, df_colname = "position"
, xaxis_title = "Number of nsSNPs"
, xaxis_title = "Number of SAVs"
, yaxis_title = "Number of Sites"
, subtitle_colour = "chocolate4"
, subtitle_text = "All mutations sites"
@ -235,7 +235,7 @@ consurfP = stability_count_bp(plotdf = df3
, df_colname = "consurf_outcome"
#, leg_title = "ConSurf"
#, label_categories = labels_consurf
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "top"
, subtitle_text = "ConSurf"
, bar_fill_values = consurf_colours # from globals
@ -264,7 +264,7 @@ duetP = stability_count_bp(plotdf = df3
, df_colname = "duet_outcome"
, leg_title = "mCSM-DUET"
#, label_categories = labels_duet
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "none"
, subtitle_text = "mCSM-DUET"
, bar_fill_values = c("#F8766D", "#00BFC4")
@ -333,7 +333,7 @@ proveanP = stability_count_bp(plotdf = df3
, df_colname = "provean_outcome"
#, leg_title = "PROVEAN"
#, label_categories = labels_provean
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "none" # top
, subtitle_text = "PROVEAN"
, bar_fill_values = c("#D01C8B", "#F1B6DA") # light pink and deep

View file

@ -78,7 +78,7 @@ foo2 = foo[foo$ligand_distance<10,]
table(foo2$ligand_outcome)
#############################
# wide plots SNP
# wide plots SAV
# DRUG
length(aa_pos_drug); aa_pos_drug
drug = foo[foo$position%in%aa_pos_drug,]

View file

@ -41,7 +41,7 @@ my_yals = 8 # y axis label size
my_lls = 8 # legend label size
d_lab_size = 2.3
#===============================
# lineage sample and SNP count
# lineage sample and SAV count
#===============================
lin_countP = lin_count_bp(lf_data = lineage_dfL[['lin_lf']]
, all_lineages = F
@ -58,7 +58,7 @@ lin_countP = lin_count_bp(lf_data = lineage_dfL[['lin_lf']]
, my_xals = my_xals # x axis label size
, my_yals = my_yals # y axis label size
, my_lls = my_lls # legend label size
, bar_col_labels = c("nsSNPs", "Total Samples")
, bar_col_labels = c("SAVs", "Total Samples")
, bar_col_values = c("grey50", "gray75")
, bar_leg_name = ""
, leg_location = "top"
@ -68,7 +68,7 @@ lin_countP = lin_count_bp(lf_data = lineage_dfL[['lin_lf']]
)
lin_countP
#===============================
# lineage SNP diversity count
# lineage SAV diversity count
#===============================
lin_diversityP = lin_count_bp_diversity(lf_data = lineage_dfL[['lin_wf']]
, x_categ = "sel_lineages"
@ -87,8 +87,8 @@ lin_diversityP = lin_count_bp_diversity(lf_data = lineage_dfL[['lin_wf']]
, y_log10 = F
, y_scale_percent = F
, leg_location = "top"
, y_label = "Percent" #"SNP diversity"
, bp_plot_title = "nsSNP diversity"
, y_label = "Percent" #"SAV diversity"
, bp_plot_title = "SAV diversity"
, title_colour = "black" #"chocolate4"
, subtitle_text = NULL
, sts = 10

View file

@ -68,7 +68,7 @@ mLigP = stability_count_bp(plotdf = df3_lig
, df_colname = "ligand_outcome"
#, leg_title = "mCSM-lig"
#, bp_plot_title = paste(common_bp_title, "ligand")
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "none"
, subtitle_text = "mCSM\nLig"
, bar_fill_values = c("#F8766D", "#00BFC4")
@ -116,7 +116,7 @@ if (tolower(gene)%in%geneL_ppi2){
#, label_categories = labels_ppi2
#, bp_plot_title = paste(common_bp_title, "PP-interface")
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "none"
, subtitle_text = "mCSM\nPPI2"
, bar_fill_values = c("#F8766D", "#00BFC4")
@ -141,7 +141,7 @@ if (tolower(gene)%in%geneL_na){
#, label_categories =
#, bp_plot_title = paste(common_bp_title, "Dist to NA")
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "none"
, subtitle_text = "mCSM\nNA"
, bar_fill_values = c("#F8766D", "#00BFC4")
@ -165,7 +165,7 @@ common_bp_title = paste0("Sites <", DistCutOff, angstroms_symbol)
posC_lig = site_snp_count_bp(plotdf = df3_lig
, df_colname = "position"
, xaxis_title = "Number of nsSNPs"
, xaxis_title = "Number of SAVs"
, yaxis_title = "Number of Sites"
, subtitle_colour = "chocolate4"
, subtitle_text = ""
@ -183,7 +183,7 @@ posC_lig
if (tolower(gene)%in%geneL_ppi2){
posC_ppi2 = site_snp_count_bp(plotdf = df3_ppi2
, df_colname = "position"
, xaxis_title = "Number of nsSNPs"
, xaxis_title = "Number of SAVs"
, yaxis_title = "Number of Sites"
, subtitle_colour = "chocolate4"
, subtitle_text = ""
@ -202,7 +202,7 @@ if (tolower(gene)%in%geneL_ppi2){
if (tolower(gene)%in%geneL_na){
posC_nca = site_snp_count_bp(plotdf = df3_na
, df_colname = "position"
, xaxis_title = "Number of nsSNPs"
, xaxis_title = "Number of SAVs"
, yaxis_title = "Number of Sites"
, subtitle_colour = "chocolate4"
, subtitle_text = ""
@ -220,7 +220,7 @@ if (tolower(gene)%in%geneL_na){
#------------------------------
posC_all = site_snp_count_bp(plotdf = df3
, df_colname = "position"
, xaxis_title = "Number of nsSNPs"
, xaxis_title = "Number of SAVs"
, yaxis_title = "Number of Sites"
, subtitle_colour = "chocolate4"
, subtitle_text = "All mutations sites"
@ -238,7 +238,7 @@ consurfP = stability_count_bp(plotdf = df3
, df_colname = "consurf_outcome"
#, leg_title = "ConSurf"
#, label_categories = labels_consurf
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "top"
, subtitle_text = "ConSurf"
, bar_fill_values = consurf_colours_no_isd # from globals
@ -267,7 +267,7 @@ duetP = stability_count_bp(plotdf = df3
, df_colname = "duet_outcome"
, leg_title = "mCSM-DUET"
#, label_categories = labels_duet
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "none"
, subtitle_text = "mCSM-DUET"
, bar_fill_values = c("#F8766D", "#00BFC4")
@ -336,7 +336,7 @@ proveanP = stability_count_bp(plotdf = df3
, df_colname = "provean_outcome"
#, leg_title = "PROVEAN"
#, label_categories = labels_provean
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "none" # top
, subtitle_text = "PROVEAN"
, bar_fill_values = c("#D01C8B", "#F1B6DA") # light pink and deep

View file

@ -41,7 +41,7 @@ my_yals = 8 # y axis label size
my_lls = 8 # legend label size
d_lab_size = 2.3
#===============================
# lineage sample and SNP count
# lineage sample and SAV count
#===============================
lin_countP = lin_count_bp(lf_data = lineage_dfL[['lin_lf']]
, all_lineages = F
@ -58,7 +58,7 @@ lin_countP = lin_count_bp(lf_data = lineage_dfL[['lin_lf']]
, my_xals = my_xals # x axis label size
, my_yals = my_yals # y axis label size
, my_lls = my_lls # legend label size
, bar_col_labels = c("nsSNPs", "Total Samples")
, bar_col_labels = c("SAVs", "Total Samples")
, bar_col_values = c("grey50", "gray75")
, bar_leg_name = ""
, leg_location = "top"
@ -68,7 +68,7 @@ lin_countP = lin_count_bp(lf_data = lineage_dfL[['lin_lf']]
)
lin_countP
#===============================
# lineage SNP diversity count
# lineage SAV diversity count
#===============================
lin_diversityP = lin_count_bp_diversity(lf_data = lineage_dfL[['lin_wf']]
, x_categ = "sel_lineages"
@ -87,8 +87,8 @@ lin_diversityP = lin_count_bp_diversity(lf_data = lineage_dfL[['lin_wf']]
, y_log10 = F
, y_scale_percent = F
, leg_location = "top"
, y_label = "Percent" #"SNP diversity"
, bp_plot_title = "nsSNP diversity"
, y_label = "Percent" #"SAV diversity"
, bp_plot_title = "SAV diversity"
, title_colour = "black" #"chocolate4"
, subtitle_text = NULL
, sts = 10

View file

@ -68,7 +68,7 @@ mLigP = stability_count_bp(plotdf = df3_lig
, df_colname = "ligand_outcome"
#, leg_title = "mCSM-lig"
#, bp_plot_title = paste(common_bp_title, "ligand")
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "none"
, subtitle_text = "mCSM\nLig"
, bar_fill_values = c("#F8766D", "#00BFC4")
@ -116,7 +116,7 @@ if (tolower(gene)%in%geneL_ppi2){
#, label_categories = labels_ppi2
#, bp_plot_title = paste(common_bp_title, "PP-interface")
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "none"
, subtitle_text = "mCSM\nPPI2"
, bar_fill_values = c("#F8766D", "#00BFC4")
@ -141,7 +141,7 @@ if (tolower(gene)%in%geneL_na){
#, label_categories =
#, bp_plot_title = paste(common_bp_title, "Dist to NA")
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "none"
, subtitle_text = "mCSM\nNA"
, bar_fill_values = c("#F8766D", "#00BFC4")
@ -165,7 +165,7 @@ common_bp_title = paste0("Sites <", DistCutOff, angstroms_symbol)
posC_lig = site_snp_count_bp(plotdf = df3_lig
, df_colname = "position"
, xaxis_title = "Number of nsSNPs"
, xaxis_title = "Number of SAVs"
, yaxis_title = "Number of Sites"
, subtitle_colour = "chocolate4"
, subtitle_text = ""
@ -183,7 +183,7 @@ posC_lig
if (tolower(gene)%in%geneL_ppi2){
posC_ppi2 = site_snp_count_bp(plotdf = df3_ppi2
, df_colname = "position"
, xaxis_title = "Number of nsSNPs"
, xaxis_title = "Number of SAVs"
, yaxis_title = "Number of Sites"
, subtitle_colour = "chocolate4"
, subtitle_text = ""
@ -202,7 +202,7 @@ if (tolower(gene)%in%geneL_ppi2){
if (tolower(gene)%in%geneL_na){
posC_nca = site_snp_count_bp(plotdf = df3_na
, df_colname = "position"
, xaxis_title = "Number of nsSNPs"
, xaxis_title = "Number of SAVs"
, yaxis_title = "Number of Sites"
, subtitle_colour = "chocolate4"
, subtitle_text = ""
@ -220,7 +220,7 @@ if (tolower(gene)%in%geneL_na){
#------------------------------
posC_all = site_snp_count_bp(plotdf = df3
, df_colname = "position"
, xaxis_title = "Number of nsSNPs"
, xaxis_title = "Number of SAVs"
, yaxis_title = "Number of Sites"
, subtitle_colour = "chocolate4"
, subtitle_text = "All mutations sites"
@ -235,7 +235,7 @@ consurfP = stability_count_bp(plotdf = df3
, df_colname = "consurf_outcome"
#, leg_title = "ConSurf"
#, label_categories = labels_consurf
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "top"
, subtitle_text = "ConSurf"
, bar_fill_values = consurf_colours # from globals
@ -264,7 +264,7 @@ duetP = stability_count_bp(plotdf = df3
, df_colname = "duet_outcome"
, leg_title = "mCSM-DUET"
#, label_categories = labels_duet
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "none"
, subtitle_text = "mCSM-DUET"
, bar_fill_values = c("#F8766D", "#00BFC4")
@ -333,7 +333,7 @@ proveanP = stability_count_bp(plotdf = df3
, df_colname = "provean_outcome"
#, leg_title = "PROVEAN"
#, label_categories = labels_provean
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "none" # top
, subtitle_text = "PROVEAN"
, bar_fill_values = c("#D01C8B", "#F1B6DA") # light pink and deep

View file

@ -79,7 +79,7 @@ foo2 = foo[foo$ligand_distance<10,]
table(foo2$ligand_outcome)
#############################
# wide plots SNP
# wide plots SAV
# DRUG
length(aa_pos_drug); aa_pos_drug
drug = foo[foo$position%in%aa_pos_drug,]

View file

@ -11,7 +11,7 @@
# , lts = 20 # legend text size
# , ltis = 22 # label title size
# , geom_ls = 10 # geom_label size
# , yaxis_title = "Number of nsSNPs"
# , yaxis_title = "Number of SAVs"
# , bp_plot_title = ""
# , label_categories = c("Destabilising", "Stabilising")
# , title_colour = "chocolate4"
@ -94,7 +94,7 @@ mLigP = stability_count_bp(plotdf = df3_lig
, df_colname = "ligand_outcome"
#, leg_title = "mCSM-lig"
#, bp_plot_title = paste(common_bp_title, "ligand")
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "none"
, subtitle_text = "mCSM-lig"
, bar_fill_values = c("#F8766D", "#00BFC4")
@ -141,7 +141,7 @@ if (tolower(gene)%in%geneL_ppi2){
#, label_categories = labels_ppi2
#, bp_plot_title = paste(common_bp_title, "PP-interface")
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "none"
, subtitle_text = "mCSM-ppi2"
, bar_fill_values = c("#F8766D", "#00BFC4")
@ -167,7 +167,7 @@ if (tolower(gene)%in%geneL_na){
#, label_categories =
#, bp_plot_title = paste(common_bp_title, "Dist to NA")
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "none"
, subtitle_text = "mCSM-NA"
, bar_fill_values = c("#F8766D", "#00BFC4")
@ -191,7 +191,7 @@ common_bp_title = paste0("Sites <", DistCutOff, angstroms_symbol)
posC_lig = site_snp_count_bp(plotdf = df3_lig
, df_colname = "position"
, xaxis_title = "Number of nsSNPs"
, xaxis_title = "Number of SAVs"
, yaxis_title = "Number of Sites"
, subtitle_colour = "chocolate4"
, subtitle_text = ""
@ -210,7 +210,7 @@ if (tolower(gene)%in%geneL_ppi2){
posC_ppi2 = site_snp_count_bp(plotdf = df3_ppi2
, df_colname = "position"
, xaxis_title = "Number of nsSNPs"
, xaxis_title = "Number of SAVs"
, yaxis_title = "Number of Sites"
, subtitle_colour = "chocolate4"
, subtitle_text = ""
@ -230,7 +230,7 @@ if (tolower(gene)%in%geneL_na){
posC_nca = site_snp_count_bp(plotdf = df3_na
, df_colname = "position"
, xaxis_title = "Number of nsSNPs"
, xaxis_title = "Number of SAVs"
, yaxis_title = "Number of Sites"
, subtitle_colour = "chocolate4"
, subtitle_text = ""
@ -248,7 +248,7 @@ if (tolower(gene)%in%geneL_na){
#------------------------------
posC_all = site_snp_count_bp(plotdf = df3
, df_colname = "position"
, xaxis_title = "Number of nsSNPs"
, xaxis_title = "Number of SAVs"
, yaxis_title = "Number of Sites"
, subtitle_colour = "chocolate4"
, subtitle_text = "All mutations sites"
@ -263,7 +263,7 @@ consurfP = stability_count_bp(plotdf = df3
, df_colname = "consurf_outcome"
#, leg_title = "ConSurf"
#, label_categories = labels_consurf
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "top"
, subtitle_text = "ConSurf"
, bar_fill_values = consurf_colours # from globals
@ -286,7 +286,7 @@ duetP = stability_count_bp(plotdf = df3
, df_colname = "duet_outcome"
, leg_title = "mCSM-DUET"
#, label_categories = labels_duet
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "none"
, subtitle_text = "mCSM-DUET"
, bar_fill_values = c("#F8766D", "#00BFC4")
@ -359,7 +359,7 @@ proveanP = stability_count_bp(plotdf = df3
, df_colname = "provean_outcome"
#, leg_title = "PROVEAN"
#, label_categories = labels_provean
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "none" # top
, subtitle_text = "PROVEAN"
, bar_fill_values = c("#D01C8B", "#F1B6DA") # light pink and deep

View file

@ -60,7 +60,7 @@ mLigP = stability_count_bp(plotdf = df3_lig
, df_colname = "ligand_outcome"
#, leg_title = "mCSM-lig"
#, bp_plot_title = paste(common_bp_title, "ligand")
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "none"
, subtitle_text = "mCSM-lig"
, bar_fill_values = c("#F8766D", "#00BFC4")
@ -107,7 +107,7 @@ if (tolower(gene)%in%geneL_ppi2){
#, label_categories = labels_ppi2
#, bp_plot_title = paste(common_bp_title, "PP-interface")
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "none"
, subtitle_text = "mCSM-ppi2"
, bar_fill_values = c("#F8766D", "#00BFC4")
@ -133,7 +133,7 @@ if (tolower(gene)%in%geneL_na){
#, label_categories =
#, bp_plot_title = paste(common_bp_title, "Dist to NA")
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "none"
, subtitle_text = "mCSM-NA"
, bar_fill_values = c("#F8766D", "#00BFC4")
@ -157,7 +157,7 @@ common_bp_title = paste0("Sites <", DistCutOff, angstroms_symbol)
posC_lig = site_snp_count_bp(plotdf = df3_lig
, df_colname = "position"
, xaxis_title = "Number of nsSNPs"
, xaxis_title = "Number of SAVs"
, yaxis_title = "Number of Sites"
, subtitle_colour = "chocolate4"
, subtitle_text = ""
@ -176,7 +176,7 @@ if (tolower(gene)%in%geneL_ppi2){
posC_ppi2 = site_snp_count_bp(plotdf = df3_ppi2
, df_colname = "position"
, xaxis_title = "Number of nsSNPs"
, xaxis_title = "Number of SAVs"
, yaxis_title = "Number of Sites"
, subtitle_colour = "chocolate4"
, subtitle_text = ""
@ -196,7 +196,7 @@ if (tolower(gene)%in%geneL_na){
posC_nca = site_snp_count_bp(plotdf = df3_na
, df_colname = "position"
, xaxis_title = "Number of nsSNPs"
, xaxis_title = "Number of SAVs"
, yaxis_title = "Number of Sites"
, subtitle_colour = "chocolate4"
, subtitle_text = ""
@ -214,7 +214,7 @@ if (tolower(gene)%in%geneL_na){
#------------------------------
posC_all = site_snp_count_bp(plotdf = df3
, df_colname = "position"
, xaxis_title = "Number of nsSNPs"
, xaxis_title = "Number of SAVs"
, yaxis_title = "Number of Sites"
, subtitle_colour = "chocolate4"
, subtitle_text = "All mutations sites"
@ -229,7 +229,7 @@ consurfP = stability_count_bp(plotdf = df3
, df_colname = "consurf_outcome"
#, leg_title = "ConSurf"
#, label_categories = labels_consurf
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "top"
, subtitle_text = "ConSurf"
, bar_fill_values = consurf_colours # from globals
@ -252,7 +252,7 @@ duetP = stability_count_bp(plotdf = df3
, df_colname = "duet_outcome"
, leg_title = "mCSM-DUET"
#, label_categories = labels_duet
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "none"
, subtitle_text = "mCSM-DUET"
, bar_fill_values = c("#F8766D", "#00BFC4")
@ -325,7 +325,7 @@ proveanP = stability_count_bp(plotdf = df3
, df_colname = "provean_outcome"
#, leg_title = "PROVEAN"
#, label_categories = labels_provean
, yaxis_title = "Number of nsSNPs"
, yaxis_title = "Number of SAVs"
, leg_position = "none" # top
, subtitle_text = "PROVEAN"
, bar_fill_values = c("#D01C8B", "#F1B6DA") # light pink and deep

View file

@ -85,7 +85,7 @@ foo2 = foo[foo$ligand_distance<10,]
table(foo2$ligand_outcome)
#############################
# wide plots SNP
# wide plots SAV
# DRUG
length(aa_pos_drug); aa_pos_drug
drug = foo[foo$position%in%aa_pos_drug,]