Skip to content

Commit

Permalink
Add options to pt_annot_plot
Browse files Browse the repository at this point in the history
  • Loading branch information
bschilder committed Apr 19, 2024
1 parent 0e23969 commit 71d544b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion R/gpt_annot_plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#'
#' Plot annotations from GPT.
#' @param top_n Top number of most severe phenotypes to plot in heatmap.
#' @param width Max facet label width.
#' @inheritParams gpt_annot_check
#' @inheritParams add_ont_lvl
#' @inheritParams add_ancestor
Expand All @@ -15,6 +16,7 @@ gpt_annot_plot <- function(annot = gpt_annot_read(),
keep_ont_levels=seq(3,17),
keep_descendants="Phenotypic abnormality",
top_n=50,
width=80,
verbose=TRUE
){
requireNamespace("ggplot2")
Expand Down Expand Up @@ -78,7 +80,9 @@ gpt_annot_plot <- function(annot = gpt_annot_read(),
gp2 <- ggplot2::ggplot(dat1, ggplot2::aes(x=value, y=severity_score_gpt,
fill=value)) +
ggplot2::geom_boxplot() +
ggplot2::facet_wrap(facets = "variable~.", ncol = 5) +
ggplot2::facet_wrap(facets = stringr::str_wrap(gsub("_"," ",variable),
width = width)~.,
ncol = 5) +
ggplot2::scale_fill_viridis_d(na.value = "grey", direction = -1,
option = "plasma") +
ggplot2::labs(x=NULL) +
Expand Down
3 changes: 3 additions & 0 deletions man/gpt_annot_plot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 71d544b

Please sign in to comment.