Skip to content

Commit

Permalink
Add htmltools to deps
Browse files Browse the repository at this point in the history
  • Loading branch information
RiboRings committed Nov 29, 2024
1 parent a19843e commit 12f17ce
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 91 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Depends:
iSEE
Imports:
biomformat,
htmltools,
iSEEtree,
methods,
mia,
Expand Down
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ importFrom(TreeSummarizedExperiment,colLinks)
importFrom(TreeSummarizedExperiment,rowLinks)
importFrom(TreeSummarizedExperiment,rowTree)
importFrom(biomformat,read_biom)
importFrom(htmltools,HTML)
importFrom(htmltools,br)
importFrom(htmltools,tags)
importFrom(iSEE,ColumnDataTable)
importFrom(iSEE,ComplexHeatmapPlot)
importFrom(iSEE,ReducedDimensionPlot)
Expand Down
152 changes: 61 additions & 91 deletions R/landing_page.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@
#' @keywords internal

#' @rdname landing_page
#' @importFrom shiny actionButton tabPanel tabsetPanel renderUI selectInput
#' sliderInput textInput wellPanel fluidRow reactiveValues radioButtons
#' @importFrom shiny actionButton fluidRow tabPanel tabsetPanel renderUI
#' selectInput sliderInput textInput wellPanel reactiveValues radioButtons
#' numericInput fileInput checkboxInput verbatimTextOutput downloadButton
#' conditionalPanel
#' @importFrom shinydashboard dashboardPage dashboardHeader dashboardSidebar
#' dashboardBody box
#' @importFrom htmltools HTML br tags
#' @importFrom shinyjs disable
#' @importFrom utils data
.landing_page <- function(FUN, input, output, session) {
Expand All @@ -30,7 +31,7 @@
dashboardHeader(disable = TRUE),
dashboardSidebar(disable = TRUE),
dashboardBody(

fluidRow(box(id = "import.panel", title = "Import", width = 4,
status = "primary", solidHeader = TRUE,

Expand All @@ -40,16 +41,12 @@

selectInput(inputId = "data", label = "Dataset:",
choices = mia_datasets,
selected = mia_datasets[1])

),
selected = mia_datasets[1])),

tabPanel(title = "R Object", value = "rds", br(),

fileInput(inputId = "file", label = "RDS:",
accept = ".rds")

),
accept = ".rds")),

tabPanel(title = "Raw Data", value = "raw", br(),

Expand All @@ -60,9 +57,7 @@
accept = ".csv"),

fileInput(inputId = "rowdata", label = "rowData:",
accept = ".csv")

),
accept = ".csv")),

tabPanel(title = "Foreign", value = "foreign", br(),

Expand All @@ -81,27 +76,19 @@
label = "Remove taxa prefixes"),

checkboxInput(inputId = "rank.from.pref",
label = "Derive taxa from prefixes")
),
label = "Derive taxa from prefixes")),

conditionalPanel(
condition = "input.ftype == 'MetaPhlAn'",

fileInput(inputId = "col.data", label = "colData:",
accept = ".tsv"),
fileInput(inputId = "col.data",
label = "colData:", accept = ".tsv"),

fileInput(inputId = "tree.file", label = "Tree:",
accept = ".tree")
)

)

),
fileInput(inputId = "tree.file",
label = "Tree:", accept = ".tree")))),

actionButton("import", "Upload", class = "btn-success",
style = .actionbutton_biocstyle)

),
style = .actionbutton_biocstyle)),

box(id = "manipulate.panel", title = "Manipulate", width = 4,
status = "primary", solidHeader = TRUE,
Expand All @@ -111,7 +98,8 @@
tabPanel(title = "Subset", value = "subset", br(),

radioButtons(inputId = "subkeep", label = "Keep:",
choices = c("prevalent", "rare"), inline = TRUE),
choices = c("prevalent", "rare"),
inline = TRUE),

selectInput(inputId = "subassay", label = "Assay:",
choices = NULL),
Expand All @@ -121,41 +109,36 @@
min = 0, max = 1),

numericInput(inputId = "detection", value = 0,
label = "Detection threshold:", min = 0, step = 1)

),
label = "Detection threshold:", min = 0,
step = 1)),

tabPanel(title = "Agglomerate", value = "agglomerate", br(),
tabPanel(title = "Agglomerate", value = "agglomerate",

br(),

selectInput(inputId = "taxrank",
label = "Taxonomic rank:", choices = NULL)

),
label = "Taxonomic rank:", choices = NULL)),

