Skip to content
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: miaViz
Title: Microbiome Analysis Plotting and Visualization
Version: 1.21.1
Version: 1.21.2
Authors@R:
c(person(given = "Tuomas", family = "Borman", role = c("aut", "cre"),
email = "tuomas.v.borman@utu.fi",
Expand Down Expand Up @@ -31,7 +31,7 @@ License: Artistic-2.0 | file LICENSE
Encoding: UTF-8
LazyData: false
Depends:
R (>= 4.0),
R (>= 4.1),
ggplot2,
ggraph (>= 2.0),
mia (>= 1.13.0),
Expand All @@ -47,6 +47,7 @@ Imports:
ggnewscale,
ggrepel,
ggtree,
grid,
methods,
patchwork,
rlang,
Expand Down
11 changes: 8 additions & 3 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ export(plotDMNFit)
export(plotFeaturePrevalence)
export(plotForest)
export(plotHistogram)
export(plotJointRPCA)
export(plotLoadings)
export(plotMediation)
export(plotNMDS)
export(plotOrdination)
export(plotPrevalence)
export(plotPrevalentAbundance)
export(plotRDA)
Expand All @@ -39,8 +41,10 @@ exportMethods(plotDMNFit)
exportMethods(plotFeaturePrevalence)
exportMethods(plotForest)
exportMethods(plotHistogram)
exportMethods(plotJointRPCA)
exportMethods(plotLoadings)
exportMethods(plotMediation)
exportMethods(plotOrdination)
exportMethods(plotPrevalence)
exportMethods(plotPrevalentAbundance)
exportMethods(plotRDA)
Expand Down Expand Up @@ -80,6 +84,7 @@ importFrom(SummarizedExperiment,colData)
importFrom(SummarizedExperiment,rowData)
importFrom(TreeSummarizedExperiment,colTree)
importFrom(TreeSummarizedExperiment,colTreeNames)
importFrom(TreeSummarizedExperiment,rowLinks)
importFrom(TreeSummarizedExperiment,rowTree)
importFrom(TreeSummarizedExperiment,rowTreeNames)
importFrom(ape,as.phylo)
Expand All @@ -106,6 +111,7 @@ importFrom(dplyr,rename)
importFrom(dplyr,rename_with)
importFrom(dplyr,row_number)
importFrom(dplyr,select)
importFrom(dplyr,slice_max)
importFrom(dplyr,summarise)
importFrom(dplyr,summarize)
importFrom(dplyr,ungroup)
Expand Down Expand Up @@ -147,8 +153,6 @@ importFrom(ggplot2,scale_y_discrete)
importFrom(ggplot2,theme)
importFrom(ggplot2,theme_bw)
importFrom(ggplot2,theme_classic)
importFrom(ggplot2,xlab)
importFrom(ggplot2,ylab)
importFrom(ggrepel,geom_label_repel)
importFrom(ggrepel,geom_text_repel)
importFrom(ggtree,geom_cladelab)
Expand All @@ -162,6 +166,8 @@ importFrom(ggtree,ggtree)
importFrom(ggtree,gheatmap)
importFrom(ggtree,groupOTU)
importFrom(ggtree,theme_tree)
importFrom(grid,arrow)
importFrom(grid,unit)
importFrom(mia,meltSE)
importFrom(patchwork,plot_layout)
importFrom(patchwork,wrap_plots)
Expand All @@ -170,7 +176,6 @@ importFrom(rlang,":=")
importFrom(rlang,sym)
importFrom(scales,pretty_breaks)
importFrom(scales,rescale)
importFrom(scater,plotReducedDim)
importFrom(scater,retrieveCellInfo)
importFrom(scater,retrieveFeatureInfo)
importFrom(stats,formula)
Expand Down
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,6 @@ Changes in version 1.17.x
Changes in version 1.19.x
+ plotRDA: Now plotting works with interaction term (2025-11-09)
+ plotBoxplot: Added option to add p-values (2026-01-07)

Changes in version 1.21.x
+ Added plotOrdination and plotJointRPCA (2026-08-04)
10 changes: 10 additions & 0 deletions R/AllGenerics.R
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,13 @@ setGeneric("plotBarplot", signature = c("x"), function(x, ...)
#' @export
setGeneric("plotBoxplot", signature = c("object"), function(object, ...)
standardGeneric("plotBoxplot"))

#' @rdname plotOrdination
#' @export
setGeneric("plotOrdination", signature = c("x"), function(x, ...)
standardGeneric("plotOrdination"))

#' @rdname plotJointRPCA
#' @export
setGeneric("plotJointRPCA", signature = c("x"), function(x, ...)
standardGeneric("plotJointRPCA"))
25 changes: 22 additions & 3 deletions R/plotBoxplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -1106,14 +1106,16 @@ setMethod("plotBoxplot", signature = c(object = "SummarizedExperiment"),

# This function adds points to plot
.add_points_layer <- function(
p, df, point.alpha = 0.65, point.size = 2, point.shape = 19L,
p, df,
x = NULL, y = NULL,
point.alpha = 0.65, point.size = 2, point.shape = 19L,
point.colour = point.color, point.color = "grey70", ...){
# To disable "no visible binding for global variable" message in cmdcheck
x_point <- y_point <- NULL
args <- list(
mapping = aes(
x = x_point,
y = y_point,
x = if(!is.null(x)) .data[[x]] else x_point,
y = if(!is.null(y)) .data[[y]] else y_point,
colour = if(!is.null(attributes(df)[["colour.by"]]))
.data[[attributes(df)[["colour.by"]]]],
shape = if(!is.null(attributes(df)[["shape.by"]]))
Expand Down Expand Up @@ -1332,5 +1334,22 @@ setMethod("plotBoxplot", signature = c(object = "SummarizedExperiment"),
if( !is.null(attributes(df)[["size.by"]]) ){
p <- p + labs(shape = attributes(df)[["size.by"]])
}

# Adjust colors
if( !is.null(attributes(df)[["colour.by"]]) ){
name <- attributes(df)[["colour.by"]]
vals <- df[[name]]
p <- .resolve_plot_colours(
p, vals, name,
)
}
if( !is.null(attributes(df)[["fill.by"]]) ){
name <- attributes(df)[["fill.by"]]
vals <- df[[name]]
p <- .resolve_plot_colours(
p, vals, name, fill = TRUE
)
}

return(p)
}
Loading
Loading