added adjusted p-values for DM muts comparison

This commit is contained in:
Tanushree Tunstall 2021-02-27 10:42:04 +00:00
parent 9784bc1729
commit 88229860e2

View file

@ -264,7 +264,34 @@ rows_to_remove = c("lineage2 vs lineage1", "lineage3 vs lineage1", "lineage3 vs
ks_df_combined_f = ks_df_combined[-match(rows_to_remove, ks_df_combined$group),] ks_df_combined_f = ks_df_combined[-match(rows_to_remove, ks_df_combined$group),]
#=======================================================================
#======================
# P-value adjustments
#=======================
#%%
# add bonferroni adjustment as well
ks_df_combined_f$p_adj_bonferroni = p.adjust(ks_df_combined_f$ks_pvalue, method = "bonferroni")
ks_df_combined_f$signif_bon = ks_df_combined_f$p_adj_bonferroni
ks_df_combined_f = dplyr::mutate(ks_df_combined_f
, signif_bon = case_when(signif_bon == 0.05 ~ "."
, signif_bon <=0.0001 ~ '****'
, signif_bon <=0.001 ~ '***'
, signif_bon <=0.01 ~ '**'
, signif_bon <0.05 ~ '*'
, TRUE ~ 'ns'))
#add fdr as well
ks_df_combined_f$p_adj_fdr = p.adjust(ks_df_combined_f$ks_pvalue, method = "hommel")
ks_df_combined_f$signif_fdr = ks_df_combined_f$p_adj_fdr
ks_df_combined_f = dplyr::mutate(ks_df_combined_f
, 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'))
#========================================================================================
#****************** #******************
# write output file: KS test # write output file: KS test
#****************** #******************