Skip to content

Commit

Permalink
plotAbundanceDensity: added boxplot and violin (#143)
Browse files Browse the repository at this point in the history
Signed-off-by: Daena Rys <[email protected]>
  • Loading branch information
Daenarys8 authored Aug 12, 2024
1 parent 5ba5e7c commit 102c876
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
15 changes: 14 additions & 1 deletion R/plotAbundanceDensity.R
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@
#'
#' @author Leo Lahti and Tuomas Borman. Contact: \url{microbiome.github.io}
#'
#' @seealso
#' \code{\link[scater:plotExpression]{scater::plotExpression}}
#'
#' @examples
#' data("peerj13075", package = "mia")
#' tse <- peerj13075
Expand Down Expand Up @@ -127,6 +130,16 @@
#' # to your wishes
#' plotAbundanceDensity(
#' tse, assay.type = "relabundance", decreasing = NA)
#'
#' # Box plots and violin plots are supported by scater::plotExpression.
#' # Plots the relative abundance of 5 most abundant taxa as a violin plot.
#' library(scater)
#' top <- getTop(tse, top = 5)
#' plotExpression(tse, features = top, assay.type = "relabundance") + ggplot2::coord_flip()
#'
#' # Plots the relative abundance of 5 most abundant taxa as a box plot.
#' plotExpression(tse, features = top, assay.type = "relabundance",
#' show_violin = FALSE, show_box = TRUE) + ggplot2::coord_flip()
#'
NULL

Expand Down Expand Up @@ -388,4 +401,4 @@ setMethod("plotAbundanceDensity", signature = c(x = "SummarizedExperiment"),
add_x_text = TRUE,
angle_x_text = angle_x_text)
return(plot_out)
}
}
13 changes: 13 additions & 0 deletions man/plotAbundanceDensity.Rd

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

0 comments on commit 102c876

Please sign in to comment.