refactored dm om plots and generated the final layout
This commit is contained in:
parent
28510471f0
commit
5bdfd03443
5 changed files with 169 additions and 85 deletions
|
@ -40,6 +40,8 @@ dm_om_wf_lf_data <- function(df
|
|||
, lf_duet = data.frame()
|
||||
, wf_mcsm_lig = data.frame()
|
||||
, lf_mcsm_lig = data.frame()
|
||||
, wf_mmcsm_lig2 = data.frame() # NEW
|
||||
, lf_mmcsm_lig2 = data.frame() # NEW
|
||||
, wf_foldx = data.frame()
|
||||
, lf_foldx = data.frame()
|
||||
, wf_deepddg = data.frame()
|
||||
|
@ -638,52 +640,48 @@ table(lf_mcsm_lig$param_type); colnames(lf_mcsm_lig)
|
|||
wf_lf_dataL[['wf_mcsm_lig']] = wf_mcsm_lig
|
||||
wf_lf_dataL[['lf_mcsm_lig']] = lf_mcsm_lig
|
||||
|
||||
#====================
|
||||
# mcsm-NA affinity
|
||||
#=========================
|
||||
# mmCSM-lig2:
|
||||
# data filtered by cut off
|
||||
#====================
|
||||
if (tolower(gene)%in%geneL_na){
|
||||
#---------------
|
||||
# mCSM-NA: WF and lF
|
||||
#-----------------
|
||||
# WF data: mcsm-na
|
||||
cols_to_select_mcsm_na = c(static_cols_start, c("mcsm_na_outcome", mcsm_na_dn), static_cols_end)
|
||||
#wf_mcsm_na = comb_df_sl[, cols_to_select_mcsm_na]
|
||||
wf_mcsm_na = comb_df_sl_na[, cols_to_select_mcsm_na]
|
||||
|
||||
pivot_cols_mcsm_na = cols_to_select_mcsm_na[1: (length(static_cols_start) + 1)]; pivot_cols_mcsm_na
|
||||
expected_rows_lf = nrow(wf_mcsm_na) * (length(wf_mcsm_na) - length(pivot_cols_mcsm_na))
|
||||
expected_rows_lf
|
||||
|
||||
# LF data: mcsm-na
|
||||
lf_mcsm_na = gather(wf_mcsm_na
|
||||
, key = param_type
|
||||
, value = param_value
|
||||
, all_of(mcsm_na_dn):tail(static_cols_end,1)
|
||||
, factor_key = TRUE)
|
||||
|
||||
if (nrow(lf_mcsm_na) == expected_rows_lf){
|
||||
cat("\nPASS: long format data created for ", mcsm_na_dn)
|
||||
}else{
|
||||
cat("\nFAIL: long format data could not be created for duet")
|
||||
quit()
|
||||
}
|
||||
|
||||
# NEW columns [outcome and outcome colname]
|
||||
lf_mcsm_na$outcome_colname = "mcsm_na_outcome"
|
||||
lf_mcsm_na$outcome = lf_mcsm_na$mcsm_na_outcome
|
||||
|
||||
# DROP static cols
|
||||
lf_mcsm_na = lf_mcsm_na[!lf_mcsm_na$param_type%in%c(static_cols_end),]
|
||||
lf_mcsm_na$param_type = factor(lf_mcsm_na$param_type)
|
||||
table(lf_mcsm_na$param_type); colnames(lf_mcsm_na)
|
||||
|
||||
# Assign them to the output list
|
||||
wf_lf_dataL[['wf_mcsm_na']] = wf_mcsm_na
|
||||
wf_lf_dataL[['lf_mcsm_na']] = lf_mcsm_na
|
||||
#=========================
|
||||
#---------------------
|
||||
# mmCSM-lig2: WF and lF
|
||||
#----------------------
|
||||
# WF data: mmcsm_lig2
|
||||
cols_to_select_mmcsm_lig2 = c(static_cols_start, c("mmcsm_lig_outcome", mmcsm_lig_dn2), static_cols_end)
|
||||
wf_mmcsm_lig2 = comb_df_sl_lig[, cols_to_select_mmcsm_lig2] # filtered df
|
||||
|
||||
pivot_cols_mmcsm_lig2 = cols_to_select_mmcsm_lig2[1: (length(static_cols_start) + 1)]; pivot_cols_mmcsm_lig2
|
||||
expected_rows_lf = nrow(wf_mmcsm_lig2) * (length(wf_mmcsm_lig2) - length(pivot_cols_mmcsm_lig2))
|
||||
expected_rows_lf
|
||||
|
||||
# LF data: mmcsm_lig2
|
||||
lf_mmcsm_lig2 = gather(wf_mmcsm_lig2
|
||||
, key = param_type
|
||||
, value = param_value
|
||||
, all_of(mmcsm_lig_dn2):tail(static_cols_end,1)
|
||||
, factor_key = TRUE)
|
||||
|
||||
if (nrow(lf_mmcsm_lig2) == expected_rows_lf){
|
||||
cat("\nPASS: long format data created for ", mmcsm_lig_dn2)
|
||||
}else{
|
||||
cat("\nFAIL: long format data could not be created for mmcsm_lig2")
|
||||
quit()
|
||||
}
|
||||
|
||||
# NEW columns [outcome and outcome colname]
|
||||
lf_mmcsm_lig2$outcome_colname = "mmcsm_lig_outcome"
|
||||
lf_mmcsm_lig2$outcome = lf_mmcsm_lig2$mmcsm_lig_outcome
|
||||
|
||||
# DROP static cols
|
||||
lf_mmcsm_lig2 = lf_mmcsm_lig2[!lf_mmcsm_lig2$param_type%in%c(static_cols_end),]
|
||||
lf_mmcsm_lig2$param_type = factor(lf_mmcsm_lig2$param_type)
|
||||
table(lf_mmcsm_lig2$param_type); colnames(lf_mmcsm_lig2)
|
||||
|
||||
# Assign them to the output list
|
||||
wf_lf_dataL[['wf_mmcsm_lig2']] = wf_mmcsm_lig2
|
||||
wf_lf_dataL[['lf_mmcsm_lig2']] = lf_mmcsm_lig2
|
||||
|
||||
#=========================
|
||||
# mcsm-ppi2 affinity
|
||||
# data filtered by cut off
|
||||
|
@ -730,6 +728,54 @@ if (tolower(gene)%in%geneL_ppi2){
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
#====================
|
||||
# mcsm-NA affinity
|
||||
# data filtered by cut off
|
||||
#====================
|
||||
if (tolower(gene)%in%geneL_na){
|
||||
#---------------
|
||||
# mCSM-NA: WF and lF
|
||||
#-----------------
|
||||
# WF data: mcsm-na
|
||||
cols_to_select_mcsm_na = c(static_cols_start, c("mcsm_na_outcome", mcsm_na_dn), static_cols_end)
|
||||
#wf_mcsm_na = comb_df_sl[, cols_to_select_mcsm_na]
|
||||
wf_mcsm_na = comb_df_sl_na[, cols_to_select_mcsm_na]
|
||||
|
||||
pivot_cols_mcsm_na = cols_to_select_mcsm_na[1: (length(static_cols_start) + 1)]; pivot_cols_mcsm_na
|
||||
expected_rows_lf = nrow(wf_mcsm_na) * (length(wf_mcsm_na) - length(pivot_cols_mcsm_na))
|
||||
expected_rows_lf
|
||||
|
||||
# LF data: mcsm-na
|
||||
lf_mcsm_na = gather(wf_mcsm_na
|
||||
, key = param_type
|
||||
, value = param_value
|
||||
, all_of(mcsm_na_dn):tail(static_cols_end,1)
|
||||
, factor_key = TRUE)
|
||||
|
||||
if (nrow(lf_mcsm_na) == expected_rows_lf){
|
||||
cat("\nPASS: long format data created for ", mcsm_na_dn)
|
||||
}else{
|
||||
cat("\nFAIL: long format data could not be created for duet")
|
||||
quit()
|
||||
}
|
||||
|
||||
# NEW columns [outcome and outcome colname]
|
||||
lf_mcsm_na$outcome_colname = "mcsm_na_outcome"
|
||||
lf_mcsm_na$outcome = lf_mcsm_na$mcsm_na_outcome
|
||||
|
||||
# DROP static cols
|
||||
lf_mcsm_na = lf_mcsm_na[!lf_mcsm_na$param_type%in%c(static_cols_end),]
|
||||
lf_mcsm_na$param_type = factor(lf_mcsm_na$param_type)
|
||||
table(lf_mcsm_na$param_type); colnames(lf_mcsm_na)
|
||||
|
||||
# Assign them to the output list
|
||||
wf_lf_dataL[['wf_mcsm_na']] = wf_mcsm_na
|
||||
wf_lf_dataL[['lf_mcsm_na']] = lf_mcsm_na
|
||||
|
||||
}
|
||||
|
||||
return(wf_lf_dataL)
|
||||
}
|
||||
############################################################################
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue