saving work minor changes perhaps

This commit is contained in:
Tanushree Tunstall 2020-10-08 16:03:12 +01:00
parent 7158f5b2c9
commit bf3e830f64
2 changed files with 149 additions and 216 deletions

View file

@ -1,6 +1,7 @@
#!/usr/bin/env Rscript
#########################################################
# TASK: producing boxplots for dr and other muts
# TASK: checking muts with extreme effects and other
# quick analysis
#########################################################
#=======================================================================
@ -26,6 +27,34 @@ rm(df, merged_df3_short, df_output)
#===============================================================
df_comp = df_ordered[!is.na(df_ordered$af),]
#===============================================================
#============
# quick checks
#============
merged_df3_comp = merged_df3[!is.na(merged_df3$af),]
# AF
round(summary(merged_df3_comp$af), 4)*100
round(tapply(merged_df3_comp$af, list(merged_df3_comp$mutation_info), median), 4)*100
ks.test(merged_df3_comp$af[merged_df3_comp$mutation_info == dr_muts_col]
, merged_df3_comp$af[merged_df3_comp$mutation_info == other_muts_col])
# OR
round(summary(merged_df3_comp$or_mychisq), 4)
tapply(merged_df3_comp$or_mychisq, list(merged_df3_comp$mutation_info), median)
ks.test(merged_df3_comp$or_mychisq[merged_df3_comp$mutation_info == dr_muts_col]
, merged_df3_comp$or_mychisq[merged_df3_comp$mutation_info == other_muts_col])
# adjusted OR
merged_df3_comp_v2 = merged_df3[!is.na(merged_df3$or_kin),]
round(summary(merged_df3_comp_v2$or_kin), 4)
tapply(merged_df3_comp_v2$or_kin, list(merged_df3_comp_v2$mutation_info), median)
ks.test(merged_df3_comp_v2$or_kin[merged_df3_comp_v2$mutation_info == dr_muts_col]
, merged_df3_comp_v2$or_kin[merged_df3_comp_v2$mutation_info == other_muts_col])
#%%%%%%%%%%%%%%%%%%%%%
# REASSIGNMENT
df = df_comp