lineage: toggle for "all lineages"
This commit is contained in:
parent
6c6709e41e
commit
bf3194259e
2 changed files with 13 additions and 0 deletions
|
@ -7,6 +7,8 @@
|
|||
lin_count_bp <- function( lf_data = lin_lf
|
||||
, x_categ = "sel_lineages"
|
||||
, y_count = "p_count"
|
||||
, all_lineages = F
|
||||
, use_lineages = c("L1", "L2", "L3", "L4")
|
||||
, bar_fill_categ = "count_categ"
|
||||
, display_label_col = "p_count"
|
||||
, bar_stat_stype = "identity"
|
||||
|
@ -29,6 +31,11 @@ lin_count_bp <- function( lf_data = lin_lf
|
|||
, y_label = c("Count", "SNP diversity")
|
||||
#, y_label = c("Count")
|
||||
) {
|
||||
if(!all_lineages){
|
||||
#lf_data = lf_data[lf_data$sel_lineages%in%use_lineages,]
|
||||
lf_data = lf_data[lf_data[[x_categ]]%in%use_lineages,]
|
||||
}
|
||||
|
||||
g = ggplot(lf_data
|
||||
, aes( x = factor( eval(parse(text = x_categ)), ordered = T )
|
||||
, y = eval(parse(text = y_count))
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
lin_count_bp_diversity <- function( lf_data = lin_wf
|
||||
, x_categ = "sel_lineages"
|
||||
, y_count = "snp_diversity"
|
||||
, all_lineages = F
|
||||
, use_lineages = c("L1", "L2", "L3", "L4")
|
||||
#, bar_fill_categ = "count_categ"
|
||||
, display_label_col = "snp_diversity_f"
|
||||
, bar_stat_stype = "identity"
|
||||
|
@ -29,6 +31,10 @@ lin_count_bp_diversity <- function( lf_data = lin_wf
|
|||
#, y_label = c("Count", "SNP diversity")
|
||||
, y_label = c("SNP diversity")
|
||||
) {
|
||||
if(!all_lineages){
|
||||
lf_data = lf_data[lf_data[[x_categ]]%in%use_lineages,]
|
||||
}
|
||||
|
||||
g = ggplot(lf_data
|
||||
, aes( x = factor( eval(parse(text = x_categ)), ordered = T )
|
||||
, y = eval(parse(text = y_count))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue