added fold and duet agreement to extreme_muts.R
This commit is contained in:
parent
6d08b646fc
commit
a3aab4556a
2 changed files with 25 additions and 6 deletions
|
@ -10,6 +10,7 @@ setwd("~/git/LSHTM_analysis/scripts/plotting")
|
||||||
getwd()
|
getwd()
|
||||||
|
|
||||||
#source("Header_TT.R")
|
#source("Header_TT.R")
|
||||||
|
library(tidyverse)
|
||||||
library(ggplot2)
|
library(ggplot2)
|
||||||
library(data.table)
|
library(data.table)
|
||||||
library(dplyr)
|
library(dplyr)
|
||||||
|
@ -19,7 +20,6 @@ library(dplyr)
|
||||||
#=========
|
#=========
|
||||||
#source("combining_dfs_plotting.R")
|
#source("combining_dfs_plotting.R")
|
||||||
|
|
||||||
# FIXME: add a separate script to add foldx values and others
|
|
||||||
source("output_tables.R")
|
source("output_tables.R")
|
||||||
rm(df, merged_df3_short, df_output)
|
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)
|
, "\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")
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
|
|
@ -88,10 +88,10 @@ my_min = min(my_df$foldx_scaled); my_min
|
||||||
my_max = max(my_df$foldx_scaled); my_max
|
my_max = max(my_df$foldx_scaled); my_max
|
||||||
|
|
||||||
if (my_min == -1 && my_max == 1){
|
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")
|
, "\nProceeding with assigning foldx outcome category")
|
||||||
}else{
|
}else{
|
||||||
cat("FAIL: could not scale foldx ddg values"
|
cat("\nFAIL: could not scale foldx ddg values"
|
||||||
, "Aborting!")
|
, "Aborting!")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,9 +104,9 @@ my_df$foldx_outcome = ifelse(my_df$ddg < 0, "Stabilising", "Destabilising")
|
||||||
c2 = table(my_df$ddg < 0)
|
c2 = table(my_df$ddg < 0)
|
||||||
|
|
||||||
if ( all(c1 == c2) ){
|
if ( all(c1 == c2) ){
|
||||||
cat("PASS: foldx outcome successfully created")
|
cat("\nPASS: foldx outcome successfully created")
|
||||||
}else{
|
}else{
|
||||||
cat("FAIL: foldx outcome could not be created. Aborting!")
|
cat("\nFAIL: foldx outcome could not be created. Aborting!")
|
||||||
exit()
|
exit()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue