Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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,5 +1,5 @@
Package: miaDash
Version: 0.99.9
Version: 0.99.11
Authors@R:
c(person(given = "Giulio", family = "Benedetti", role = c("aut", "cre"),
email = "[email protected]",
Expand Down Expand Up @@ -27,7 +27,7 @@ Imports:
ape,
biomformat,
htmltools,
iSEEtree,
iSEEtree (>= 1.1.4),
mia,
rintrojs,
scater,
Expand All @@ -42,6 +42,7 @@ Imports:
Suggests:
BiocStyle,
knitr,
philr,
remotes,
rmarkdown,
testthat (>= 3.0.0)
Expand Down
34 changes: 30 additions & 4 deletions R/constants.R
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -24,4 +28,26 @@ NULL
#' @rdname constants
.miaDashOtherPanels <- c("PrevalencePlot", "RDAPlot", "ScreePlot",
"LoadingPlot", "ColumnTreePlot", "RowGraphPlot", "ColumnGraphPlot",
"RowDataPlot", "ColumnDataPlot")
"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")
16 changes: 8 additions & 8 deletions R/landing_page.R
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand All @@ -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'",
Expand Down
3 changes: 1 addition & 2 deletions R/miaDash.R
Original file line number Diff line number Diff line change
Expand Up @@ -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/'")
)
}

Expand Down
16 changes: 5 additions & 11 deletions R/observers.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -177,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
)
Expand Down
26 changes: 25 additions & 1 deletion man/constants.Rd

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

4 changes: 4 additions & 0 deletions pkgdown/_pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
destination: docs
reference:
- title: App
- subtitle: Main
- contents:
- miaDash
- subtitle: Other
- contents:
- utils
- constants
Loading