Skip to content

Commit

Permalink
fix: set metadata na marker to '!' by default
Browse files Browse the repository at this point in the history
metadata_na_marker was not present in ggoncoplot_options so R was guessing user wanted to get metadata_na_marker_size instead.
  • Loading branch information
selkamand committed Jan 13, 2025
1 parent 0f4fda2 commit 4d65a81
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions R/oncoplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ ggoncoplot <- function(data,
}

## Draw sample metadata plots ---------------------------------------------------------

if(!is.null(metadata)){
gg_metadata <- gg1d::gg1d(
metadata,
Expand Down Expand Up @@ -860,7 +861,7 @@ ggoncoplot_plot <- function(data,
topn_to_palette <- function(data, palette = NULL, verbose = TRUE){
unique_impacts <- unique(data[["MutationType"]])
unique_impacts_minus_multiple <- unique_impacts[unique_impacts != "Multi_Hit"]
#browser()

if (all(is.na(unique_impacts))) {
palette <- NA
} else if (is.null(palette)) {
Expand Down Expand Up @@ -896,7 +897,7 @@ topn_to_palette <- function(data, palette = NULL, verbose = TRUE){
palette <- palette[names(palette) %in% unique_impacts]
}
}
#browser()

return(palette)
}

Expand Down Expand Up @@ -1856,6 +1857,7 @@ ggoncoplot_options <- function(
metadata_legend_ncol = metadata_legend_ncol,
fontsize_metadata_barplot_y_numbers = fontsize_metadata_barplot_y_numbers,
metadata_legend_key_size = metadata_legend_key_size,
metadata_na_marker = metadata_na_marker,
metadata_na_marker_size = metadata_na_marker_size,
metadata_maxlevels = metadata_maxlevels,
metadata_numeric_plot_type = metadata_numeric_plot_type,
Expand Down

0 comments on commit 4d65a81

Please sign in to comment.