-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathui.R
210 lines (206 loc) · 13.3 KB
/
ui.R
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
options(spinner.color="#0dc5c1", spinner.color.background="#FFFFFF", spinner.type = 2)
shinyUI(
fluidPage(
tags$head(
singleton(
includeScript("www/readCookie.js")
)
),
useShinyjs(),
div(id = "loading_page",
img(src = "Ellipsis.svg"),
h3("LOADING..."),
align = "center"),
tags$head(tags$style(type='text/css', "#loading_page { width:100%; margin-top: 20%;}")),
hidden(
div(id = "main_content",
navbarPage("Drug-Target EXplorer", theme = shinytheme("flatly"),
tabPanel("About",
h4(strong("Welcome to the Drug-Target Explorer.")),
h5("The purpose of this app is to facilitate exploration of drug-target interaction databases.
The underlying database for this app is a harmonized dataset which summarizes quantitative and qualitative
small molecule activity data for human targets from ChEMBL, the Drug-Gene Interaction Database, DrugBank, and ChemicalProbes.org
The current database (v4) summarizes evidence for >659,000 small-molecule-target interactions (>382,000 chemical entities and 4130 human targets)."),
br(),
h4(strong("How does this tool work?")),
h5("This tool leverages structural information of molecules and the associated target annotations to build a drug-target map
based on chemical similarity between molecules.
Examples of use-cases for this include:"),
h5(" - prediction of molecular targets for novel molecules based on structural similarity"),
h5(" - identification of off targets for molecules of interest"),
h5(" - facilitating polypharmacologic drug discovery"),
h5(" - identifying Gene Ontology terms and KEGG pathways associated with small molecule target lists"),
br(),
h4(strong("How do I use the app to search by chemical entity?")),
p("Click on the 'Molecules' tab to find targets associated with your molecule of interest.
Search for the drug using the 'Molecule Lookup' panel on the left.
Alternatively, use the 'PubChem Search' panel to use the PubChem PUG-REST API, or directly enter the SMILES structural string in the 'Direct Structure Input' panel.
Set the Tanimoto similarity threshold using the slider, where 1 represents an identical molecular fingerprint."),
h4(strong("How do I use the app to search by target?")),
p("If you have a target in mind, please enter the HUGO Gene Symbol on the 'Genes' tab."),
br(),
fluidRow(a("Feedback? Click here.", href = "https://goo.gl/forms/EoyI3da7Y0X50jah2", target="_blank"), align = "center"),
br(),
fluidRow(
img(src= "sage_logo.png"),
img(src='CTF_Logo.png'), align = "center"),
br(),
h4(strong("This app relies on these excellent R packages:")),
fluidRow(
h5("shiny, shinyBS, shinythemes, rcdk, fingerprint, rJava"),
h5("tidyverse, DT, enrichR, webchem, visNetwork, igraph"), align = "center")),
tabPanel("Molecules",
sidebarLayout(
sidebarPanel(
bsCollapse(
bsCollapsePanel("Quick Start Guide",
p("You have three options for molecule lookup.
You can:"),
div(),
p("1) look up by molecule name in our database,"),
div(),
p("2) search PubChem for structures associated with your molecule name, or"),
div(),
p("3) directly enter the structure as represented by a SMILES string."),
div(),
p(strong("After entering a molecule, pick a similarity using the slider, where 0 = highly dissimilar, and 1 = identical.")),
div()),
bsCollapsePanel("Molecule Lookup",
fluidRow(selectizeInput("drugnames",
choices = NULL,
label = "",
selected = "",
multiple = FALSE,
width = "90%"),
bsTooltip("drugnames", "Type molecule name here to search this database for SMILES strings.",
"right", options = list(container = "body")), align = "center"),
fluidRow(actionButton("ppdbsearchbutton", "Find Molecules", align = "center"), align = "center"),
br(),
p("Search this database for structures by compound name. Can't find what you're looking for? Move to the next panel to search CIR."), style = "info"),
bsCollapsePanel("PubChem Search",
fluidRow(textInput("input.name",
"input text",
label = NULL,
value = "brigatinib",
width = "90%"),
bsTooltip("input.name", "Type molecule name here to search this database for SMILES strings.",
"right", options = list(container = "body")), align = "center"),
fluidRow(actionButton("pugrestbutton", "Find PubChem Mols"), align = "center"),
br(),
p("Input a compound name in this box to search PubChem for the structure."),
textOutput("cirsearchNA"), style = "info"),
bsCollapsePanel("Direct Structure Input", fluidRow(textInput("smiles",
"SMILES string",
label = "",
value = "",
width = "90%"
),
bsTooltip("smiles", "Input the structural string (SMILES) here.",
"right", options = list(container = "body")), align = "center"),
div(),
p("Know your SMILES string already? Search by structure directly here."), style = "info"), open = "Quick Start Guide"),
bsCollapse(bsCollapsePanel("Similarity Threshold",
sliderInput("sim.thres", label = "",
min=0.3,
max=1,
value=0.90,
step = 0.01,
ticks = FALSE),
bsTooltip("sim.thres", "Set the Tanimoto similarity (1 being identical) here.",
"right", options = list(container = "body")), style = "warning"), open = "Similarity Threshold"),
uiOutput("sims"),
bsCollapse(
bsCollapsePanel("2D Structure (input)", fluidRow(imageOutput("structureimage"), align = "center"), style = "danger"), open = "2D Structure (input)")
),
mainPanel(
tabsetPanel(
tabPanel(title = img("Similar Molecules ", id = "similarmolstab", src = "help.png", align = "right"),
bsTooltip(id = "similarmolstab", title = "This table displays all similar molecules to the input molecule.", placement = "bottom", trigger = "hover"),
DT::dataTableOutput("simmoltab") %>% withSpinner()),
tabPanel(title = img("Similarity Net ", id = "similarmolnettab", src = "help.png", align = "right"),
bsTooltip(id = "similarmolnettab", title = "This is a graphical representation of the previous table, where edge thickness is the similarity to the input.", placement = "bottom", trigger = "hover"),
visNetworkOutput("net", height = "600px", width = "100%") %>% withSpinner(),
DT::dataTableOutput("drug_net_info")),
tabPanel(title = img("Targets ", id = "targetstab", src = "help.png", align = "right"),
bsTooltip(id = "targetstab", title = "These are all of the targets associated with the input and similar molecules. Filter using the checkboxes in the sidebar.", placement = "bottom", trigger = "hover"),
DT::dataTableOutput("value") %>% withSpinner()),
tabPanel(title = img("Target Net ", id = "targetnettab", src = "help.png", align = "right"),
bsTooltip(id = "targetnettab", title = "This a network of all similar molecules (blue) and their targets (green).", placement = "bottom", trigger = "hover"),
visNetworkOutput("targetnet", height = "800px", width = "100%") %>% withSpinner()),
tabPanel(title = img("Enrichr ", id = "enrichrtab", src = "help.png", align = "right"),
bsTooltip(id = "enrichrtab", title = "This tab interactively queries Enrichr for enriched gene ontology and KEGG terms using your target list. May take a few seconds, please be patient!", placement = "bottom", trigger = "hover"),
tabsetPanel(
tabPanel("GO Molecular Function",
DT::dataTableOutput("GOMF.mol")),
tabPanel("GO Cellular Component",
DT::dataTableOutput("GOCC.mol")),
tabPanel("GO Biological Process",
DT::dataTableOutput("GOBP.mol")),
tabPanel("KEGG Pathways",
DT::dataTableOutput("kegg")))),
tabPanel(title = img("in vitro Comparison ", id = "celltab", src = "help.png", align = "right"),
bsTooltip(id = "celltab", title = "This tab searches CCLE and Sanger drug response data for drugs related to your query compound.", placement = "bottom", trigger = "hover"),
h4(textOutput("ccle_mol")),
div(),
plotlyOutput("ccle_2", height = "400px", width = "90%") %>% withSpinner(),
# plotlyOutput("ccle_1", height = "400px", width = "90%") %>% withSpinner(),
div(),
h4(textOutput("sang_mol")),
plotlyOutput("sang_2", height = "400px", width = "90%") %>% withSpinner()
# plotlyOutput("sang_1", height = "400px", width = "90%") %>% withSpinner()
))
)
)
),
tabPanel("Genes",
sidebarLayout(
sidebarPanel("Gene Input:",
fluidRow(selectizeInput(
'inp.gene',
label = NULL,
choices = NULL,
multiple = TRUE
),
bsTooltip(id = "inp.gene", title = "Input 1 or more HUGO gene symbols.", placement = "right", trigger = "hover"),
actionButton("genebutton", "Search", align = "center"), align = "center")
),
mainPanel(
tabsetPanel(
tabPanel(title = img("Matched Molecules ", id = "matchmolstab", src = "help.png", align = "right"),
bsTooltip(id = "matchmolstab", title = "This tab displays molecules with a known interaction with the input gene", placement = "right", trigger = "hover"),
DT::dataTableOutput("genetargets") %>% withSpinner()),
tabPanel(title = img("Target Network ", id = "targnetworktab", src = "help.png", align = "right"),
bsTooltip(id = "targnetworktab", title = "This tab graphically displays the input gene, associated drugs, and the other targets associated with those drugs.", placement = "right", trigger = "hover"),
visNetworkOutput("genetargetnet", height = "800px", width = "100%") %>% withSpinner())
)
)
)
),
tabPanel("Settings",
sidebarLayout(
sidebarPanel(),
mainPanel(
fluidRow(h1("Molecules Tab")),
fluidRow(
radioButtons("fp.type", "Fingerprint type:",
c("Extended" = "extended",
"Circular (ECFP/FCFP-like, default)" = "circular",
"MACCS" = "maccs"
))),
fluidRow(p("Tanimoto similarity is greatly impacted by fingerprint choice. For example, circular fingerprints will generally have a lower Tanimoto similarity than extended fingerprints for a given chemical pair.
We chose extended as the default for here as it seemed to work best for commonly-used Tanimoto thresholds for similarity (e.g. >0.85 indicating highly similar.")),
fluidRow(
radioButtons("edge.size", "Render edges with confidence score? (values are scaled uniquely for each plot from 0 to 10)",
c("Yes (default)" = TRUE,
"No" = FALSE))),
fluidRow(h1("Gene Tab")),
fluidRow(radioButtons("gene.filter.metric", "Target networks on gene panel are restricted to top 15 molecules for performance. Select on:",
c("largest pChEMBL" = "mean_pchembl",
"largest confidence score" = "confidence",
"largest known selectivity index" = "known_selectivity_index"))))
)
))
)
)
)
)