generated ggpairs plots finally

This commit is contained in:
Tanushree Tunstall 2022-08-15 19:05:22 +01:00
parent b68841b337
commit a3e5283a9b
11 changed files with 657 additions and 939 deletions

View file

@ -154,6 +154,11 @@ for (i in unique(str_df$position) ){
str_df$effect_type = sub("\\.[0-9]+", "", str_df$effect_type) # cull duplicate effect types that happen when there are exact duplicate values
colnames(str_df)
# check
str_df_check = str_df[str_df$position%in%c(24, 32,160, 303, 334),]
table(str_df$effect_type)
#================
# for Plots
#================
@ -161,9 +166,56 @@ str_df_short = str_df[, c("mutationinformation","position","sensitivity"
, "effect_type"
, "effect_sign")]
# check
str_df_check = str_df[str_df$position%in%c(24, 32,160, 303, 334),]
table(str_df$effect_type)
table(str_df_short$effect_type)
table(str_df_short$effect_sign)
str(str_df_short)
# assign pe outcome
str_df_short$pe_outcome = ifelse(str_df_short$effect_sign<0, "DD", "SS")
table(str_df_short$pe_outcome )
table(str_df_short$effect_sign)
#==============
# group effect type:
# lig, ppi2, nuc. acid, stability
#==============
affcols = c("affinity_scaled", "mmcsm_lig_scaled")
ppi2_cols = c("mcsm_ppi2_scaled")
#nuc_na_cols = c("mcsm_a_scaled")
#lig
table(str_df_short$effect_type)
str_df_short$effect_grouped = ifelse(str_df_short$effect_type%in%affcols
, "lig"
, str_df_short$effect_type)
table(str_df_short$effect_grouped)
#ppi2
str_df_short$effect_grouped = ifelse(str_df_short$effect_grouped%in%ppi2_cols
, "ppi2"
, str_df_short$effect_grouped)
table(str_df_short$effect_grouped)
#stability
str_df_short$effect_grouped = ifelse(!str_df_short$effect_grouped%in%c("lig", "ppi2")
, "stability"
, str_df_short$effect_grouped)
table(str_df_short$effect_grouped)
# create a sign as well
str_df_short$pe_effect_outcome = paste0(str_df_short$pe_outcome, "_"
, str_df_short$effect_grouped)
table(str_df_short$pe_effect_outcome)
#####################################################################
# Chimera: for colouring
####################################################################
#-------------------------------------
# get df with unique position