From cd835ce84372ee1edce08cdd6685abb5d051ebb5 Mon Sep 17 00:00:00 2001 From: Giulio Benedetti Date: Thu, 27 Mar 2025 10:18:05 +0200 Subject: [PATCH 1/4] Update iSEEtree compat requirements --- DESCRIPTION | 4 ++-- R/miaDash.R | 3 +-- pkgdown/_pkgdown.yml | 3 ++- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index e4c8b23..3ef383c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: miaDash -Version: 0.99.9 +Version: 0.99.10 Authors@R: c(person(given = "Giulio", family = "Benedetti", role = c("aut", "cre"), email = "giulio.benedetti@utu.fi", @@ -27,7 +27,7 @@ Imports: ape, biomformat, htmltools, - iSEEtree, + iSEEtree (>= 1.1.4), mia, rintrojs, scater, diff --git a/R/miaDash.R b/R/miaDash.R index c803750..b08f707 100644 --- a/R/miaDash.R +++ b/R/miaDash.R @@ -34,8 +34,7 @@ miaDash <- function() { paste0("Microbiome Analysis Dashboard - v", packageVersion("miaDash")), tags$img(src = "assets/mia_logo.png", height = "40px", style = "margin-left: 10px"), style = "cursor: pointer; font-weight: 500", - onclick = "window.location='https://miadash-microbiome.2.rahtiapp.fi/'") - + onclick = "window.location='https://miadash-microbiome.2.rahtiapp.fi/'") ) } diff --git a/pkgdown/_pkgdown.yml b/pkgdown/_pkgdown.yml index d9346eb..83238e9 100644 --- a/pkgdown/_pkgdown.yml +++ b/pkgdown/_pkgdown.yml @@ -3,4 +3,5 @@ reference: - title: App - contents: - miaDash - - constants \ No newline at end of file + - constants + - utils \ No newline at end of file From 4871221abfdddf54c71aa5593ce0d968239a3656 Mon Sep 17 00:00:00 2001 From: Giulio Benedetti Date: Thu, 27 Mar 2025 11:23:04 +0200 Subject: [PATCH 2/4] Add more constants --- DESCRIPTION | 1 + R/constants.R | 34 ++++++++++++++++++++++++++++++---- R/landing_page.R | 16 ++++++++-------- R/observers.R | 11 ----------- man/constants.Rd | 26 +++++++++++++++++++++++++- pkgdown/_pkgdown.yml | 7 +++++-- 6 files changed, 69 insertions(+), 26 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 3ef383c..067fa85 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -29,6 +29,7 @@ Imports: htmltools, iSEEtree (>= 1.1.4), mia, + philr, rintrojs, scater, shinydashboard, diff --git a/R/constants.R b/R/constants.R index 0c04442..be6b83a 100644 --- a/R/constants.R +++ b/R/constants.R @@ -1,19 +1,23 @@ #' Constants #' -#' Constant values used throughout miaDash panels and extensions. +#' Constant values used throughout the miaDash app. #' #' @section Panel layout: #' \describe{ #' \item{\code{.miaDashDefaultPanels}}{List of panel names in the default layout of miaDash.} #' \item{\code{.miaDashOtherPanels}}{List of panel names not in the default layout of miaDash.} +#' \item{\code{.transformMethods}}{List of transformations applicable to assays.} +#' \item{\code{.alphaMetrics}}{List of alpha diversity metrics.} +#' \item{\code{.betaMetrics}}{List of beta diversity metrics.} +#' \item{\code{.betaMethods}}{List of beta diversity methods.} #' } #' #' @author Giulio Benedetti #' #' @keywords internal #' @name constants -#' @aliases .miaDashDefaultPanels -#' .miaDashOtherPanels +#' @aliases .miaDashDefaultPanels .miaDashOtherPanels .transformMethods +#' .alphaMetrics .betaMetrics .betaMethods NULL #' @rdname constants @@ -24,4 +28,26 @@ NULL #' @rdname constants .miaDashOtherPanels <- c("PrevalencePlot", "RDAPlot", "ScreePlot", "LoadingPlot", "ColumnTreePlot", "RowGraphPlot", "ColumnGraphPlot", - "RowDataPlot", "ColumnDataPlot") \ No newline at end of file + "RowDataPlot", "ColumnDataPlot") + +#' @rdname constants +.transformMethods <- c("alr", "chi.square", "clr", "css", "frequency", + "hellinger", "log", "log10", "log2", "max", "normalize", "pa", "philr", + "range", "rank", "rclr", "relabundance", "rrank", "standardize", "total") + +#' @rdname constants +.alphaMetrics <- c("coverage_diversity", "fisher_diversity", "faith_diversity", + "gini_simpson_diversity", "inverse_simpson_diversity", + "log_modulo_skewness_diversity", "shannon_diversity", "absolute_dominance", + "dbp_dominance", "core_abundance_dominance", "gini_dominance", + "dmn_dominance", "relative_dominance", "simpson_lambda_dominance", + "camargo_evenness", "pielou_evenness", "simpson_evenness", "evar_evenness", + "bulla_evenness", "ace_richness", "chao1_richness", "hill_richness", + "observed_richness") + +#' @rdname constants +.betaMetrics <- c("euclidean", "bray", "jaccard", "unifrac") + +#' @rdname constants +.betaMethods <- c("MDS", "NMDS", "PCA", "RDA") +#"TSNE", "UMAP") \ No newline at end of file diff --git a/R/landing_page.R b/R/landing_page.R index 17ed6c9..02eaf71 100644 --- a/R/landing_page.R +++ b/R/landing_page.R @@ -141,8 +141,7 @@ label = "Assay:", choices = NULL), selectInput(inputId = "trans.method", - label = "Method:", choices = c("relabundance", - "clr", "standardize")), + label = "Method:", choices = .transformMethods), checkboxInput(inputId = "pseudocount", label = "Pseudocount"), @@ -168,20 +167,21 @@ selectInput(inputId = "alpha.index", label = "Metric:", multiple = TRUE, - choices = c("coverage", "shannon", "faith"))), + choices = .alphaMetrics)), tabPanel(title = "Beta", value = "beta", - radioButtons(inputId = "bmethod", label = "Method:", - choices = c("MDS", "NMDS", "PCA", "RDA"), + radioButtons(inputId = "bmethod", + label = "Method:", choices = .betaMethods, inline = TRUE), conditionalPanel( - condition = "input.bmethod != 'PCA'", + condition = paste("input.bmethod == 'MDS' || ", + "input.bmethod == 'NMDS' || ", + "input.bmethod == 'RDA'"), selectInput(inputId = "beta.index", - label = "Metric:", choices = c("euclidean", - "bray", "jaccard", "unifrac"))), + label = "Metric:", choices = .betaMetrics)), conditionalPanel( condition = "input.bmethod == 'RDA'", diff --git a/R/observers.R b/R/observers.R index d69116c..af90cfc 100644 --- a/R/observers.R +++ b/R/observers.R @@ -152,17 +152,6 @@ }) } else if( input$manipulate == "transform" ){ - - if( input$trans.method == "clr" && !input$pseudocount && - any(assay(rObjects$tse, input$assay.type) <= 0)){ - - .print_message( - "'clr' cannot be used with non-positive data:", - "please turn on pseudocount." - ) - - return() - } isolate({ req(input$assay.type) diff --git a/man/constants.Rd b/man/constants.Rd index 4a1dea4..9cb52de 100644 --- a/man/constants.Rd +++ b/man/constants.Rd @@ -5,25 +5,49 @@ \alias{constants} \alias{.miaDashDefaultPanels} \alias{.miaDashOtherPanels} +\alias{.transformMethods} +\alias{.alphaMetrics} +\alias{.betaMetrics} +\alias{.betaMethods} \title{Constants} \format{ An object of class \code{character} of length 7. An object of class \code{character} of length 9. + +An object of class \code{character} of length 20. + +An object of class \code{character} of length 23. + +An object of class \code{character} of length 4. + +An object of class \code{character} of length 4. } \usage{ .miaDashDefaultPanels .miaDashOtherPanels + +.transformMethods + +.alphaMetrics + +.betaMetrics + +.betaMethods } \description{ -Constant values used throughout miaDash panels and extensions. +Constant values used throughout the miaDash app. } \section{Panel layout}{ \describe{ \item{\code{.miaDashDefaultPanels}}{List of panel names in the default layout of miaDash.} \item{\code{.miaDashOtherPanels}}{List of panel names not in the default layout of miaDash.} +\item{\code{.transformMethods}}{List of transformations applicable to assays.} +\item{\code{.alphaMetrics}}{List of alpha diversity metrics.} +\item{\code{.betaMetrics}}{List of beta diversity metrics.} +\item{\code{.betaMethods}}{List of beta diversity methods.} } } diff --git a/pkgdown/_pkgdown.yml b/pkgdown/_pkgdown.yml index 83238e9..9e1b0f6 100644 --- a/pkgdown/_pkgdown.yml +++ b/pkgdown/_pkgdown.yml @@ -1,7 +1,10 @@ destination: docs reference: - title: App +- subtitle: Main - contents: - miaDash - - constants - - utils \ No newline at end of file +- subtitle: Other +- contents: + - utils + - constants \ No newline at end of file From e5d353bdd6d4ba6f85ae7b26c608726b1c5dcb2f Mon Sep 17 00:00:00 2001 From: Giulio Benedetti Date: Thu, 27 Mar 2025 11:30:24 +0200 Subject: [PATCH 3/4] Add philr to Suggests --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 067fa85..854f472 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -29,7 +29,6 @@ Imports: htmltools, iSEEtree (>= 1.1.4), mia, - philr, rintrojs, scater, shinydashboard, @@ -43,6 +42,7 @@ Imports: Suggests: BiocStyle, knitr, + philr, remotes, rmarkdown, testthat (>= 3.0.0) From 439be2e755cc0e1795db4c8b5e34e22bd9dfbdce Mon Sep 17 00:00:00 2001 From: Giulio Benedetti Date: Thu, 27 Mar 2025 11:42:54 +0200 Subject: [PATCH 4/4] philr fix --- DESCRIPTION | 2 +- R/constants.R | 2 +- R/observers.R | 5 +++++ man/constants.Rd | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 854f472..23508ca 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: miaDash -Version: 0.99.10 +Version: 0.99.11 Authors@R: c(person(given = "Giulio", family = "Benedetti", role = c("aut", "cre"), email = "giulio.benedetti@utu.fi", diff --git a/R/constants.R b/R/constants.R index be6b83a..28014b5 100644 --- a/R/constants.R +++ b/R/constants.R @@ -32,7 +32,7 @@ NULL #' @rdname constants .transformMethods <- c("alr", "chi.square", "clr", "css", "frequency", - "hellinger", "log", "log10", "log2", "max", "normalize", "pa", "philr", + "hellinger", "log", "log10", "log2", "max", "normalize", "pa",# "philr", "range", "rank", "rclr", "relabundance", "rrank", "standardize", "total") #' @rdname constants diff --git a/R/observers.R b/R/observers.R index af90cfc..0eadd66 100644 --- a/R/observers.R +++ b/R/observers.R @@ -166,6 +166,11 @@ method = input$trans.method, assay.type = input$assay.type, MARGIN = input$margin, pseudocount = input$pseudocount) + #if( input$trans.method == "philr" ){ + # fun_args <- c(fun_args, tree = list(rowTree(rObjects$tse)), + # node.labels = rowTree(tse)$node.label) + #} + rObjects$tse <- .update_tse( rObjects$tse, transformAssay, fun_args ) diff --git a/man/constants.Rd b/man/constants.Rd index 9cb52de..1a128d4 100644 --- a/man/constants.Rd +++ b/man/constants.Rd @@ -15,7 +15,7 @@ An object of class \code{character} of length 7. An object of class \code{character} of length 9. -An object of class \code{character} of length 20. +An object of class \code{character} of length 19. An object of class \code{character} of length 23.