diff --git a/DESCRIPTION b/DESCRIPTION index e7110af..5e9792d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: iSEEtree -Version: 1.1.3 +Version: 1.1.4 Authors@R: c(person(given = "Giulio", family = "Benedetti", role = c("aut", "cre"), email = "giulio.benedetti@utu.fi", @@ -12,12 +12,10 @@ Authors@R: comment = c(ORCID = "0000-0001-5537-637X"))) Title: Interactive visualisation for microbiome data Description: - iSEEtree is an extension of iSEE for the TreeSummarizedExperiment. - It leverages the functionality from the miaViz package for microbiome data - visualisation to create panels that are specific for - TreeSummarizedExperiment objects. Not surprisingly, it also depends on the - generic panels from iSEE. -biocViews: Microbiome, Software, Visualization, GUI, ShinyApps, DataImport + iSEEtree is an extension of iSEE for the TreeSummarizedExperiment data + container. It provides interactive panel designs to explore hierarchical + datasets, such as the microbiome and cell lines. +biocViews: Software, Visualization, Microbiome, GUI, ShinyApps, DataImport License: Artistic-2.0 Encoding: UTF-8 Depends: diff --git a/NAMESPACE b/NAMESPACE index e4f6544..cfb9d0c 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -7,6 +7,7 @@ export(AbundancePlot) export(ColumnGraphPlot) export(ColumnTreePlot) export(LoadingPlot) +export(PrevalencePlot) export(RDAPlot) export(RowGraphPlot) export(RowTreePlot) @@ -18,6 +19,7 @@ exportClasses(ColumnGraphPlot) exportClasses(ColumnTreePlot) exportClasses(GraphPlot) exportClasses(LoadingPlot) +exportClasses(PrevalencePlot) exportClasses(RDAPlot) exportClasses(RowGraphPlot) exportClasses(RowTreePlot) @@ -58,9 +60,12 @@ importFrom(methods,is) importFrom(methods,new) importFrom(methods,slot) importFrom(mia,taxonomyRanks) +importFrom(miaViz,plotAbundance) +importFrom(miaViz,plotAbundanceDensity) importFrom(miaViz,plotColGraph) importFrom(miaViz,plotColTree) importFrom(miaViz,plotLoadings) +importFrom(miaViz,plotPrevalence) importFrom(miaViz,plotRowGraph) importFrom(miaViz,plotRowTree) importFrom(miaViz,plotScree) diff --git a/NEWS b/NEWS index 786c777..f728796 100644 --- a/NEWS +++ b/NEWS @@ -17,3 +17,4 @@ Changes in version 1.1.X * Added typical tree operations * Created GraphPlot family * Added ScreePlot panel +* Added PrevalencePlot panel \ No newline at end of file diff --git a/R/AllClasses.R b/R/AllClasses.R index 2714937..f7eac8b 100644 --- a/R/AllClasses.R +++ b/R/AllClasses.R @@ -78,3 +78,9 @@ setClass("AbundanceDensityPlot", contains="Panel", slots=c(layout="character", order_descending="logical", dots_shape="character", dots_shape_by="character")) +#' @rdname PrevalencePlot +#' @export +setClass("PrevalencePlot", contains="Panel", slots=c(detection="numeric", + prevalence="numeric", assay.type="character", rank="character", + include.lowest="logical", show.rank="logical")) + diff --git a/R/class-AbundanceDensityPlot.R b/R/class-AbundanceDensityPlot.R index 3582ba5..74289a8 100644 --- a/R/class-AbundanceDensityPlot.R +++ b/R/class-AbundanceDensityPlot.R @@ -92,10 +92,10 @@ setMethod(".defineDataInterface", "AbundanceDensityPlot", panel_name <- .getEncodedName(x) - list(.selectInput.iSEE(x, field="assay.type", label="Assay type", + list(.selectInput.iSEE(x, field="assay.type", label="Assay type:", choices=assayNames(se), selected=slot(x, "assay.type")), # Number of taxa - .numericInput.iSEE(x, field="n", label="Number of taxa", + .numericInput.iSEE(x, field="n", label="Number of taxa:", value=slot(x, "n"), min=1, max=nrow(se), step=1), .checkboxInput.iSEE(x, field="flipped", label="Switch axes", @@ -130,9 +130,9 @@ setMethod(".createObservers", "AbundanceDensityPlot", callNextMethod() panel_name <- .getEncodedName(x) - .createProtectedParameterObservers(panel_name, - c("layout", "assay.type", "n", "add_legend", "flipped", "order_descending"), - input=input, pObjects=pObjects, rObjects=rObjects) + .createProtectedParameterObservers(panel_name, c("layout", "assay.type", + "n", "add_legend", "flipped", "order_descending"), input=input, + pObjects=pObjects, rObjects=rObjects) .createUnprotectedParameterObservers(panel_name, c("dots_colour", "dots_colour_by", "dots_shape", "dots_shape_by"), @@ -154,7 +154,7 @@ setMethod(".defineOutput", "AbundanceDensityPlot", function(x) { color=.panelColor(x)) }) -#' @importFrom miaViz plotRowTree +#' @importFrom miaViz plotAbundanceDensity setMethod(".generateOutput", "AbundanceDensityPlot", function(x, se, all_memory, all_contents) { diff --git a/R/class-AbundancePlot.R b/R/class-AbundancePlot.R index 6cec5c6..40aeb47 100644 --- a/R/class-AbundancePlot.R +++ b/R/class-AbundancePlot.R @@ -134,7 +134,7 @@ setMethod(".defineOutput", "AbundancePlot", function(x) { height = paste0(slot(x, "PanelHeight"), "px")), color=.panelColor(x)) }) -#' @importFrom miaViz plotRowTree +#' @importFrom miaViz plotAbundance setMethod(".generateOutput", "AbundancePlot", function(x, se, all_memory, all_contents) { @@ -290,7 +290,7 @@ setMethod(".definePanelTour", "AbundancePlot", function(x) { collapseBox(paste0(panel_name, "_Visual"), title="Visual parameters", open=FALSE, # Rank - .selectInput.iSEE(x, field="rank", label="Rank", + .selectInput.iSEE(x, field="rank", label="Rank:", choices=taxonomyRanks(se), selected=slot(x, "rank")), # Colour legend .checkboxInput.iSEE(x, field="add_legend", label="View legend", diff --git a/R/class-PrevalencePlot.R b/R/class-PrevalencePlot.R new file mode 100644 index 0000000..cf268c2 --- /dev/null +++ b/R/class-PrevalencePlot.R @@ -0,0 +1,272 @@ +#' Prevalence plot +#' +#' Prevalence plot of all or agglomerated features in a +#' \code{\link[SummarizedExperiment:SummarizedExperiment-class]{SummarizedExperiment}} +#' object. The panel implements \code{\link[miaViz:plotAbundance]{plotPrevalence}} +#' to generate the plot. +#' +#' @section Slot overview: +#' The following slots control the thresholds used in the visualization: +#' \itemize{ +#' \item \code{detection} \code{Numeric scalar}. Detection threshold between 0 +#' and 1 for absence/presence. (Defualt: \code{0}) +#' +#' \item \code{prevalence} \code{Numeric scalar}. Prevalence threshold between 0 +#' and 1. The required prevalence is strictly greater by default. To +#' include the limit, set \code{include.lowest} to \code{TRUE}. (Default: +#' \code{0}) +#' +#' \item \code{assay.type} \code{Character scalar}. The name of the assay to +#' show. (Default: \code{"relabundance"}) +#' +#' \item \code{rank} \code{Character scalar}. The taxonomic rank to visualise. +#' (Default: \code{NULL}) +#' +#' \item \code{show.rank} \code{Logical scalar}. Should options for the +#' taxonomic rank appear. (Default: \code{FALSE}) +#' +#' \item \code{include.lowest} \code{Logical scalar}. Should features with +#' prevalence equal to \code{prevalence} be included. (Default: \code{FALSE}) +#' } +#' +#' In addition, this class inherits all slots from its parent class +#' \code{\link[iSEE:Panel-class]{Panel}}. +#' +#' @return +#' The \code{PrevalencePlot(...)} constructor creates an instance of an +#' PrevalencePlot class, where any slot and its value can be passed to +#' \code{...} as a named argument. +#' +#' @author Giulio Benedetti +#' @examples +#' # Import TreeSE +#' library(mia) +#' data("Tengeler2020", package = "mia") +#' tse <- Tengeler2020 +#' +#' tse <- transformAssay(tse, +#' assay.type = "counts", +#' method = "relabundance") +#' +#' # Store panel into object +#' panel <- PrevalencePlot() +#' # View some adjustable parameters +#' head(slotNames(panel)) +#' +#' # Launch iSEE with custom initial panel +#' if (interactive()) { +#' iSEE(tse, initial = c(panel)) +#' } +#' +#' @docType methods +#' @name PrevalencePlot +NULL + +#' @importFrom S4Vectors setValidity2 +setValidity2("PrevalencePlot", function(x) { + + msg <- character(0) + msg <- .singleStringError(msg, x, fields=c("assay.type", "rank")) + msg <- .validLogicalError(msg, x, fields=c("include.lowest", "show.rank")) + msg <- .validNumberError(msg, x, "detection", lower=0, upper=1) + msg <- .validNumberError(msg, x, "prevalence", lower=0, upper=1) + + if( length(msg) ){ + return(msg) + } + TRUE +}) + +#' @importFrom methods callNextMethod +setMethod("initialize", "PrevalencePlot", function(.Object, ...) { + args <- list(...) + args <- .emptyDefault(args, "detection", 0) + args <- .emptyDefault(args, "prevalence", 0) + args <- .emptyDefault(args, "include.lowest", FALSE) + args <- .emptyDefault(args, "assay.type", "relabundance") + args <- .emptyDefault(args, "rank", NA_character_) + args <- .emptyDefault(args, "show.rank", FALSE) + + do.call(callNextMethod, c(list(.Object), args)) +}) + +#' @export +#' @importFrom methods new +PrevalencePlot <- function(...) { + new("PrevalencePlot", ...) +} + +#' @importFrom methods slot +#' @importFrom SummarizedExperiment assayNames +#' @importFrom mia taxonomyRanks +setMethod(".defineDataInterface", "PrevalencePlot", function(x, se, select_info) { + panel_name <- .getEncodedName(x) + + list(.selectInput.iSEE(x, field="assay.type", label="Assay type:", + choices=assayNames(se), selected=slot(x, "assay.type")), + .sliderInput.iSEE(x, field="prevalence", label="Prevalence threshold:", + min=0, max=1, step=0.01, value=slot(x, "prevalence")), + .checkboxInput.iSEE(x, field="include.lowest", label="Include lowest", + value=slot(x, "include.lowest")), + .sliderInput.iSEE(x, field="detection", label="Detection threshold:", + min=0, max=1, step=0.01, value=slot(x, "detection")), + .checkboxInput.iSEE(x, field="show.rank", label="Show rank:", + value=slot(x, "show.rank")), + .conditionalOnCheckSolo(paste0(panel_name, "_show.rank"), TRUE, + .selectInput.iSEE(x, field="rank", label="Rank", + choices=taxonomyRanks(se), selected=slot(x, "rank")))) +}) + +#' @importFrom methods callNextMethod +setMethod(".defineInterface", "PrevalencePlot", function(x, se, select_info) { + out <- callNextMethod() + list(out[1], .create_visual_box_for_prev_plot(x, se), out[-1]) +}) + +setMethod(".createObservers", "PrevalencePlot", + function(x, se, input, session, pObjects, rObjects) { + + callNextMethod() + panel_name <- .getEncodedName(x) + + .createProtectedParameterObservers(panel_name, c("assay.type", "prevalence", + "detection", "include.lowest", "rank"), input=input, pObjects=pObjects, + rObjects=rObjects) + + .createUnprotectedParameterObservers(panel_name, c("show.rank"), + input=input, pObjects=pObjects, rObjects=rObjects) + + invisible(NULL) +}) + +setMethod(".fullName", "PrevalencePlot", function(x) "Prevalence plot") +setMethod(".panelColor", "PrevalencePlot", function(x) "grey") + +#' @importFrom shiny plotOutput +#' @importFrom shinyWidgets addSpinner +setMethod(".defineOutput", "PrevalencePlot", function(x) { + panel_name <- .getEncodedName(x) + + addSpinner(plotOutput(panel_name, + height = paste0(slot(x, "PanelHeight"), "px")), color=.panelColor(x)) +}) + +#' @importFrom miaViz plotPrevalence +setMethod(".generateOutput", "PrevalencePlot", + function(x, se, all_memory, all_contents) { + + panel_env <- new.env() + all_cmds <- list() + args <- character(0) + + all_cmds[["select"]] <- .processMultiSelections( + x, all_memory, all_contents, panel_env + ) + + if( exists("row_selected", envir=panel_env, inherits=FALSE) ){ + panel_env[["se"]] <- se[ , unlist(panel_env[["row_selected"]])] + } else { + panel_env[["se"]] <- se + } + + args[["assay.type"]] <- deparse(slot(x, "assay.type")) + args[["prevalence"]] <- deparse(seq(slot(x, "prevalence"), 1, by = 0.1)) + args[["detection"]] <- deparse(seq(slot(x, "detection"), 1, by = 0.1)) + args[["include.lowest"]] <- deparse(slot(x, "include.lowest")) + + if( slot(x, "show.rank") ){ + args[["rank"]] <- deparse(slot(x, "rank")) + } + + args <- sprintf("%s=%s", names(args), args) + args <- paste(args, collapse=", ") + fun_call <- sprintf("p <- miaViz::plotPrevalence(se, %s)", args) + + fun_cmd <- paste(strwrap(fun_call, width = 80, exdent = 4), collapse = "\n") + plot_out <- .textEval(fun_cmd, panel_env) + all_cmds[["fun"]] <- fun_cmd + + list(commands=all_cmds, plot=plot_out, varname=NULL, contents=NULL) +}) + +#' @importFrom shiny renderPlot +#' @importFrom methods callNextMethod +setMethod(".renderOutput", "PrevalencePlot", + function(x, se, output, pObjects, rObjects) { + + panel_name <- .getEncodedName(x) + force(se) # defensive programming to avoid bugs due to delayed evaluation + + output[[panel_name]] <- renderPlot({ + .retrieveOutput(panel_name, se, pObjects, rObjects) + }) + + callNextMethod() +}) + +#' @importFrom grDevices pdf dev.off +setMethod(".exportOutput", "PrevalencePlot", + function(x, se, all_memory, all_contents) { + + contents <- .generateOutput(x, se, all_memory=all_memory, + all_contents=all_contents) + + newpath <- paste0(.getEncodedName(x), ".pdf") + + pdf(newpath, width=slot(x, "PanelHeight") / 75, + height=slot(x, "PanelWidth") * 2) + + print(contents$plot) + dev.off() + + newpath +}) + +#' @importFrom methods callNextMethod +setMethod(".hideInterface", "PrevalencePlot", function(x, field) { + if( field %in% c("SelectionHistory", "ColumnSelectionRestrict", + "ColumnSelectionDynamicSource", "ColumnSelectionSource") ){ + TRUE + } else { + callNextMethod() + } +}) + +setMethod(".multiSelectionResponsive", "PrevalencePlot", + function(x, dim = character(0)) { + + if( "row" %in% dim ){ + return(TRUE) + } + return(FALSE) +}) + +#' @importFrom methods callNextMethod +setMethod(".definePanelTour", "PrevalencePlot", function(x) { + rbind(c(paste0("#", .getEncodedName(x)), sprintf( + "The Prevalence Plot panel + contains a representation of the relative abundance + for each taxonomic rank. Each column corresponds to + a sample of the SummarizedExperiment + object.", .getPanelColor(x))), + .addTourStep(x, "DataBoxOpen", "The Data parameters box shows the + available parameters that can be tweaked to control the data on + the plot.

