-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathui.R
More file actions
124 lines (117 loc) · 5.23 KB
/
ui.R
File metadata and controls
124 lines (117 loc) · 5.23 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
122
123
124
######## MEx-IPA VERSION 0.4.5 #################
## To prioritise conda packages directory, when installed by conda
if ( any(grepl("envs/MEx-IPA/lib/R/library", .libPaths())) )
.libPaths(.libPaths()[grep("envs/MEx-IPA/lib/R/library", .libPaths())])
print(.libPaths())
library(shiny)
library(DT)
library(shinycustomloader)
library(shinyWidgets)
# Define UI for application
shinyUI(fluidPage(
# Application title
titlePanel("MEx-IPA (MaltExtract Interactive Plotting Application)"),
# Sidebar with options
sidebarLayout(
sidebarPanel(
h4("General Options"),
textInput("select_dir",
strong("Path to MaltExtract results directory"),
value = NULL
),
htmlOutput("report_dir"),
uiOutput("run_button"),
br(),
textInput("remove_string",
strong("Remove from filename"),
value = NULL
),
uiOutput("file_options"),
uiOutput("node_options"),
uiOutput("filter_options"),
br(),
h4("Single Sample Options"),
strong("Interactive"),
switchInput("interactive",
"",
value = FALSE,
width = "auto"),
downloadButton('downloadPlot', 'Download PDF Report'),
br(),
br(),
h4("Multiple Samples Options"),
selectInput("characteristic", "Characteristic",
list(`DNA Damage` = "damage",
`Read Length` = "length",
`Edit Distance` = "edit",
`Percent Identity` = "percentidentity",
`Positions Covered` = "positionscovered",
`Depth Coverage` = "coveragehist"),
selected = "damage"),
br(),
##from https://www.r-bloggers.com/stop-shiny-and-close-browser-together/
tags$button(
id = "close",
type = "button",
class = "btn action-button",
onclick = "setTimeout(function(){window.close();},500);", #CloseBrowser
"Close app")
),
# Show a plots
mainPanel(
tabsetPanel(
type = "tabs",
tabPanel(
title = "Single Sample",
fluidRow(
verticalLayout(
br(),
h4("Summary Statistics"),
column(width = 12,
withLoader(uiOutput("filterstats_plot", width = "75%"), type = "html", loader = "dnaspin"),
align = "center"
),
br(),
h4("Read Characteristics"),
splitLayout(cellWidths = c("50%", "50%"),
withLoader(uiOutput("damage_plot"), type = "html", loader = "dnaspin"),
withLoader(uiOutput("length_plot"), type = "html", loader = "dnaspin")
),
br(),
h4("Similarity to Reference"),
splitLayout(cellWidths = c("50%", "50%"),
withLoader(uiOutput("edit_plot"), type = "html", loader = "dnaspin"),
withLoader(uiOutput("percentidentity_plot"), type = "html", loader = "dnaspin")
),
br(),
h4("Reference Coverage"),
splitLayout(cellWidths = c("50%", "50%"),
withLoader(uiOutput("positionscovered_plot"), type = "html", loader = "dnaspin"),
withLoader(uiOutput("coveragehist_plot"), type = "html", loader = "dnaspin")
)
)
)
),
tabPanel(
title = "Multiple Samples",
br(),
tags$b("Note"),
br(),
p("May take a few moments to load. Samples with no input data for selected taxon will not be displayed. Check single sample plot for confirmation."),
withLoader(uiOutput("multisample_plots"), type = "html", loader = "dnaspin")
),
# tabPanel(
# title = "Multiple Taxa",
# br(),
# tags$b("Note"),
# br(),
# p("May take a few moments to load. Taxa with no input data for selected sample will not be displayed. Check single sample plot for confirmation."),
# withLoader(uiOutput("multitaxa_plots"), type = "html", loader = "dnaspin")
# ),
tabPanel(title = "Documentation",
includeMarkdown("assets/docs/documentation.md")
)
)
)
)
))