added fold and duet agreement to extreme_muts.R

This commit is contained in:
Tanushree Tunstall 2020-09-23 11:20:22 +01:00
parent 4398c049ca
commit 5f10ad8075
2 changed files with 25 additions and 6 deletions

View file

@ -10,6 +10,7 @@ setwd("~/git/LSHTM_analysis/scripts/plotting")
getwd()
#source("Header_TT.R")
library(tidyverse)
library(ggplot2)
library(data.table)
library(dplyr)
@ -19,7 +20,6 @@ library(dplyr)
#=========
#source("combining_dfs_plotting.R")
# FIXME: add a separate script to add foldx values and others
source("output_tables.R")
rm(df, merged_df3_short, df_output)
@ -147,3 +147,22 @@ cat("No of budding hotspots (sites with 2 mutations):", n_budding_sites
, "\nNo. of sites with mutiple (>2) mutations:", n_mult_muts_sites)
#==========================================================================
#==============================
# agreement of foldx and DUET
#==============================
mcsm_foldx = merged_df3[which(merged_df3$duet_outcome != merged_df3$foldx_outcome),]
mcsm_foldx$sign_comp = ifelse(sign(mcsm_foldx$duet_scaled)==sign(mcsm_foldx$ddg), "PASS", "FAIL")
table(mcsm_foldx$sign_comp)
# another way of checking
merged_df3$sign_comp = ifelse(sign(merged_df3$duet_scaled)==sign(merged_df3$ddg), "PASS", "FAIL")
table(merged_df3$sign_comp)
disagreement = table(merged_df3$sign_comp)[2]/nrow(merged_df3)*100
agreement = 100 - disagreement
cat("There is", agreement, "% between mcsm and foldx predictions")
##############################################################################

View file

@ -88,10 +88,10 @@ my_min = min(my_df$foldx_scaled); my_min
my_max = max(my_df$foldx_scaled); my_max
if (my_min == -1 && my_max == 1){
cat("PASS: foldx ddg successfully scaled b/w -1 and 1"
cat("\nPASS: foldx ddg successfully scaled b/w -1 and 1"
, "\nProceeding with assigning foldx outcome category")
}else{
cat("FAIL: could not scale foldx ddg values"
cat("\nFAIL: could not scale foldx ddg values"
, "Aborting!")
}
@ -104,9 +104,9 @@ my_df$foldx_outcome = ifelse(my_df$ddg < 0, "Stabilising", "Destabilising")
c2 = table(my_df$ddg < 0)
if ( all(c1 == c2) ){
cat("PASS: foldx outcome successfully created")
cat("\nPASS: foldx outcome successfully created")
}else{
cat("FAIL: foldx outcome could not be created. Aborting!")
cat("\nFAIL: foldx outcome could not be created. Aborting!")
exit()
}