Skip to content

Commit

Permalink
fix molecular features boxplots
Browse files Browse the repository at this point in the history
  • Loading branch information
pcastellanoescuder committed Jan 12, 2024
1 parent 315584f commit 050b433
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: ddh
Type: Package
Title: Utility Functions and Data Sets for Data-driven Hypothesis
Version: 0.3.22
Version: 0.3.23
Authors@R: c(
person(given = "Matthew",
family = "Hirschey",
Expand Down
8 changes: 7 additions & 1 deletion R/plots.R
Original file line number Diff line number Diff line change
Expand Up @@ -2057,6 +2057,7 @@ make_molecular_features_pathways <- function(input = list(),
#' @export
#' @examples
#' make_molecular_features_boxplots(input = list(type = 'gene', query = 'ROCK1', content = 'ROCK1'))
#' make_molecular_features_boxplots(input = list(type = 'gene', query = 'ROCK1', content = c('ROCK1', 'ROCK2')))
make_molecular_features_boxplots <- function(input = list(),
target_genes = NULL,
sex_select = NULL,
Expand Down Expand Up @@ -2085,7 +2086,7 @@ make_molecular_features_boxplots <- function(input = list(),

plot_data <- data_universal_expression_long %>%
dplyr::left_join(gene_molecular_features_segments %>%
dplyr::select(depmap_id, group, cell_name, sex, lineage, lineage_subtype),
dplyr::select(depmap_id, Query, group, cell_name, sex, lineage, lineage_subtype),
by = "depmap_id") %>%
dplyr::mutate(group = stringr::str_to_title(group)) %>%
dplyr::mutate(group = factor(group, levels = c("Resistant", "Sensitive")))
Expand Down Expand Up @@ -2115,6 +2116,11 @@ make_molecular_features_boxplots <- function(input = list(),
scale_fill_ddh_d(palette = input$type) +
ggplot2::theme(axis.text.x = ggplot2::element_text(size = 15))

if (length(input$content) > 1) {
plot_complete <- plot_complete +
ggplot2::facet_wrap(~ Query, scales = "free")
}

return(plot_complete)
}

Expand Down

0 comments on commit 050b433

Please sign in to comment.