Action: click on this + box to open up available options."), + .addTourStep(x, "Visual", "The Visual parameters box shows + the available visual parameters that can be tweaked in this + plot.

Action: click on this box to + open up available options."), + callNextMethod()) +}) + +#' @importFrom methods slot +#' @importFrom mia taxonomyRanks +#' @importFrom SummarizedExperiment rowData +.create_visual_box_for_prev_plot <- function(x, se) { + panel_name <- .getEncodedName(x) + + # Define what parameters the user can adjust + collapseBox(paste0(panel_name, "_Visual"), + title="Visual parameters", open=FALSE) +} \ No newline at end of file diff --git a/R/class-RDAPlot.R b/R/class-RDAPlot.R index 1853cdf..2698a2d 100644 --- a/R/class-RDAPlot.R +++ b/R/class-RDAPlot.R @@ -45,7 +45,7 @@ #' tse <- enterotype #' #' # Run RDA and store results into TreeSE -#' tse <- runRDA(tse, +#' tse <- addRDA(tse, assay.type = "counts", #' formula = assay ~ ClinicalStatus + Gender + Age, #' FUN = vegan::vegdist, #' distance = "bray", @@ -69,10 +69,10 @@ NULL setValidity2("RDAPlot", function(x) { msg <- character(0) - msg <- .singleStringError(msg, x, fields=c("dimred", "colour_by", "vec.colour", - "label.colour")) + msg <- .singleStringError(msg, x, fields=c("dimred", "colour_by", + "vec.colour", "label.colour")) msg <- .validLogicalError(msg, x, fields=c("vec.text", "add.vectors", - "add.significance", "add.expl.var")) + "add.significance", "add.expl.var")) msg <- .validNumberError(msg, x, "ellipse.alpha", lower=0, upper=1) msg <- .validNumberError(msg, x, "confidence.level", lower=0, upper=1) msg <- .validNumberError(msg, x, "ellipse.linewidth", lower=0, upper=1) @@ -82,11 +82,9 @@ setValidity2("RDAPlot", function(x) { msg <- .validNumberError(msg, x, "arrow.size", lower=0, upper=1) msg <- .validNumberError(msg, x, "label.size", lower=0, upper=10) - if( length(msg) ){ return(msg) } - TRUE }) diff --git a/README.md b/README.md index 6a4c3df..3b46a15 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,12 @@ [![codecov](https://codecov.io/gh/microbiome/iSEEtree/branch/devel/graph/badge.svg)](https://app.codecov.io/gh/microbiome/iSEEtree?branch=devel) [![codefactor](https://www.codefactor.io/repository/github/microbiome/iseetree/badge)](https://www.codefactor.io/repository/github/microbiome/iseetree) -The goal of iSEEtree is to provide panels related to TreeSummarizedExperiment -objects which facilitate the interactive visualisation of microbiome data in -[_iSEE_](https://isee.github.io/). +The goal of iSEEtree is to provide panel designs to explore hierarchical data +stored in TreeSummarizedExperiment objects. This enables the interactive +visualisation of microbiome data, cell lines and more. ## Installation instructions + The release version of iSEEtree can be installed from Bioconductor as follows: ``` @@ -34,6 +35,7 @@ BiocManager::install("iSEEtree") ``` ## Example + The basic functionality of iSEEtree can be explored as follows: ``` @@ -66,26 +68,12 @@ contributor guidelines of the miaverse [here](https://github.com/microbiome/mia/blob/devel/CONTRIBUTING.md). ## Acknowledgements -Please note that iSEEtree was only made possible thanks to many other R and -bioinformatics software authors, which are cited either in the vignettes and/or -the paper(s) describing this package. In particular, iSEEtree implements the [_miaViz_](https://microbiome.github.io/miaViz/) package for microbiome data -visualisation to create panels that are specific for TreeSummarizedExperiment -objects. Not surprisingly, it also depends on the generic panels from iSEE. - -This package was developed using the following resources: - -- [_usethis_](https://cran.r-project.org/web/packages/usethis/) to generate an - initial template. -- Continuous code testing is performed on - [GitHub actions](https://github.com/features/actions) and include R CMD check, - [_BiocCheck_](https://bioconductor.org/packages/3.16/bioc/html/BiocCheck.html) - and testthat. -- Code coverage assessment is possible thanks to - [codecov](https://app.codecov.io/gh/). -- The documentation website is automatically updated thanks to - [_pkgdown_](https://cran.r-project.org/web/packages/pkgdown/). -- The documentation is formatted thanks to - [_devtools_](https://cran.r-project.org/web/packages/devtools/) and - [_roxygen2_](https://cran.r-project.org/web/packages/roxygen2/). -- All the actions above are made reproducible by - [_rworkflows_](https://neurogenomics.github.io/rworkflows/) \ No newline at end of file + +iSEEtree originates from the joint effort of the R/Bioconductor community. It is +mainly based on the following software: + +- [R](https://www.r-project.org/), statistical programming language [@core2024r] +- [mia](https://bioconductor.org/packages/release/bioc/html/mia.html), framework for microbiome data analysis [@borman2024mia] +- [iSEE](https://bioconductor.org/packages/release/bioc/html/iSEE.html), SummarizedExperiment interactive explorer [@rue2018isee] +- [TreeSummarizedExperiment](https://bioconductor.org/packages/release/bioc/html/TreeSummarizedExperiment.htmlm), S4 container for hierarchical data [@huang2021treesummarizedexperiment] +- [shiny](https://cran.r-project.org/web/packages/shiny/index.html), web app development in R [@chang2024shiny] diff --git a/man/PrevalencePlot.Rd b/man/PrevalencePlot.Rd new file mode 100644 index 0000000..91e602f --- /dev/null +++ b/man/PrevalencePlot.Rd @@ -0,0 +1,71 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/AllClasses.R, R/class-PrevalencePlot.R +\docType{class} +\name{PrevalencePlot-class} +\alias{PrevalencePlot-class} +\alias{PrevalencePlot} +\title{Prevalence plot} +\value{ +The \code{PrevalencePlot(...)} constructor creates an instance of an +PrevalencePlot class, where any slot and its value can be passed to +\code{...} as a named argument. +} +\description{ +Prevalence plot of all or agglomerated features in a +\code{\link[SummarizedExperiment:SummarizedExperiment-class]{SummarizedExperiment}} +object. The panel implements \code{\link[miaViz:plotAbundance]{plotPrevalence}} +to generate the plot. +} +\section{Slot overview}{ + +The following slots control the thresholds used in the visualization: +\itemize{ +\item \code{detection} \code{Numeric scalar}. Detection threshold between 0 +and 1 for absence/presence. (Defualt: \code{0}) + +\item \code{prevalence} \code{Numeric scalar}. Prevalence threshold between 0 +and 1. The required prevalence is strictly greater by default. To +include the limit, set \code{include.lowest} to \code{TRUE}. (Default: +\code{0}) + +\item \code{assay.type} \code{Character scalar}. The name of the assay to +show. (Default: \code{"relabundance"}) + +\item \code{rank} \code{Character scalar}. The taxonomic rank to visualise. +(Default: \code{NULL}) + +\item \code{show.rank} \code{Logical scalar}. Should options for the +taxonomic rank appear. (Default: \code{FALSE}) + +\item \code{include.lowest} \code{Logical scalar}. Should features with +prevalence equal to \code{prevalence} be included. (Default: \code{FALSE}) +} + +In addition, this class inherits all slots from its parent class +\code{\link[iSEE:Panel-class]{Panel}}. +} + +\examples{ +# Import TreeSE +library(mia) +data("Tengeler2020", package = "mia") +tse <- Tengeler2020 + +tse <- transformAssay(tse, + assay.type = "counts", + method = "relabundance") + +# Store panel into object +panel <- PrevalencePlot() +# View some adjustable parameters +head(slotNames(panel)) + +# Launch iSEE with custom initial panel +if (interactive()) { + iSEE(tse, initial = c(panel)) +} + +} +\author{ +Giulio Benedetti +} diff --git a/man/RDAPlot.Rd b/man/RDAPlot.Rd index daf9dbb..4265e6d 100644 --- a/man/RDAPlot.Rd +++ b/man/RDAPlot.Rd @@ -52,7 +52,7 @@ data("enterotype", package = "mia") tse <- enterotype # Run RDA and store results into TreeSE -tse <- runRDA(tse, +tse <- addRDA(tse, assay.type = "counts", formula = assay ~ ClinicalStatus + Gender + Age, FUN = vegan::vegdist, distance = "bray", diff --git a/pkgdown/_pkgdown.yml b/pkgdown/_pkgdown.yml index b29625b..e160bad 100644 --- a/pkgdown/_pkgdown.yml +++ b/pkgdown/_pkgdown.yml @@ -5,7 +5,7 @@ reference: - contents: - AbundancePlot - AbundanceDensityPlot - # - PrevalencePlot + - PrevalencePlot - subtitle: Ordination analysis - contents: - RDAPlot diff --git a/tests/testthat/test-RDAPlot.R b/tests/testthat/test-RDAPlot.R index b062a31..ed0aa76 100644 --- a/tests/testthat/test-RDAPlot.R +++ b/tests/testthat/test-RDAPlot.R @@ -10,7 +10,7 @@ test_that("RDAPlot", { tse <- enterotype panel <- RDAPlot() - tse <- mia::runRDA(tse, + tse <- mia::runRDA(tse, assay.type = "counts", formula = assay ~ ClinicalStatus + Gender + Age, na.action = na.exclude) diff --git a/vignettes/panels.Rmd b/vignettes/panels.Rmd index dbdf381..4627eb0 100644 --- a/vignettes/panels.Rmd +++ b/vignettes/panels.Rmd @@ -50,7 +50,7 @@ the app. This catalogue is divided into four sections: # Compositional Analysis {#sec-composition} -| Panel name | Panel class | Purpose | +| Panel name | Panel class | Information | |------------------------|----------------------|-------------------------------------| | Abundance plot | AbundancePlot | Feature abundance by sample | | Abundance density plot | AbundanceDensityPlot | Feature distribution across samples | @@ -93,7 +93,19 @@ SCREENSHOT("screenshots/AbundanceDensityPlot.png", delay=20) ## Prevalence plot -Coming soon! +The Prevalence plot provides an way to visualise feature prevalence across +samples. In this panel, each line represents the feature abundance across the +samples and prevalence is encoded by the colour. It is based on the miaViz +function plotPrevalence. + +Supported operations: + +- adjusting prevalence and detection thresholds +- selecting the taxonomic rank to show + +```{r prevalence_plot, echo=FALSE, out.width="60%"} +SCREENSHOT("screenshots/PrevalencePlot.png", delay=20) +``` ## Feature assay plot @@ -117,7 +129,7 @@ See its image in the iSEE panel catalogue: # Ordination Analysis {#sec-ordination} -| Panel name | Panel class | Purpose | +| Panel name | Panel class | Information | |------------------------|----------------------|---------------------------------| | RDA plot | RDAPlot | Supervised ordination | | Scree plot | ScreePlot | Explained variance by component | @@ -185,7 +197,7 @@ See its image in the iSEE panel catalogue: # Structural Analysis {#sec-structure} -| Panel name | Panel class | Purpose | +| Panel name | Panel class | Information | |--------------------|------------------|------------------------------------| | Row tree plot | RowTreePlot | Hierarchical structure of features | | Column tree plot | ColumnTreePlot | Hierarchical structure of samples | diff --git a/vignettes/screenshots/PrevalencePlot.png b/vignettes/screenshots/PrevalencePlot.png new file mode 100644 index 0000000..f18425f Binary files /dev/null and b/vignettes/screenshots/PrevalencePlot.png differ