lineage_dist: add all_lineages feature

This commit is contained in:
Tanushree Tunstall 2022-03-06 13:31:43 +00:00
parent 8fa585417e
commit 56a6aa8c7e
2 changed files with 8 additions and 1 deletions

View file

@ -5,9 +5,10 @@
######################################## ########################################
lin_count_bp_diversity <- function( lf_data = lin_wf lin_count_bp_diversity <- function( lf_data = lin_wf
, all_lineages = F
, x_categ = "sel_lineages" , x_categ = "sel_lineages"
, y_count = "snp_diversity" , y_count = "snp_diversity"
, all_lineages = F #, all_lineages = F
, use_lineages = c("L1", "L2", "L3", "L4") , use_lineages = c("L1", "L2", "L3", "L4")
#, bar_fill_categ = "count_categ" #, bar_fill_categ = "count_categ"
, display_label_col = "snp_diversity_f" , display_label_col = "snp_diversity_f"

View file

@ -13,6 +13,8 @@ lineage_distP <- function(plotdf
, x_axis = "duet_scaled" , x_axis = "duet_scaled"
, y_axis = "lineage_labels" , y_axis = "lineage_labels"
, x_lab = "DUET" , x_lab = "DUET"
, all_lineages = F
, use_lineages = c("L1", "L2", "L3", "L4")
, with_facet = F , with_facet = F
, facet_wrap_var = "" , facet_wrap_var = ""
, fill_categ = "mutation_info_labels" , fill_categ = "mutation_info_labels"
@ -29,6 +31,10 @@ lineage_distP <- function(plotdf
{ {
if(!all_lineages){
plotdf = plotdf[plotdf[[y_axis]]%in%use_lineages,]
}
LinDistP = ggplot(plotdf, aes_string(x = x_axis LinDistP = ggplot(plotdf, aes_string(x = x_axis
, y = y_axis))+ , y = y_axis))+