more plot files
This commit is contained in:
parent
04253b961f
commit
3d817fde0c
29 changed files with 3252 additions and 760 deletions
65
scripts/plotting/plotting_thesis/gid/sensitivity_count_gid.R
Normal file
65
scripts/plotting/plotting_thesis/gid/sensitivity_count_gid.R
Normal file
|
@ -0,0 +1,65 @@
|
|||
#=========================
|
||||
# Count Sensitivity
|
||||
# Mutations and positions
|
||||
#=========================
|
||||
pos_colname_c ="position"
|
||||
|
||||
sensP_df = merged_df3[,c("mutationinformation",
|
||||
#"position",
|
||||
pos_colname_c,
|
||||
"sensitivity")]
|
||||
|
||||
head(sensP_df)
|
||||
table(sensP_df$sensitivity)
|
||||
|
||||
#---------------
|
||||
# Total unique positions
|
||||
#----------------
|
||||
tot_mut_pos = length(unique(sensP_df[[pos_colname_c]]))
|
||||
cat("\nNo of Tot muts sites:", tot_mut_pos)
|
||||
|
||||
# resistant mut pos
|
||||
sens_site_allR = sensP_df[[pos_colname_c]][sensP_df$sensitivity=="R"]
|
||||
sens_site_UR = unique(sens_site_allR)
|
||||
length(sens_site_UR)
|
||||
|
||||
# Sensitive mut pos
|
||||
sens_site_allS = sensP_df[[pos_colname_c]][sensP_df$sensitivity=="S"]
|
||||
sens_site_US = unique(sens_site_allS)
|
||||
length(sens_site_UR)
|
||||
|
||||
#---------------
|
||||
# Common Sites
|
||||
#----------------
|
||||
common_pos = intersect(sens_site_UR,sens_site_US)
|
||||
site_Cc = length(common_pos)
|
||||
cat("\nNo of Common sites:", site_Cc
|
||||
, "\nThese are:", common_pos)
|
||||
|
||||
#---------------
|
||||
# Resistant muts
|
||||
#----------------
|
||||
site_R = sens_site_UR[!sens_site_UR%in%common_pos]
|
||||
site_Rc = length(site_R)
|
||||
|
||||
if ( length(sens_site_allR) == table(sensP_df$sensitivity)[['R']] ){
|
||||
cat("\nNo of R muts:", length(sens_site_allR)
|
||||
, "\nNo. of R sites:",site_Rc
|
||||
, "\nThese are:", site_R
|
||||
)
|
||||
}
|
||||
|
||||
#---------------
|
||||
# Sensitive muts
|
||||
#----------------
|
||||
site_S = sens_site_US[!sens_site_US%in%common_pos]
|
||||
site_Sc = length(site_S)
|
||||
|
||||
if ( length(sens_site_allS) == table(sensP_df$sensitivity)[['S']] ){
|
||||
cat("\nNo of S muts:", length(sens_site_allS)
|
||||
, "\nNo. of S sites:", site_Sc
|
||||
, "\nThese are:", site_S)
|
||||
}
|
||||
|
||||
#########################
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue