-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.R
2326 lines (1905 loc) · 108 KB
/
app.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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#### Aquatic Microplastics Toxicology Shiny App
#### File created: September 23, 2020
#### Code contributors: Heili Lowman, Leah Thornton Hampton, Scott Coffin, Emily Darin
#### Setup ####
# Load packages
library(tidyverse) #General everything
library(shinydashboard)
library(RColorBrewer) #plot colors
library(ggplot2) #General plotting
library(ggrepel) #For adding text labels that repel away from data points
library(calecopal) #Color palette
library(shiny) #Runs shiny
library(shinythemes) #Shiny theme for the page
library(shinyWidgets) #Widgets
library(scales) #SSD - Use the percent format
library(reshape2) #Overview tab - melts bars together
library(DT) #Build HTML data tables
library(plotly) #Make plots interactive
library(viridis) #Colors
library(scales) #To use "percent" function
library(shinyjs) #Exploration tab - reset button
library(tigerstats) #row percent values
library(ggbeeswarm) #plot all points nicely
library(collapsibleTree) #plot type for endpoint category tree
library(ggdark) #dark mode ggplot
library(ggsci) #color palettes
library(RColorBrewer) #color palette
library(viridis) #Colors
##### Load finalized dataset prepped in RDAmaker.R ####
##### SAVE DATA #####
human <- readRDS("human.RDS")
human_endpoint <- readRDS("human_endpoint.RDS")
human_quality <- readRDS("human_quality.RDS")
human_search <- readRDS("human_search.RDS")
human_setup <- readRDS("human_setup.RDS")
human_v1 <- readRDS("human_v1.RDS")
##### Load functions #####
source("functions.R")
#### Overview Human Setup ####
#Set up for polymer overview plot
polydf<-rowPerc(xtabs( ~polymer +effect, human)) #pulls polymers by effect
polyf<-as.data.frame(polydf)%>% #Makes data frame
replace_na(list(polymer = "Not Reported")) %>%
mutate(effect = case_when(effect == "Y" ~ "Yes",
effect == "N" ~ "No")) %>%
filter(effect %in% c("Yes","No"))%>% #Sorts into Yes and No
rename(Type = "polymer")%>%#rename so future columns have same name
mutate(Type = case_when(
Type == "PA" ~ "Polyamide",
Type == "PE" ~ "Polyethylene",
Type == "PMMA" ~ "Polymethylmethacrylate",
Type == "PP" ~ "Polypropylene",
Type == "PS" ~ "Polystyrene",
Type == "PUR" ~ "Polyurathane",
Type == "PVC" ~ "Polyvinylchloride",
Type == "TR" ~ "Tire Rubber"))%>%
mutate_if(is.numeric, round,0)%>% #rounds percents
mutate(plot="Polymer") # change column name for check list
Endpoints<-xtabs(~polymer +effect ,human) #Pulls all study obs. for polymer from dataset
polyfinal<- data.frame(cbind(polyf, Endpoints))%>% #adds it as a column
rename(Endpoints='Freq.1')%>% #renames column
rename(category='polymer')%>%
mutate(logEndpoints = log(Endpoints))%>%
rename(Percent = Freq)#renames column#renames column
#Set up for size overview plot
sizedf<-rowPerc(xtabs(~size.category +effect, human))
sizef<-as.data.frame(sizedf)%>%
mutate(effect = case_when(effect == "Y" ~ "Yes",
effect == "N" ~ "No")) %>%
filter(effect %in% c("Yes","No"))%>% #Sorts into Yes and No
mutate(size.category = case_when(
size.category == 1 ~ "1nm < 100nm",
size.category == 2 ~ "100nm < 1µm",
size.category == 3 ~ "1µm < 100µm",
size.category == 4 ~ "100µm < 1mm",
size.category == 0 ~ "Not Reported"))%>%
rename(Type = "size.category")%>%
mutate_if(is.numeric, round,0)%>%
mutate(plot="Size")
study_s<-xtabs(~size.category +effect ,human)
sizefinal<- data.frame(cbind(sizef, study_s))%>%
rename(Endpoints='Freq.1')%>%
rename(category='size.category')%>%
mutate(logEndpoints = log(Endpoints))%>%
rename(Percent = Freq)#renames column
#Set up for shape overview plot
shapedf<-rowPerc(xtabs(~shape + effect, human))
shapef<-as.data.frame(shapedf)%>%
mutate(effect = case_when(effect == "Y" ~ "Yes",
effect == "N" ~ "No")) %>%
filter(effect %in% c("Yes","No"))%>% #Sorts into Yes and No
rename(Type="shape")%>%
mutate_if(is.numeric, round,0)%>%
mutate(plot="Shape")%>%
mutate(Type = case_when(
Type == "fragment" ~ "Fragment",
Type == "sphere" ~ "Sphere",
Type == "NA" ~ "Not Reported"))
study_sh<-xtabs(~shape + effect,human)
shapefinal<- data.frame(cbind(shapef, study_sh))%>%
rename(Endpoints='Freq.1')%>%
rename(category='shape')%>%
mutate(logEndpoints = log(Endpoints))%>%
rename(Percent = Freq)#renames column
#Set up for lvl1 overview plot
lvl1df<-rowPerc(xtabs(~lvl1 +effect, human))
lvl1f<-as.data.frame(lvl1df)%>%
mutate(effect = case_when(effect == "Y" ~ "Yes",
effect == "N" ~ "No")) %>%
filter(effect %in% c("Yes","No"))%>% #Sorts into Yes and No
rename(Type= "lvl1")%>%
mutate_if(is.numeric, round,0)%>%
mutate(plot="Lvl1")%>%
mutate(Type = case_when(
Type == "alimentary.excretory" ~ "Alimentary, Excretory",
Type == "behavior.sense.neuro" ~ "Behavioral, Sensory, Neurological",
Type == "cell.growth.proliferation" ~ "Cell Growth and Proliferation",
Type == "cell.morphology.structure" ~ "Cell Morphology and Structure",
Type == "circulatory" ~ "Circulatory",
Type == "cytotoxicity" ~ "Cytotoxicity",
Type == "endocrine.signaling" ~ "Endocrine Signaling",
Type == "fitness" ~ "Fitness",
Type == "immune" ~ "Immune",
Type == "metabolism" ~ "Metabolism",
Type == "microbiome" ~ "Microbiome",
Type == "respiratory" ~ "Respiratory",
Type == "stress" ~ "Stress"))
study_l<-xtabs(~lvl1 +effect, human)
lvl1final<- data.frame(cbind(lvl1f, study_l))%>%
rename(Endpoints='Freq.1')%>%
rename(category='lvl1')%>%
mutate(logEndpoints = log(Endpoints))%>%
rename(Percent = Freq)#renames column
#Set up for life stage overview plot
lifedf<-rowPerc(xtabs(~life.stage +effect, human))
lifef<-as.data.frame(lifedf)%>%
replace_na(list(life.stage = "Not Reported")) %>%
mutate(effect = case_when(effect == "Y" ~ "Yes",
effect == "N" ~ "No")) %>%
filter(effect %in% c("Yes","No"))%>% #Sorts into Yes and No
rename(Type= "life.stage")%>%
mutate_if(is.numeric, round,0)%>%
mutate(plot="Life.stage")%>%
mutate(Type = case_when(
Type == "early,f1"~"Early, F1 Generation",
Type == "early,f2"~"Early, F2 Generation",
Type == "juvenile"~"Juvenile",
Type == "adult"~"Adult",
Type == "Not Reported"~"Not Reported"))
studyli<-xtabs(~life.stage +effect ,human)
lifefinal<- data.frame(cbind(lifef, studyli))%>%
rename(Endpoints='Freq.1')%>%
rename(category='life.stage')%>%
mutate(logEndpoints = log(Endpoints))%>%
rename(Percent = Freq)#renames column
#Set up for in vitro in vivo overview plot
vivodf<-rowPerc(xtabs(~invitro.invivo +effect, human))
vivof<-as.data.frame(vivodf)%>%
mutate(effect = case_when(effect == "Y" ~ "Yes",
effect == "N" ~ "No")) %>%
filter(effect %in% c("Yes","No"))%>% #Sorts into Yes and No
rename(Type= "invitro.invivo")%>%
mutate_if(is.numeric, round,0)%>%
mutate(plot="Invivo.invivo")%>%
mutate(Type = case_when(
Type=="invivo"~"In Vivo",
Type=="invitro"~"In Vitro"))
study_v<-xtabs(~invitro.invivo +effect, human)
vivofinal<- data.frame(cbind(vivof, study_v))%>%
rename(Endpoints='Freq.1')%>%
rename(category='invitro.invivo')%>%
mutate(logEndpoints = log(Endpoints))%>%
rename(Percent = Freq)#renames column
# #Test Set up for plot type widget
#
# #in vitro/in vivo by year and measurement
# vivodf_year_measurement<-rowPerc(xtabs(~invitro.invivo +year, human)) %>%
# as.data.frame()%>%
# filter(year!="Total") %>% #supress Total column to be able to cbind later
# rename(Type= "invitro.invivo")%>%
# mutate_if(is.numeric, round,0)%>%
# mutate(plot="Invivo.invivo")%>%
# mutate(Type = case_when(
# Type=="invivo"~"In Vivo",
# Type=="invitro"~"In Vitro"))
# study_v_year<-as.data.frame(xtabs(~invitro.invivo +year, human))
# vivoFinal_year<- data.frame(cbind(vivodf_year_measurement, study_v_year))%>%
# rename(Endpoints='Freq.1')%>%
# rename(category='invitro.invivo')%>%
# mutate(logEndpoints = log(Endpoints))%>%
# rename(Percent = Freq)#renames column
#
# #in vitro/in vivo by year and study
# vivoFinal_year_study<-human %>%
# group_by(invitro.invivo, year) %>%
# summarize(studyCount = n_distinct(doi)) %>%
# mutate(freq = 100 * studyCount / sum(studyCount)) %>%
# as.data.frame()%>%
# rename(Type= "invitro.invivo")%>%
# mutate_if(is.numeric, round,0)%>%
# mutate(plot="Invivo.invivo")%>%
# mutate(Type = case_when(
# Type=="invivo"~"In Vivo",
# Type=="invitro"~"In Vitro")) %>%
# rename(Studies='studyCount')%>%
# mutate(logStudies = log(Studies))%>%
# rename(Percent = freq)#renames column
#Set up for exposure route overview plot
routedf<-rowPerc(xtabs(~exposure.category +effect, human))
routef<-as.data.frame(routedf)%>%
mutate(effect = case_when(effect == "Y" ~ "Yes",
effect == "N" ~ "No")) %>%
filter(effect %in% c("Yes","No"))%>% #Sorts into Yes and No
rename(Type= "exposure.category")%>%
mutate_if(is.numeric, round,0)%>%
mutate(plot="Exposure.category")%>%
mutate(Type = case_when(
Type == "Dermal" ~ "Dermal",
Type == "Ingestion" ~ "Ingestion",
Type == "Inhalation" ~ "Inhalation",
Type == "IV Injection" ~ "IV Injection",
Type == "In Vitro" ~ "In Vitro"))
study_r<-xtabs(~exposure.category +effect,human)
routefinal<- data.frame(cbind(routef, study_r))%>%
rename(Endpoints='Freq.1')%>%
rename(category='exposure.category')%>%
mutate(logEndpoints = log(Endpoints))%>%
rename(Percent = Freq)#renames column
# # Set default theme for overview plots
# overviewTheme <- function(){
# theme_classic() %+replace%
# theme(text = element_text(size=17), plot.title = element_text(hjust = 0.5, face="bold",size=20),legend.position = "right",
# axis.ticks= element_blank(),
# axis.text.x = element_text(),
# axis.text.y = element_blank(),
# axis.title.x = element_blank() ) }
#### User Interface ####
ui <- dashboardPage(
dashboardHeader(title = "Toxicity of Microplastics Explorer", titleWidth = 400),
dashboardSidebar(width = 175,
sidebarMenu(
#Logo image
br(),
tags$img(src="main_logo_drop.png", width = "100%", height = "100%", style = 'display: block; margin-left: auto; margin-right: auto;'),
tags$div("Logo created by J.C. Leapman.", align = 'center', style = 'font-size: 10px; display: block; margin-left: auto; margin-right: auto;'),
br(),
#List of tabs
menuItem("Welcome", tabName = "Welcome", icon = icon("home")),
menuItem("Overview", tabName = "Overview", icon = icon("globe")),
menuItem("Search", tabName = "Search", icon = icon("search")),
menuItem("Exploration", tabName = "Exploration", icon = icon("chart-bar")),
menuItem("Study Screening", tabName = "Screening", icon = icon("check-circle")),
menuItem("Resources", tabName = "Resources", icon = icon("question-circle")),
menuItem("Data Submission", tabName = "Submission", icon = icon("fas fa-file-upload")),
menuItem("Contact", tabName = "Contact", icon = icon("envelope")),
br(),
br(),
#Twitter icon
menuItem("Aquatic Organisms", href = "https://sccwrp.shinyapps.io/aq_mp_tox_shiny/", icon = icon("fish")),
br(),
br(),
#Twitter icon
menuItem("Follow Us on Twitter!", href = "https://twitter.com/ToMExApp", icon = icon("twitter")))
), #End dashboard sidebar
dashboardBody(
#extends background color automatically
tags$head(tags$style(HTML('.content-wrapper { overflow: auto; }'))),
tabItems(
#### Welcome UI ####
tabItem(tabName = "Welcome",
#Header
h1("Welcome to the Toxicity of Microplastics Explorer,",br(),"Human Health Database!", align = 'center'),
br(),
box(status = "primary", width = 12,
fluidRow(
#top right box
column(width = 12,
p(tags$img(src="welcome.png", width = "40%", height = "40%", style = "float:left; display: block; margin-left: auto; margin-right: 30px;")),
h3("What is the Microplastics Toxicity Database?", align = "center"),
strong(p("This database is a repository for microplastics
toxicity data that may inform possible effects on Human Health.")),
p("This web application allows users to explore toxicity
data using an intuitive interface while retaining the diversity and complexity inherent
to microplastics. Data is extracted from existing, peer-reviewed manuscripts containing
toxicity data pertaining to microplastics."),
p("A full length description of the database and web application is published in ",
a(href = "https://www.springeropen.com/collections/sccwrp", 'Microplastics and Nanoplastics'),
". To access the open access manuscript, ", a(href = "https://microplastics.springeropen.com/articles/10.1186/s43591-022-00032-4", 'click here'),"."),
p("Use the side panel on the left of the page to navigate to each section. Each section provides different information or data visualization options.
More specific instructions may be found within each section.")))),
#bottom left box
box(status = "primary", width = 12,
h3("Why was the Microplastics Toxicity Database and Web Application created?", align = "center"),
p("The database and application tools have been created for use by the participants of the ", a(href = "https://www.sccwrp.org/about/
research-areas/additional-research-areas/
trash-pollution/microplastics-health-effects-webinar-series/", 'Microplastics Health Effects Workshop',
.noWS = "outside"),".The purpose of this workshop is to identify the most sensitive and biologically critical endpoints associated with microplastics exposure,
prioritize which microplastics characteristics (e.g., size, shape, polymer) that are of greatest biological concern, and identify
critical thresholds for each at which those biological effects become pronounced. Workshop participants will also make reccomendations for future
research investments. Workshop findings will be published in a special issue of ", a(href ="https://microplastics.springeropen.com/", 'Microplastics and Nanoplastics', .noOWs = "outside"),".
These findings will be used directly by the state of California to fulfill ", a(href = "https://www.sccwrp.org/about/research-areas/
additional-research-areas/trash-pollution/microplastics-health-effects-webinar-series/history-california-microplastics-legislation/", 'legislative mandates',
.noWS = "outside")," regarding the management of microplastics in drinking water and the aquatic environment.")),
#bottom right box
box(status = "primary", width = 12,
h3("Contributors", align = "center"),
p(align = "center", a(href = "https://www.sccwrp.org/about/staff/leah-thornton-hampton/", 'Dr. Leah Thornton Hampton'),", Southern California Coastal Water Research Project ",
tags$a(href="https://twitter.com/DrLeahTH", icon("twitter")), tags$a(href="https://github.com/leahth", icon("github"))),
p(align = "center", a(href = "https://agency.calepa.ca.gov/staffdirectory/detail.asp?UID=69294&BDO=7&VW=DET&SL=S", 'Dr. Scott Coffin'),", California State Water Resources Control Board",
tags$a(href="https://twitter.com/DrSCoffin", icon("twitter")), tags$a(href="https://github.com/ScottCoffin", icon("github"))),
p(align = "center", a(href = "https://www.heililowman.com/", 'Dr. Heili Lowman'),", University of Nevada Reno ",
tags$a(href="https://twitter.com/heili_lowman", icon("twitter")), tags$a(href="https://github.com/hlowman", icon("github"))),
p(align = "center", a(href = "https://www.sccwrp.org/about/staff/emily-darin/", 'Emily Darin'),", Southern California Coastal Water Research Project",
tags$a(href="https://github.com/EmilyDarin", icon("github"))),
p(align = "center", a(href = "https://www.sfei.org/users/liz-miller", 'Dr. Ezra Miller'),", San Franciso Estuary Institute"),
p(align = "center", a(href = "https://rochmanlab.com/people/", 'Dr. Ludovic Hermabessiere'),", University of Toronto",
tags$a(href="https://twitter.com/HermabessiereL", icon("twitter"))),
p(align = "center", a(href = "https://rochmanlab.com/people/", 'Hannah De Frond'),", University of Toronto",
tags$a(href="https://twitter.com/HanDefrond", icon("twitter"))),
p(align = "center", "Vera de Ruitjer, Wageningen University"),
p(align = "center", "Dr. Samreen Siddiqui, Oregon State University"),
p(align = "center", "Andrea Faltynkova, Norwegian University of Science and Technology"),
p(align = "center", "Johannes Völker, Norwegian University of Science and Technology"),
p(align = "center", "Laura Monclús Anglada, Norwegian University of Science and Technology"),
p(align = "center", a(href = "https://www.sccwrp.org/about/staff/syd-kotar/", "Sydney Kotar"),", Southern California Coastal Water Research Project"),
p(align = "center", a(href = "https://branderlab.net/", 'Dr. Susanne Brander'),", Oregon State University",
tags$a(href="https://twitter.com/smbrander", icon("twitter"))),
p(align = "center", a(href = "https://www.ntnu.edu/employees/martin.wagner", 'Dr. Martin Wagner'),", Norwegian University of Science and Technology",
tags$a(href="https://twitter.com/martiwag", icon("twitter"))),
p(align = "center", a(href = "https://www.wur.nl/en/Persons/Bart-prof.dr.-AA-Bart-Koelmans.htm", 'Dr. Bart Koelmans'),", Wageningen University",
tags$a(href="https://twitter.com/MicroplasticLab", icon("twitter"))),
p(align = "center", a(href = "https://rochmanlab.com/", 'Dr. Chelsea Rochman'),", University of Toronto",
tags$a(href="https://twitter.com/ChelseaRochman", icon("twitter"))),
p(align = "center", a(href = "https://www.sccwrp.org/about/staff/alvina-mehinto/", 'Dr. Alvine Mehinto'),", Southern California Coastal Water Research Project"),
p(align = "center", a(href = "https://www.sccwrp.org/about/staff/steve-weisberg/", 'Dr. Steve Weisberg'),", Southern California Coastal Water Research Project")),
#Logos with links to organizations
box(status = "primary", width = 12, align = "center",
splitLayout(align = "center",
tags$a(href="https://www.waterboards.ca.gov", tags$img(src="waterboard.png", width = "100%", height = "100%")),
tags$a(href="https://www.sccwrp.org", tags$img(src="sccwrp.png", width = "100%", height = "100%")),
tags$a(href="https://www.utoronto.ca", tags$img(src="toronto.png", width = "100%", height = "100%")),
tags$a(href="https://www.sfei.org/", tags$img(src="sfei.png", width = "100%", height = "100%")))),
),
#### Overview UI ####
tabItem(tabName = "Overview",
box(title = "Database Overview", status = "primary", width = 12, collapsible = TRUE,
p("Select tabs below to explore the database. Each bar displays the total number of measured endpoints where a
statistically signifcant effect was detected (Y) or where a measurement was made but a significant effect was not detected (N)."),
br(),
fluidRow(
tabBox(width = 12,
tabPanel("Exposure Route",
plotOutput(outputId = "exposure_plot"),
),
tabPanel(div(HTML("<i>In vitro</i> vs <i>In vivo</i>")),
plotOutput(outputId = "vivo_plot"),
),
tabPanel("Life Stage",
plotOutput(outputId = "life_plot"),
),
tabPanel("Endpoint Category",
plotOutput(outputId = "lvl1_plot"),
),
tabPanel("Polymer Type",
plotOutput(outputId = "polymer_plot"),
),
tabPanel("Particle Morphology",
plotOutput(outputId = "shape_plot"),
),
tabPanel("Particle Size",
plotOutput(outputId = "size_plot"),
)),
), #close fluid row
), #close box
box(title = "Biological Endpoint Catgorization", status = "primary", width = 12, collapsible = TRUE,
br(),
p("This plot displays the categorization of measured endpoints in the database. Nodes correspond to the Broad Endpoint Category,
the Specific Endpoint Category, Endpoints and the level of biological organization from left to right. The widget
below may be used to select endpoints at various Biological Levels of Organization. Click nodes to expand and collapse the plot."),
br(),
fluidRow(
column(width = 12,
column(width = 3,
pickerInput(inputId = "bio_check_endpoint", # bio org checklist
label = "Level of Biological Organization",
choices = levels(human_endpoint$bio_h_f),
selected = levels(human_endpoint$bio_h_f),
options = list(`actions-box` = TRUE),
multiple = TRUE)),
), #closes out column
column(width = 12,
#Go button
column(width = 3,
actionButton("go_endpoint", "Plot Current Selection", icon("rocket"), style="color: #fff; background-color: #117a65; border-color: #0e6655")),
), #closes out column
column(width = 12,
#collapsible tree plot
collapsibleTree::collapsibleTreeOutput("plot", height = "400px"),
), #closes out column
), #close fluid row
), #close box
), #close tab
#### Search UI ####
tabItem(tabName = "Search",
box(title = "Search Database", status = "primary", width = 12,
column(width = 12,
dataTableOutput("databaseDataTable", height = "200px"))
), #close box
),#close search tab
#### Exploration UI ####
tabItem(tabName = "Exploration",
box(title = "Data Selection", status = "primary", width = 12, collapsible = TRUE,
# shinyjs::useShinyjs(), # requires package for "reset" button, DO NOT DELETE - make sure to add any new widget to the reset_input in the server
# id = "exploration", # adds ID for resetting filters
fluidRow(
tabBox(width = 12,
tabPanel("Data Type",
fluidRow(
#Data type selection
column(width = 4,
pickerInput(inputId = "exp_type_check",
label = "Data Type:",
choices = levels(human_setup$exp_type_f),
selected = levels(human_setup$exp_type_f),
options = list(`actions-box` = TRUE),
multiple = TRUE)))
), #close tabpanel
tabPanel("Effect",
fluidRow(
#Broad endpoint selection
column(width = 4,
pickerInput(inputId = "lvl1_h_check",
label = "Broad Endpoint Category:",
choices = levels(human_setup$lvl1_h_f),
selected = levels(human_setup$lvl1_h_f),
options = list(`actions-box` = TRUE),
multiple = TRUE)),
#Specific endpoint selection
column(width = 4,
pickerInput(inputId = "lvl2_h_check",
label = "Specific Endpoint Category:",
choices = levels(human_setup$lvl2_h_f),
selected = levels(human_setup$lvl2_h_f),
options = list(`actions-box` = TRUE),
multiple = TRUE)),
#Effect y/n selection
column(width = 4,
pickerInput(inputId = "effect_h_check",
label = "Effect:",
choices = levels(human_setup$effect_h_f),
selected = levels(human_setup$effect_h_f),
options = list(`actions-box` = TRUE),
multiple = TRUE))),
), #close tabpanel
tabPanel("Biology",
fluidRow(
#species selection
column(width = 4,
pickerInput(inputId = "species_h_check",
label = "Species:",
choices = levels(human_setup$species_h_f),
selected = levels(human_setup$species_h_f),
options = list(`actions-box` = TRUE),
multiple = TRUE),
#biological organization selection
pickerInput(inputId = "bio_h_check",
label = "Level of Biological Organization",
choices = levels(human_setup$bio_h_f),
selected = levels(human_setup$bio_h_f),
options = list(`actions-box` = TRUE),
multiple = TRUE)),
#life stage selection
column(width = 4,
pickerInput(inputId = "life_h_check",
label = "Life Stages:",
choices = levels(human_setup$life_h_f),
selected = levels(human_setup$life_h_f),
options = list(`actions-box` = TRUE),
multiple = TRUE),
#exposure duration
pickerInput(inputId = "exposure_route_h_check",
label = "Exposure Route:",
choices = levels(human_setup$exposure_route_h_f),
selected = levels(human_setup$exposure_route_h_f),
options = list(`actions-box` = TRUE),
multiple = TRUE))),
), #close tabpanel
tabPanel("Particles",
fluidRow(
#polymer selection
column(width = 4,
pickerInput(inputId = "poly_h_check",
label = "Polymer:",
choices = levels(human_setup$poly_h_f),
selected = levels(human_setup$poly_h_f),
options = list(`actions-box` = TRUE),
multiple = TRUE)),
#shape selection
column(width = 4,
pickerInput(inputId = "shape_h_check",
label = "Shape:",
choices = levels(human_setup$shape_h_f),
selected = levels(human_setup$shape_h_f),
options = list(`actions-box` = TRUE),
multiple = TRUE)),
#size category selection
column(width = 4,
pickerInput(inputId = "size_h_check", # Environment checklist
label = "Size Category:",
choices = levels(human_setup$size_h_f),
selected = levels(human_setup$size_h_f),
options = list(`actions-box` = TRUE),
multiple = TRUE))),
), #close tabpanel
tabPanel("Study Screening",
fluidRow(
column(width = 12,
strong("Warning:"),"Only 'Particle Only' in vivo ingestion data are included in the study screening dataset.",
br(),
"'Red criteria' do not represent full scoring criteria. The full set of scoring criteria from Gouin et al. (In Review) may be downloaded via the Search tab or visualized via the Study Screening tab.",
br(),
br(),
),
#particle red criteria
column(width = 4,
pickerInput(inputId = "particle_criteria_check",
label = "Particle Criteria:",
choices = levels(human_setup$particle_red_criteria),
selected = levels(human_setup$particle_red_criteria),
options = list(`actions-box` = TRUE),
multiple = TRUE)),
#design red criteria
column(width = 4,
pickerInput(inputId = "design_criteria_check",
label = "Design Criteria:",
choices = levels(human_setup$design_red_criteria),
selected = levels(human_setup$design_red_criteria),
options = list(`actions-box` = TRUE),
multiple = TRUE)),
#risk red criteria
column(width = 4,
pickerInput(inputId = "risk_criteria_check",
label = "Risk Assessment Criteria:",
choices = levels(human_setup$risk_red_criteria),
selected = levels(human_setup$risk_red_criteria),
options = list(`actions-box` = TRUE),
multiple = TRUE))),
), #close tabpanel
tabPanel("Dose Metric",
fluidRow(
column(width = 4,
radioButtons(inputId = "dose_check", # dosing units
label = "Dose Metric:",
choices = c("Particles/mL", "µg/mL", "µm3/mL", "µm2/mL", "µm2/µg/mL"),
selected = "µg/mL")),
column(width = 4,
radioButtons(inputId = "Rep_Con_rad",
label = "Do you want to use just the reported, just the converted, or all exposure concentrations?",
choices = c("reported", "converted", "all"),
selected = "all"))),
), #close tabpanel
tabPanel("Aesthetics",
fluidRow(
column(width = 4,
selectInput(inputId = "plot.type", "Plot Type:",
list(boxplot = "boxplot", violin = "violin", beeswarm = "beeswarm"))),
column(width = 4,
selectInput(inputId = "theme.type_exp", "Dark or Light Mode:",
list(light = "light", dark = "dark"))),
column(width = 4,
selectInput(inputId = "color.type_exp", "Color Theme:",
list(default = "default", viridis = "viridis", brewer = "brewer", tron = "tron", locusZoom = "locusZoom", d3 = "d3", Nature = "Nature", JAMA = "JAMA")))),
) #close tabpanel
), #close tab box
), #close fluid row
column(width = 3,
actionButton("go", "Plot Current Selection", icon("rocket"), style="color: #fff; background-color: #117a65; border-color: #0e6655")),
column(width = 3,
actionButton("reset_input", "Reset Filters", icon("redo"), style="color: #fff; background-color: #f39c12; border-color: #d68910")),
column(width = 3,
downloadButton("downloadData", "Download Data (Excel File)", icon("download"), style="color: #fff; background-color: #337ab7; border-color: #2e6da4")),
), #close box
box(title = "Data Visualization", status = "primary", width = 12,
fluidRow(
tabBox(width = 12,
tabPanel("Exposure Route",
fluidRow(
column(width = 12,
plotOutput(outputId = "exposure_route_h_plot_react", height = "600px")),
column(width = 3,
downloadButton("downloadexploration_exproute", "Download Plot", icon("download"), style="color: #fff; background-color: #337ab7; border-color: #2e6da4"))),
),#closes tab panel
tabPanel("Broad Endpoint Category",
fluidRow(
column(width = 12,
plotOutput(outputId = "lvl_h_plot_react", height = "600px")),
column(width = 3,
downloadButton("downloadexploration_lvl1", "Download Plot", icon("download"), style="color: #fff; background-color: #337ab7; border-color: #2e6da4"))),
),#closes tab panel
tabPanel("Specific Endpoint Category",
fluidRow(
column(width = 12,
plotOutput(outputId = "lvl2_h_plot_react", height = "auto")),
column(width = 3,
downloadButton("downloadexploration_lvl2", "Download Plot", icon("download"), style="color: #fff; background-color: #337ab7; border-color: #2e6da4"))),
),#closes tab panel
tabPanel("Size",
fluidRow(
column(width = 12,
plotOutput(outputId = "size_h_plot_react", height = "600px")),
column(width = 3,
downloadButton("downloadexploration_size", "Download Plot", icon("download"), style="color: #fff; background-color: #337ab7; border-color: #2e6da4"))),
),#closes tab panel
tabPanel("Shape",
fluidRow(
column(width = 12,
plotOutput(outputId = "shape_h_plot_react", height = "600px")),
column(width = 3,
downloadButton("downloadexploration_shape", "Download Plot", icon("download"), style="color: #fff; background-color: #337ab7; border-color: #2e6da4"))),
),#closes tab panel
tabPanel("Polymer",
fluidRow(
column(width = 12,
plotOutput(outputId = "poly_h_plot_react", height = "600px")),
column(width = 3,
downloadButton("downloadexploration_poly", "Download Plot", icon("download"), style="color: #fff; background-color: #337ab7; border-color: #2e6da4"))),
),#closes tab panel
br(),
p("Data labels on the far right of each plot represent the number of measurements and studies, respectively.")
), #closes tab box
), #closes fluid tab
), #closes box
), #close tab
#### Screening UI ####
tabItem(tabName = "Screening",
box(title = "Data Selection", status = "primary", width = 12, collapsible = TRUE,
shinyjs::useShinyjs(), # requires package for "reset" button, DO NOT DELETE - make sure to add any new widget to the reset_input in the server
id = "screen", # adds ID for resetting filters
p("This plot displays scores from the", a(href ="https://tger.co.uk/research", 'study prioritization screening tool', .noOWs = "outside"), "developed by Gouin et al. (2021).
For more information, including the scoring rubric used, see Resources."),
fluidRow(
tabBox(width = 12, height = "200px",
tabPanel("Data Type",
"Only 'Particle Only' in vivo ingestion data are included in the study screening dataset."
), #close tabpanel
tabPanel("Effect",
#Broad endpoint selection
column(width = 4,
pickerInput(inputId = "lvl1_h_quality", # endpoint checklist
label = "Broad Endpoint Category:",
choices = levels(human_quality$lvl1_h_f),
selected = levels(human_quality$lvl1_h_f),
options = list(`actions-box` = TRUE), # option to de/select all
multiple = TRUE)), # allows for multiple inputs
#Specific endpoint selection
column(width = 4, #Specific endpoint selection
pickerInput(inputId = "lvl2_h_quality",
label = "Specific Endpoint Category:",
choices = levels(human_quality$lvl2_h_f),
selected = levels(human_quality$lvl2_h_f),
options = list(`actions-box` = TRUE),
multiple = TRUE)),
#Effect y/n selection
column(width = 4,
pickerInput(inputId = "effect_h_quality",
label = "Effect:",
choices = levels(human_quality$effect_h_f),
selected = levels(human_quality$effect_h_f),
options = list(`actions-box` = TRUE),
multiple = TRUE)),
), #close tabpanel
tabPanel("Biology",
#species selection
column(width = 4,
pickerInput(inputId = "species_h_quality",
label = "Species:",
choices = levels(human_quality$species_h_f),
selected = levels(human_quality$species_h_f),
options = list(`actions-box` = TRUE),
multiple = TRUE),
#biological organization selection
pickerInput(inputId = "bio_h_quality",
label = "Biological Organization:",
choices = levels(human_quality$bio_h_f),
selected = levels(human_quality$bio_h_f),
options = list(`actions-box` = TRUE),
multiple = TRUE)),
#life stage selection
column(width = 4,
pickerInput(inputId = "life_h_quality",
label = "Life Stages:",
choices = levels(human_quality$life_h_f),
selected = levels(human_quality$life_h_f),
options = list(`actions-box` = TRUE),
multiple = TRUE),
#exposure duration
pickerInput(inputId = "exposure_route_h_quality",
label = "Exposure Route:",
choices = levels(human_quality$exposure_route_h_f),
selected = levels(human_quality$exposure_route_h_f),
options = list(`actions-box` = TRUE),
multiple = TRUE)),
), #close tabpanel
tabPanel("Particles",
#polymer selection
column(width = 4,
pickerInput(inputId = "poly_h_quality",
label = "Polymer:",
choices = levels(human_quality$poly_h_f),
selected = levels(human_quality$poly_h_f),
options = list(`actions-box` = TRUE),
multiple = TRUE)),
#shape selection
column(width = 4,
pickerInput(inputId = "shape_h_quality",
label = "Shape:",
choices = levels(human_quality$shape_h_f),
selected = levels(human_quality$shape_h_f),
options = list(`actions-box` = TRUE),
multiple = TRUE)),
#size category selection
column(width = 4,
pickerInput(inputId = "size_h_quality",
label = "Size Category:",
choices = levels(human_quality$size_h_f),
selected = levels(human_quality$size_h_f),
options = list(`actions-box` = TRUE),
multiple = TRUE)),
), #close tabpanel
tabPanel("Study Screening",
fluidRow(
column(width = 12,
strong("Warning:"),"Only 'Particle Only' in vivo ingestion data are included in the study screening dataset.",
br(),
"'Red criteria' do not represent full scoring criteria. The full set of scoring criteria from Gouin et al. (In Review) may be downloaded via the Search tab or visualized via the Study Screening tab.",
br(),
br(),
),
#particle red criteria
column(width = 3,
pickerInput(inputId = "particle_criteria_quality",
label = "Particle Criteria:",
choices = levels(human_setup$particle_red_criteria),
selected = levels(human_setup$particle_red_criteria),
options = list(`actions-box` = TRUE),
multiple = TRUE)),
#design red criteria
column(width = 3,
pickerInput(inputId = "design_criteria_quality",
label = "Design Criteria:",
choices = levels(human_setup$design_red_criteria),
selected = levels(human_setup$design_red_criteria),
options = list(`actions-box` = TRUE),
multiple = TRUE)),
#risk red criteria
column(width = 3,
pickerInput(inputId = "risk_criteria_quality",
label = "Risk Assessment Criteria:",
choices = levels(human_setup$risk_red_criteria),
selected = levels(human_setup$risk_red_criteria),
options = list(`actions-box` = TRUE),
multiple = TRUE)),
#specfic study
column(width = 3,
pickerInput(inputId = "study_plus_quality",
label = "Study:",
choices = levels(human_quality$Study_plus),
selected = levels(human_quality$Study_plus),
options = list(`actions-box` = TRUE),
multiple = TRUE))),
) #close tabpanel
), #close tab box
), #close fluid row
column(width = 3,
actionButton("go_quality", "Plot Current Selection", icon("rocket"), style="color: #fff; background-color: #117a65; border-color: #0e6655")),
column(width = 3,
actionButton("reset_quality", "Reset Filters", icon("redo"), style="color: #fff; background-color: #f39c12; border-color: #d68910")),
), #close box
box(title = "Visualize Data", status = "primary", width = 12,
p("Use the cursor to zoom and hover over the plot to view additional information about each study. Some studies are not visible until zoomed in.
Alternatively, specific studies may be selected using the filter in the 'Study Screening' tab above."),
br(),
p("'Red Criteria' are indicated by (*). Scores of 0, 1, and 2 are respresented by red, grey, and blue tiles respectively."),
br(),
fluidRow(
tabBox(width = 12,
tabPanel("Particle Characterization",
fluidRow(
plotlyOutput("particle_plotly", height = "600px")),