renamed 2 to _v2
This commit is contained in:
parent
c9d7ea9fad
commit
802d6f8495
18 changed files with 761 additions and 976 deletions
|
@ -38,18 +38,18 @@ angstroms_symbol
|
|||
df3 = merged_df3
|
||||
|
||||
cols_to_output = c("mutationinformation"
|
||||
, "position"
|
||||
, affinity_dist_colnames[1]
|
||||
, "ligand_affinity_change"
|
||||
, "ligand_outcome"
|
||||
, "mmcsm_lig"
|
||||
, "mmcsm_lig_outcome"
|
||||
, affinity_dist_colnames[2]
|
||||
, "mcsm_ppi2_affinity"
|
||||
, "mcsm_ppi2_outcome"
|
||||
, "maf"
|
||||
, "or_mychisq"
|
||||
, "pval_fisher")
|
||||
, "position"
|
||||
, affinity_dist_colnames[1]
|
||||
, "ligand_affinity_change"
|
||||
, "ligand_outcome"
|
||||
, "mmcsm_lig"
|
||||
, "mmcsm_lig_outcome"
|
||||
, affinity_dist_colnames[2]
|
||||
, "mcsm_ppi2_affinity"
|
||||
, "mcsm_ppi2_outcome"
|
||||
, "maf"
|
||||
, "or_mychisq"
|
||||
, "pval_fisher")
|
||||
|
||||
cols_to_output
|
||||
df3_output = df3[, cols_to_output]
|
||||
|
@ -65,12 +65,12 @@ colnames(df3_output)
|
|||
df3_output$p_adj_fdr = p.adjust(df3_output$pval_fisher, method = "fdr")
|
||||
df3_output$signif_fdr = df3_output$p_adj_fdr
|
||||
df3_output = dplyr::mutate(df3_output
|
||||
, signif_fdr = case_when(signif_fdr == 0.05 ~ "."
|
||||
, signif_fdr <=0.0001 ~ '****'
|
||||
, signif_fdr <=0.001 ~ '***'
|
||||
, signif_fdr <=0.01 ~ '**'
|
||||
, signif_fdr <0.05 ~ '*'
|
||||
, TRUE ~ 'ns'))
|
||||
, signif_fdr = case_when(signif_fdr == 0.05 ~ "."
|
||||
, signif_fdr <=0.0001 ~ '****'
|
||||
, signif_fdr <=0.001 ~ '***'
|
||||
, signif_fdr <=0.01 ~ '**'
|
||||
, signif_fdr <0.05 ~ '*'
|
||||
, TRUE ~ 'ns'))
|
||||
# rounding
|
||||
df3_output$or_mychisq = round(df3_output$or_mychisq,2)
|
||||
df3_output$p_adj_fdr = round(df3_output$p_adj_fdr,2)
|
||||
|
@ -101,17 +101,17 @@ head(df3_output)
|
|||
df_lig = df3_output[df3_output[[LigDist_colname]]<DistCutOff,]
|
||||
|
||||
cols_to_output_lig = c("mutationinformation"
|
||||
, "position"
|
||||
, LigDist_colname
|
||||
, "ligand_affinity_change"
|
||||
, "ligand_outcome"
|
||||
, "mmcsm_lig"
|
||||
, "mmcsm_lig_outcome"
|
||||
, "maf_percent"
|
||||
, "or_mychisq"
|
||||
, "pval_fisher"
|
||||
, "p_adj_fdr"
|
||||
, "signif_fdr")
|
||||
, "position"
|
||||
, LigDist_colname
|
||||
, "ligand_affinity_change"
|
||||
, "ligand_outcome"
|
||||
, "mmcsm_lig"
|
||||
, "mmcsm_lig_outcome"
|
||||
, "maf_percent"
|
||||
, "or_mychisq"
|
||||
, "pval_fisher"
|
||||
, "p_adj_fdr"
|
||||
, "signif_fdr")
|
||||
# select cols
|
||||
Out_df_lig = df_lig[, cols_to_output_lig]
|
||||
|
||||
|
@ -123,17 +123,17 @@ Out_df_ligS = Out_df_lig[order(-Out_df_lig$or_mychisq, Out_df_lig$maf_percent),
|
|||
head(Out_df_ligS); tail(Out_df_ligS)
|
||||
|
||||
colsNames_to_output_lig = c("Mutation"
|
||||
, "position"
|
||||
, paste0("Lig-Dist (", angstroms_symbol, ")")
|
||||
, "mCSM-ligand affinity"
|
||||
, "mCSM ligand_outcome"
|
||||
, "mmCSM-ligand affinity"
|
||||
, "mmCSM ligand_outcome"
|
||||
, paste0("MAF ","(%)")
|
||||
, "Odds Ratio"
|
||||
, "P-value"
|
||||
, "Adjusted P-value"
|
||||
, "P-value significance")
|
||||
, "position"
|
||||
, paste0("Lig-Dist (", angstroms_symbol, ")")
|
||||
, "mCSM-ligand affinity"
|
||||
, "mCSM ligand_outcome"
|
||||
, "mmCSM-ligand affinity"
|
||||
, "mmCSM ligand_outcome"
|
||||
, paste0("MAF ","(%)")
|
||||
, "Odds Ratio"
|
||||
, "P-value"
|
||||
, "Adjusted P-value"
|
||||
, "Adjusted P-value significance")
|
||||
|
||||
colnames(Out_df_ligS) = colsNames_to_output_lig
|
||||
head(Out_df_ligS)
|
||||
|
@ -142,8 +142,8 @@ head(Out_df_ligS)
|
|||
# write output file: KS test within grpup
|
||||
#----------------------
|
||||
Out_ligT = paste0(outdir_stats
|
||||
, tolower(gene)
|
||||
, "_lig_muts.csv")
|
||||
, tolower(gene)
|
||||
, "_lig_muts.csv")
|
||||
|
||||
cat("Output of Ligand muts:", Out_ligT )
|
||||
write.csv(Out_df_ligS, Out_ligT, row.names = FALSE)
|
||||
|
@ -179,12 +179,13 @@ Out_df_ppi2S = Out_df_ppi2[order(-Out_df_ppi2$or_mychisq, Out_df_ppi2$maf_percen
|
|||
colsNames_to_output_ppi2 = c("Mutation"
|
||||
, "position"
|
||||
, paste0("PPI2-Dist (", angstroms_symbol, ")")
|
||||
, paste0("mCSM-PPI2 (", delta_symbol, ")")
|
||||
, paste0("mCSM-PPI2 (", delta_symbol,delta_symbol,"G)")
|
||||
, "mCSM-PPI2 outcome"
|
||||
, paste0("MAF ","(%)")
|
||||
, "Odds Ratio"
|
||||
, "P-value"
|
||||
, "Adjusted P-value"
|
||||
, "P-value significance")
|
||||
, "Adjusted P-value significance")
|
||||
|
||||
colnames(Out_df_ppi2S) = colsNames_to_output_ppi2
|
||||
Out_df_ppi2S
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue