forked from VIBTOBIlab/Shiny-DNAmBenchmarking
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.R
More file actions
121 lines (100 loc) · 4.11 KB
/
app.R
File metadata and controls
121 lines (100 loc) · 4.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#########################################################################################
# DecoNFlow Benchmarking - Shiny Web Application
# More information on the pipeline: https://github.com/VIBTOBIlab/Shiny-DNAmBenchmarking/
#########################################################################################
# -----------------------------------------------------------------------
# Packages used in this script (loaded in global.R)
# -----------------------------------------------------------------------
# shiny : Shiny app framework (UI + server, inputs/outputs, reactivity)
# shinycssloaders : withSpinner() to show loaders around plots
# plotly : Interactive plots via plotlyOutput(), renderPlotly(), ggplotly()
# ggplot2 : Static plotting backend for all ggplot-based figures
# DT : Interactive tables (DT::datatable, DT::renderDataTable)
# dplyr : Data manipulation (filter, mutate, group_by, summarise, arrange, etc.)
# purrr : Functional helpers, e.g. map2_dfr() for combining AUC-ROC results
# stringr : String helpers, e.g. str_replace_all() for nicer labels
# scales : Labelling and scaling helpers, e.g. label_scientific() for legends
# pROC : ROC/AUC calculations used in AUC-ROC plots
# ggpubr : Plot annotations, e.g. stat_pvalue_manual() for LoD p-values
# stats (base) : Statistical tests and p.adjust(), e.g. wilcox.test()
# utils (base) : I/O helpers, e.g. write.csv() in download handlers
# grid (base) : Low-level graphics utilities, e.g. unit() for legend sizing
#### 1. Source Application Files ####
# Load UI/server module components
source("modules/home_static.R")
source("modules/plots.R")
source("modules/information.R")
source("modules/contact.R")
# Load global settings and helper functions
source("global.R")
#### 2. UI Definition ####
ui <- fluidPage(
class = "app-body",
# Good mobile viewpoint
tags$head(tags$meta(name = "viewport", content = "width=device-width, initial-scale=1")),
# App stylesheet
tags$head(includeCSS("www/styles.css")),
div(
class = "app-container",
# Main content
div(
class = "app-main",
bslib::page_navbar(
id = "mainTabset",
title = "DecoNFlow Benchmarking",
theme = theme,
navbar_options = navbar_options(
position = "fixed-top",
collapsible = TRUE
),
# Tabs
homeTabUI("home"),
plotsTabUI("plots"),
informationTabUI("information"),
contactTabUI("contact"),
# Right side icons
nav_spacer(),
nav_item(
div(class = "navbar-icons",
tags$a(
href = "https://github.com/VIBTOBIlab/DecoNFlow/",
target = "_blank", rel = "noopener",
class = "nextflow-icon-button",
title = "Check out Nextflow pipeline TOBIlab/DecoNFlow",
tags$img(src = "nextflow.png", alt = "Nextflow")
),
tags_a <- tags$a(
href = "https://github.com/VIBTOBIlab/Shiny-DNAmBenchmarking/",
target = "_blank",
class = "github-icon-button",
title = "View the code for Shiny app on GitHub",
HTML("<i class='fa fa-github fa-lg'></i>")
)
)
)
)
),
# Footer area
uiOutput("conditionalFooter")
)
)
#### 3. Server Logic ####
server <- function(input, output, session) {
# Activate server logic for each module
homeTabServer("home")
plotsTabServer("plots")
informationTabServer("information")
contactTabServer("contact")
output$conditionalFooter <- renderUI({
if (input$mainTabset != "Contact") {
div(
class = "app-footer-wrapper",
lapply(1:5, function(x) tags$br()),
spsGoTop("default"),
footer_citation()
)
}
})
}
#### 4. Run the Application ####
shinyApp(ui = ui, server = server)