renamed 2 to _v2
This commit is contained in:
parent
c9d7ea9fad
commit
802d6f8495
18 changed files with 761 additions and 976 deletions
|
@ -16,6 +16,7 @@ corr_data_extract <- function(df
|
|||
|
||||
if ( missing(colnames_to_extract) || missing(colnames_display_key) ){
|
||||
|
||||
# log10maf
|
||||
df$maf2 = log10(df$maf) # can't see otherwise
|
||||
sum(is.na(df$maf2))
|
||||
|
||||
|
@ -40,7 +41,7 @@ corr_data_extract <- function(df
|
|||
, "consurf_score" , "snap2_score" , "provean_score"
|
||||
, "ligand_affinity_change", "mmcsm_lig"
|
||||
#, "ddg_dynamut", "ddg_encom", "dds_encom", "ddg_mcsm", "ddg_sdm", "ddg_duet"
|
||||
)
|
||||
)
|
||||
|
||||
display_common_colnames = c( drug, "dst_mode"
|
||||
, "DUET" , "FoldX" , "DeepDDG", "Dynamut2"
|
||||
|
@ -51,7 +52,7 @@ corr_data_extract <- function(df
|
|||
, "ConSurf" , "SNAP2" , "PROVEAN"
|
||||
, "mCSM-lig", "mmCSM-lig"
|
||||
# , "Dynamut" , "ENCoM-DDG" , "mCSM" , "SDM" , "DUET-d" , "ENCoM-DDS"
|
||||
)
|
||||
)
|
||||
|
||||
if (tolower(gene)%in%geneL_normal){
|
||||
colnames_to_extract = c(common_colnames)
|
||||
|
@ -59,21 +60,21 @@ corr_data_extract <- function(df
|
|||
corr_df = df[,colnames_to_extract]
|
||||
colnames(corr_df) = display_colnames
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (tolower(gene)%in%geneL_ppi2){
|
||||
colnames_to_extract = c(common_colnames ,"mcsm_ppi2_affinity", ppi2Dist_colname)
|
||||
display_colnames = c(display_common_colnames,"mCSM-PPI2" , "PPI-Dist")
|
||||
corr_df = df[,colnames_to_extract]
|
||||
colnames(corr_df) = display_colnames
|
||||
}
|
||||
}
|
||||
|
||||
if (tolower(gene)%in%geneL_na){
|
||||
colnames_to_extract = c(common_colnames,"mcsm_na_affinity", naDist_colname)
|
||||
display_colnames = c(display_common_colnames, "mCSM-NA", "NA-Dist")
|
||||
display_colnames = c(display_common_colnames, "mCSM-NA", "NCA-Dist")
|
||||
corr_df = df[,colnames_to_extract]
|
||||
colnames(corr_df) = display_colnames
|
||||
}
|
||||
}
|
||||
|
||||
# [optional] arg: extract_scaled_cols
|
||||
if (extract_scaled_cols){
|
||||
|
@ -98,19 +99,19 @@ corr_data_extract <- function(df
|
|||
# colnames(corr_df)[colnames(corr_df)%in%colnames_to_extract] <- display_colnames
|
||||
# colnames(corr_df)
|
||||
|
||||
cat("\nExtracted ncols:", ncol(corr_df)
|
||||
,"\nRenaming successful")
|
||||
|
||||
cat("\nSneak peak...")
|
||||
print(head(corr_df))
|
||||
|
||||
# Move drug column to the end
|
||||
last_col = colnames(corr_df[ncol(corr_df)])
|
||||
#corr_df_f = corr_df %>% dplyr::relocate(all_of(drug), .after = last_col)
|
||||
|
||||
#return(corr_df_f)
|
||||
return(corr_df)
|
||||
|
||||
cat("\nExtracted ncols:", ncol(corr_df)
|
||||
,"\nRenaming successful")
|
||||
|
||||
cat("\nSneak peak...")
|
||||
print(head(corr_df))
|
||||
|
||||
# Move drug column to the end
|
||||
last_col = colnames(corr_df[ncol(corr_df)])
|
||||
#corr_df_f = corr_df %>% dplyr::relocate(all_of(drug), .after = last_col)
|
||||
|
||||
#return(corr_df_f)
|
||||
return(corr_df)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -222,12 +222,12 @@ dm_om_wf_lf_data <- function(df
|
|||
}
|
||||
|
||||
if (tolower(gene)%in%geneL_na){
|
||||
colnames_to_extract = c(common_colnames,"mcsm_na_affinity" , "mcsm_na_scaled" , "mcsm_na_outcome" , naDist_colname)
|
||||
colnames_to_extract = c(common_colnames ,"mcsm_na_affinity" , "mcsm_na_scaled" , "mcsm_na_outcome" , naDist_colname)
|
||||
display_colnames = c(display_common_colnames, "mcsm_na_affinity" , mcsm_na_dn , "mcsm_na_outcome" , na_dist_dn)
|
||||
comb_df_sl = df[, colnames_to_extract]
|
||||
|
||||
# Rename cols: display names
|
||||
colnames(comb_df) = display_colnames
|
||||
colnames(comb_df_sl) = display_colnames
|
||||
# Affinity filtered data: mcsm-na --> naDist_colname
|
||||
comb_df_sl_na = comb_df_sl[comb_df_sl[[na_dist_dn]]<DistCutOff,]
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ LigDist_cutoff <<- 10
|
|||
|
||||
DistCutOff <<- 10
|
||||
ppi2Dist_colname <<- "interface_dist"
|
||||
naDist_colname <<- "TBC"
|
||||
naDist_colname <<- "nca_distance" # added it
|
||||
|
||||
#==================
|
||||
# Angstroms symbol
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue