added lineage_labels and mutation_info_labels to combinig_dfs_plotting

This commit is contained in:
Tanushree Tunstall 2021-09-09 16:10:11 +01:00
parent 03031d2eb6
commit b7d50fbbcd
4 changed files with 38 additions and 187 deletions

View file

@ -152,6 +152,40 @@ combining_dfs_plotting <- function( my_df_u
unique(meta_muts_u[! meta_muts_u %in% merged_muts_u])
quit()
}
# Quick formatting: pretty labels
#-----------------------
# mutation_info_labels
#-----------------------
merged_df2$mutation_info_labels = ifelse(merged_df2$mutation_info == dr_muts_col
, "DM", "OM")
merged_df2$mutation_info_labels = factor(merged_df2$mutation_info_labels)
#-----------------------
# lineage labels
#-----------------------
merged_df2$lineage_labels = gsub("lineage", "L", merged_df2$lineage)
merged_df2$lineage_labels = factor(merged_df2$lineage_labels, c("L1"
, "L2"
, "L3"
, "L4"
, "L5"
, "L6"
, "L7"
, "LBOV"
, "L1;L2"
, "L1;L3"
, "L1;L4"
, "L2;L3"
, "L2;L3;L4"
, "L2;L4"
, "L2;L6"
, "L2;LBOV"
, "L3;L4"
, "L4;L6"
, "L4;L7"
, ""))
#=================================================================
# Merge 2: merged_df3

View file

@ -16,12 +16,13 @@ cat("cols imported:"
#############################################################
# without facet
lineage_distP(lin_dist_plot
, with_facet = F
, leg_label = "Mutation Class"
)
# without facet
lineage_distP(lin_dist_plot
, with_facet = T
, facet_wrap_var = "mutation_info_labels"