tabPanel(title = "Transform", value = "transform", br(),

selectInput(inputId = "assay.type", label = "Assay:",
choices = NULL),
selectInput(inputId = "assay.type",
label = "Assay:", choices = NULL),

selectInput(inputId = "trans.method", label = "Method:",
choices = c("relabundance", "clr", "standardize")),
selectInput(inputId = "trans.method",
label = "Method:", choices = c("relabundance",
"clr", "standardize")),

checkboxInput(inputId = "pseudocount",
label = "Pseudocount"),

textInput(inputId = "assay.name", label = "Name:"),

radioButtons(inputId = "margin", label = "Margin:",
choices = c("samples", "features"), inline = TRUE)

)

),
choices = c("samples", "features"),
inline = TRUE))),

actionButton("apply", "Apply", class = "btn-success",
style = .actionbutton_biocstyle)

),
style = .actionbutton_biocstyle)),

box(id = "estimate.panel", title = "Estimate", width = 4,
status = "primary", solidHeader = TRUE,
Expand All @@ -164,77 +147,64 @@

tabPanel(title = "Alpha", value = "alpha", br(),

selectInput(inputId = "alpha.assay", label = "Assay:",
choices = NULL),
selectInput(inputId = "alpha.assay",
label = "Assay:", choices = NULL),

selectInput(inputId = "alpha.index", label = "Metric:",
choices = c("coverage", "shannon", "faith"),
multiple = TRUE),
selectInput(inputId = "alpha.index",
label = "Metric:", multiple = TRUE,
choices = c("coverage", "shannon", "faith")),

textInput(inputId = "alpha.name", label = "Name:")

),
textInput(inputId = "alpha.name", label = "Name:")),

tabPanel(title = "Beta", value = "beta", br(),

radioButtons(inputId = "bmethod", label = "Method:",
choices = c("MDS", "NMDS", "PCA", "RDA"),
inline = TRUE),

selectInput(inputId = "beta.assay", label = "Assay:",
choices = NULL),
selectInput(inputId = "beta.assay",
label = "Assay:", choices = NULL),

conditionalPanel(
condition = "input.bmethod != 'PCA'",

selectInput(inputId = "beta.index", label = "Metric:",
choices = c("euclidean", "bray", "jaccard", "unifrac")),
),
selectInput(inputId = "beta.index",
label = "Metric:", choices = c("euclidean",
"bray", "jaccard", "unifrac"))),

conditionalPanel(
condition = "input.bmethod == 'RDA'",

textInput(inputId = "rda.formula", label = "Formula:",
placeholder = "data ~ var1 + var2 * var3"),
),
textInput(inputId = "rda.formula",
label = "Formula:",
placeholder = "data ~ var1 + var2 * var3")),

numericInput(inputId = "ncomponents", value = 5,
label = "Number of components:", min = 1, step = 1),
label = "Number of components:", min = 1,
step = 1),

textInput(inputId = "beta.name", label = "Name:")

)

),
textInput(inputId = "beta.name", label = "Name:"))),

actionButton("compute", "Compute", class = "btn-success",
style = .actionbutton_biocstyle)

)),

fluidRow(box(id = "visualise.panel", title = "Visualise", width = 4,
status = "primary", solidHeader = TRUE,

selectInput(inputId = "panels", label = "Panels:",
choices = c(default_panels, other_panels),
multiple = TRUE, selected = c(default_panels)),
style = .actionbutton_biocstyle))),

actionButton("launch", "Launch iSEE", class = "btn-success",
style = .actionbutton_biocstyle)
fluidRow(box(id = "visualise.panel", title = "Visualise",
width = 4, status = "primary", solidHeader = TRUE,

selectInput(inputId = "panels", label = "Panels:",
choices = c(default_panels, other_panels),
multiple = TRUE, selected = c(default_panels)),

),
actionButton("launch", "Launch iSEE", class = "btn-success",
style = .actionbutton_biocstyle)),

box(id = "output.panel", title = "Output", width = 8,
status = "primary", solidHeader = TRUE,
box(id = "output.panel", title = "Output", width = 8,
status = "primary", solidHeader = TRUE,

verbatimTextOutput(outputId = "object"),

downloadButton(outputId = "download", label = "Download",
style = .actionbutton_biocstyle)
verbatimTextOutput(outputId = "object"),

))
))
})
downloadButton(outputId = "download", label = "Download",
style = .actionbutton_biocstyle)))))})

## Disable navbar buttons that are not linked to any observer yet
disable("iSEE_INTERNAL_organize_panels") # organize panels
Expand All @@ -258,7 +228,7 @@
"bug reports and other comments can be submitted",
tags$a(href = "https://github.com/microbiome/miaDash/issues",
"here", target = "_blank", .noWS = "after"), HTML(".<br/><br/>"),
"If you are new here, you can learn how to use the app with",
"If you are new to this app, you can learn how to use it with",
tags$a(href = "https://microbiome.github.io/miaDash/articles/miaDash.html",
"this short tutorial", target = "_blank", .noWS = "after"),
". Technical support can be obtained on",
Expand Down

0 comments on commit 12f17ce

Please sign in to comment.