-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathui.R
712 lines (501 loc) · 21 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
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
################################################
#
# THE GENETIC MAP COMPARATOR
#
###############################################
shinyUI(navbarPage(
"The Genetic Map Comparator",
# Choose a theme !
theme = shinytheme("united"),
# And I custom it with additionnal CSS
header=includeCSS("www/genComp.css") ,
# --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
# ----------------------
# SHEET 1 : HOME PAGE
# ----------------------
tabPanel(
# Name
h4(legend1[1]) ,
# Only one zone for the home page
column(12, offset=0, align="center" ,
# Set the style of this page
style="
background-image: url(my_image.png);
opacity: 1;
background-color: black;
margin-top: -20px;
width: 100%;
color: white;
font-size:14pt;
",
# And write the welcome message
br(""),
#helpText(strong(legend1[2] , style="color:white ; font-family: 'times'; font-size:50pt ; font-type:bold" ) ) ,
#br(""),
helpText(strong(p(legend1[3] , style="color:white ; font-family: 'times'; font-size:18pt"))) ,
#br(""),
# widget to choose several files:
fileInput("file1", strong(p(legend1[4] , style="color:orange ; font-family: 'times'; font-size:18pt")) , multiple = TRUE, accept=NULL),
uiOutput("error_message"),
# widget to propose 3 exemples
radioButtons("file2", strong(p(legend1[5] , style="color:orange ; font-family: 'times'; font-size:18pt")), choices = c("sorghum (Mace et al. 2009)","wheat (Maccaferri et al. 2015)", "wheat (Holtz et al. 2016)"), selected =c("sorghum (Mace et al. 2009)") , inline = FALSE ),
#br(),
helpText(strong(p(legend1[6] , style="color:orange ; font-family: 'times'; font-size:18pt"))) ,
#legend1[7],
# Last part with our names. Not in the legend file..
br(""),br(""),br(""),
p(
legend1[8],
a(em("Yan Holtz") , style="color:white ; font-family:'times'; font-size:15pt", href = "https://holtzyan.wordpress.com/" , target="_blank"),
" & ",
a(em("Vincent Ranwez") , style="color:white ; font-family:'times'; font-size:15pt", href = "https://sites.google.com/site/ranwez/" , target="_blank"),
" & ",
a(em("Jacques David") , style="color:white ; font-family:'times'; font-size:15pt", href = "https://www.researchgate.net/profile/Jacques_David4" , target="_blank"),
style="color:white ; font-family: 'times'; font-size:15pt"
),
br(""),br(""),br(""),br(""),br(""),br(""),br(""),br(""),br(""),br("")
#Close column
)
#Close the tabPanel
),
# --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
# ----------------------
# SHEET 2 : SUMMARY STATISTICS
# ----------------------
tabPanel(
#Name
h4(legend2[1]),
# ==== Title 2 in Orange
fluidRow(align="center",
style="opacity:0.9; background-color: white ;margin-top: 0px; width: 100%;",
column(6,offset=3,
br(),
helpText( strong(legend2[5] , style="color:Orange ; font-family: 'times'; font-size:30pt ; font-type:bold" )) ,
hr()
)),
# === Some text to explain the Figure:
fluidRow(align="justify",
style="opacity:0.9; background-color: white ;margin-top: 0px; width: 100%;",
column(6,offset=3,
br(),legend2[6],br()
)
),br(),br(),
# === One widget to select maps and variables for pie and barplot:
fluidRow( align="center",
style="opacity:0.9; background-color: white ;margin-top: 0px; width: 100%;",
column(6,offset=3,
wellPanel(uiOutput("choose_maps_sheet2_bis"))
)
),
# === Fluid row for the summary table
br(""),
fluidRow(align="center",
column(12, offset=0,
dataTableOutput('sum_table' , width="700px")
)
),br(),br(),
# ==== Title in Orange
fluidRow(align="center",
style="opacity:0.9; background-color: white ;margin-top: 0px; width: 100%;",
column(6,offset=3,
br(),
helpText( strong(legend2[2] , style="color:Orange ; font-family: 'times'; font-size:30pt ; font-type:bold" )) ,
hr()
)),
# === Some text to explain the Figure:
fluidRow(align="justify",
style="opacity:0.9; background-color: white ;margin-top: 0px; width: 100%;",
column(6,offset=3,
br(),legend2[3],br(),br(),legend2[4],br(),br(),legend2[12]
)
),br(),br(),
# === Two widgets to select maps and variables for pie and barplot:
fluidRow(
style="opacity:0.9; background-color: white ;margin-top: 0px; width: 100%;",
column(3,offset=3,
wellPanel(uiOutput("choose_maps_sheet2"))
),
column(3,offset=0,
#wellPanel(radioButtons( "var_for_barplot", legend2[41], choices = c("nb. marker","size","average gap","biggest gap","Nb. uniq pos."), selected =c("nb. marker") , inline = FALSE ))
wellPanel(radioButtons( "var_for_barplot", legend2[13], choices = c("# markers","map size","average gap size","biggest gap size","# unique positions"), selected =c("# markers") , inline = FALSE ))
)
),
# === Bar and pieplot whit corresponding widget
fluidRow(
# PiePlot
column(3, offset=1, plotOutput("my_pieplot", height = "500px" , width = "500px" ) ),
#Barplot
column(7 , plotOutput("my_barplot" , height = "500px" , width = "1000px") )
),br(),
# === Separation
#fluidRow( column( 6,offset=3, hr())),
# ==== Title 3 in Orange
fluidRow(align="center",
style="opacity:0.9; background-color: white ;margin-top: 0px; width: 100%;",
column(6,offset=3,
br(),
helpText( strong(legend2[7] , style="color:Orange ; font-family: 'times'; font-size:30pt ; font-type:bold" )) ,
hr()
)),
# === Some text to explain the Figure:
fluidRow(align="justify",
style="opacity:0.9; background-color: white ;margin-top: 0px; width: 100%;",
column(6,offset=3,
br(),legend2[8],br()
)
),br(),br(),
# === One widget to select maps and variables for pie and barplot:
fluidRow( align="center",
style="opacity:0.9; background-color: white ;margin-top: 0px; width: 100%;",
column(6,offset=3,
wellPanel(uiOutput("choose_chromo_sheet2"))
)
),
# === Fluid row for the density plot !
br(""),
fluidRow(align="center",
column(12, offset=0,
plotOutput("circular_plot" , height = "1200px" , width = "900px" )
)
),br(),br()
#Close the tabPanel
),
# --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
# ----------------------
# SHEET 3 : COMPARISON OF MAPS
# ----------------------
tabPanel( class = "two",
#Name
h4(legend3[1]) ,
# ==== Title in Orange
fluidRow(align="center",
style="opacity:0.9; background-color: white ;margin-top: 0px; width: 100%;",
column(6,offset=3,
br(),
helpText( strong(legend3[2] , style="color:Orange ; font-family: 'times'; font-size:30pt ; font-type:bold" )) ,
hr()
)),
# === Some text to explain the Figure:
fluidRow(align="justify",
style="opacity:0.9; background-color: white ;margin-top: 0px; width: 100%;",
column(6,offset=3,
br(),legend3[3],legend3[6],br(),br(),legend3[7],a(em("colour.") , style="color:blue", href = "http://www.color-hex.com/" , target="_blank"),
br(),br(),legend3[8],br()
)),br(),br(),
# === 2 first widgets
fluidRow( align="center",
column(6,offset=3,
style="opacity:0.9; background-color: white ;margin-top: 0px; width: 100%;",
column(3,offset=0, wellPanel(uiOutput("choose_chromo_sheet3"))),
column(3,offset=0, wellPanel(uiOutput("choose_maps3")))
)),
# === 2 Next widgets
fluidRow( align="center",
column(6,offset=3,
style="opacity:0.9; background-color: white ;margin-top: 0px; width: 100%;",
column(3,offset=0, wellPanel(checkboxInput("ask_for_normalize", "normalize map lenghts?", value = FALSE, width = NULL))),
br(),column(3,offset=0, downloadButton("downloadID", label = "Download problematic markers"))
)),
# === Separation
fluidRow( column( 6,offset=3, hr())),
# === Comparison graph
column(11, offset=1,
br(""), plotlyOutput("plot1" , height = "800px")
),
# === 3 next widgets
fluidRow(column(4,offset=2, style="opacity:0.9; color:grey","Custom colors / font" )),
fluidRow(column(4,offset=2, style="opacity:0.9; color:grey", hr() )),
fluidRow(column( 12, offset=0,
style="opacity:0.9; background-color: white ;margin-top: 0px; width: 100%;",
column(3,offset=0, wellPanel( colourInput("my_color", "Line colour", "#BDA3CC", allowTransparent = TRUE))),
column(3,offset=0, wellPanel( colourInput("my_color_bad", "Line colour (suspect marker)", "#9B9AA6", allowTransparent = TRUE))),
column(3,offset=0, wellPanel( colourInput("my_color_name", "Map names colour", "#ED880C", allowTransparent = TRUE))),
column(3,offset=0, wellPanel( sliderInput("thickness", "Line thickness:", min=0.1, max=12, value=2.0)))
)),
br(),br(),br(),br(),br(),br()
#Close the tabPanel
),
# --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
# ----------------------
# SHEET 4 : INTERCHROMOSOME ANALYSIS
# ----------------------
tabPanel(
#Name
h4(legend4[1]),
# ==== Title in Orange
fluidRow(align="center",
style="opacity:0.9; background-color: white ;margin-top: 0px; width: 100%;",
column(6,offset=3,
br(),
helpText( strong(legend4[2] , style="color:Orange ; font-family: 'times'; font-size:30pt ; font-type:bold" )) ,
hr()
)),
# === Some text to explain the Figure:
fluidRow(align="justify",
style="opacity:0.9; background-color: white ;margin-top: 0px; width: 100%;",
column(6,offset=3,
br(),legend4[3],br()
)
),br(),br(),
# === Left column to choose input
fluidRow(column(2,
# Make som space
br(""), br(""),
# Choose the chromosome
wellPanel(uiOutput("choose_chromo_sheet4")),
br(),
# Choix de la map1
wellPanel(uiOutput("map1")),
# Choix de la map2
wellPanel(uiOutput("map2")),
br(),br(),br(),br(),br()
#Close column
),
# === On the space left, I add the plot and color widget:
column(8,
br(),
plotlyOutput("plot2" , height = "700px" , width = "900px"),
br(),br()
#Close column
),
# === Key numbers
column(2,
br(), plotOutput("key_numbers_sheet_3", height = "500px" , width = "350px"), br(),br()
)),
# === Last line to choose colors
fluidRow(column(4,offset=2, style="opacity:0.9; color:grey","Custom colors" )),
fluidRow(column(4,offset=2, style="opacity:0.9; color:grey", hr() )),
fluidRow(column( 9, offset=2,
column(3, colourInput("col_s4_1", "Background Squares", "#BDA3CC", allowTransparent = TRUE)),
column(3, colourInput("col_s4_2", "Markers", "#48444A", allowTransparent = TRUE)),
column(3, colourInput("col_s4_3", "Markers (Interchromosome)", "#DB0913", allowTransparent = TRUE)),
column(3, colourInput("col_s4_4", "Chromosome name", "#FFA500", allowTransparent = TRUE))
)),
br(),br(),br(),br(),"",br(),br(),br(),"",br(),br(),br()
#Close the tabPanel
),
# --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
# ----------------------
# SHEET 5 : RAW MAP
# ----------------------
tabPanel(
#Name
h4(legend5[1]),
# ==== Title in Orange
fluidRow(align="center",
style="opacity:0.9; background-color: white ;margin-top: 0px; width: 100%;",
column(6,offset=3,
br(),
helpText( strong(legend5[6] , style="color:Orange ; font-family: 'times'; font-size:30pt ; font-type:bold" )) ,
hr()
)),
# === Some text to explain the Figure:
fluidRow(align="justify",
style="opacity:0.9; background-color: white ;margin-top: 0px; width: 100%;",
column(6,offset=3,
br(),legend5[2],legend5[5],br(),br(),legend5[7],br(),
column(5,textInput("text_mark_remove", label = "", value = "Type marker name or pattern...")),
column(5,radioButtons("keep_or_remove", "", choices = c("keep","remove"), selected =c("remove") , inline = T ))
),
column(6,offset=3,helpText("e.g. '.*25.*' ", style="color:Grey") )
),br(),
# Left column to choose input
column(2,
# Make som space
br(""),
# Choix de la map
wellPanel(uiOutput("choose_maps5")),
# Choose chromosome
br(""),
wellPanel(uiOutput("choose_chromo_sheet5"))
#Close column
),
# On the space left, I add the plot
column(6, offset=2,
br(""),
dataTableOutput('my_rough_map_viz' , width="500px")
#Close column
),br(),br(),br(),
# Legend of the plot
column(2,
br(),br(),br(),br(),br(),br()
#,helpText(strong(p(legend5[2] , style="color:grey ; font-family: 'times'; font-size:12pt"))),br(),br(),
#helpText(strong(p(legend5[5] , style="color:grey ; font-family: 'times'; font-size:12pt")))
#Close column
)
#Close the tabPanel
),
# --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
# ----------------------
# SHEET 6: DOCUMENTATION
# ----------------------
tabPanel(
#Name
h4(legend6[1]),
# ==== About section
fluidRow(align="center",
style="opacity:0.9; background-color: white ;margin-top: 0px; width: 100%;",
column(6,offset=3,
br(),
helpText( strong(legend6[2] , style="color:Orange ; font-family: 'times'; font-size:30pt ; font-type:bold" )) ,
hr()
)),
fluidRow(
style="opacity:0.9; background-color: white ;margin-top: 0px; width: 100%;",
column(3,offset=3, align="justify",
br(),
legend6[3],a("SNiPlay",href="http://sniplay.southgreen.fr/", target="_blank"),"[1] useful.",
br()
),
column(3,offset=0, align="justify",
br(),
legend6[4],
br()
)), br(),br(),
# ==== Input files description
fluidRow(align="center",
style="opacity:0.9; background-color: white ;margin-top: 0px; width: 100%;",
column(6,offset=3,
br(),
helpText( strong(legend6[5] , style="color:Orange ; font-family: 'times'; font-size:30pt ; font-type:bold" )) ,
hr()
)),
fluidRow(align="justify",
style="opacity:0.9; background-color: white ;margin-top: 0px; width: 100%;",
column(6,offset=3,
br(),
legend6[6],
br()
)),
br(),
fluidRow(
style="opacity:0.9; background-color: white ;margin-top: 0px; width: 100%;",
column(3,offset=1,align="center",
br(),br(),
a("OneMap",href="https://cran.r-project.org/web/packages/onemap/onemap.pdf", target="_blank")," [2] format: 3 columns: linkage group, marker name and position in the map.",
downloadLink("load_ex_format1", label = "Download"),br(),
dataTableOutput('doc_ex1' , width="100px"),
br()
),
column(3,offset=1,align="center",
br(),
a("MapChart",href="http://jhered.oxfordjournals.org/content/93/1/77.full", target="_blank")," [3] format: composed of a sequence of linkage groups, each with a header specifying the linkage group title, followed by a sequence of lines with locus names and map positions.",
downloadLink("load_ex_format2", label = "Download"),
dataTableOutput('doc_ex2' , width="100px"),
br()
),
column(3,offset=1,align="center",
br(),
a("Carthagène",href="http://www7.inra.fr/mia/T/CarthaGene/", target="_blank"), " [4] format: 1 line only. Linkage groups are separated with {}. Then marker names and positions are provided successively. Output created with the \'mapget\' command.",
downloadLink("load_ex_format3", label = "Download"),br(),
dataTableOutput('doc_ex3' , width="300px"),
br()
)
), br(),
# ==== Use the app locally
fluidRow(align="center",
style="opacity: 1;background-color:white; margin-top: 0px;width: 100%;",
column(6,offset=3,
# Set the style of this page
br(),
helpText(strong(legend6[11] , style="color:orange ; font-family: 'times'; font-size:30pt ; font-type:bold" ) ) ,
hr()
)),
fluidRow(align="justify",
style="opacity:0.9; background-color: white ;margin-top: 0px; width: 100%;",
column(6,offset=3,
br(),
legend6[12],br(),br(),
legend6[13],a("Install R",href="https://www.r-project.org/", target="_blank"),legend6[16],br(),br(),
legend6[14],br(),
code("install.packages(shiny)"),br(),
code("library(shiny)"),br(),br(),
legend6[15],br(),
code("runGitHub(\"GenMap-Comparator\",\"holtzy\")"),br(),
br(),
"see also the ", a("geneticMapComparator github repository", href="https://github.com/holtzy/GenMap-Comparator", target="_blank"),br()
)
),
# ==== Sharing maps
fluidRow(align="center",
style="opacity: 1;background-color:white; margin-top: 0px;width: 100%;",
column(6,offset=3,
# Set the style of this page
br(),
helpText(strong(legend6[17] , style="color:orange ; font-family: 'times'; font-size:30pt ; font-type:bold" ) ) ,
hr()
)),
fluidRow(align="justify",
style="opacity:0.9; background-color: white ;margin-top: 0px; width: 100%;",
column(6,offset=3,
br(),
legend6[18],br(),br(),
br(),br()
)
),
# ==== Contact
fluidRow(align="center",
style="opacity: 1;background-color:white; margin-top: 0px;width: 100%;",
column(6,offset=3,
# Set the style of this page
br(),
helpText(strong(legend6[10] , style="color:orange ; font-family: 'times'; font-size:30pt ; font-type:bold" ) ) ,
hr()
)),
fluidRow( align="center",
style="opacity: 1;background-color:white; margin-top: 0px;width: 100%;",
column(6,offset=3,
img(src="map_montpellier.png" , width = 400),
br()
),
column(6,offset=3,
br(),
"Vincent Ranwez: [email protected]",br(),
"Ge2pop Team, Bâtiment Arcad",br(),
"10 rue Arthur Young",br(),
"34090 MONTPELLIER, FRANCE",br()
)
),
# fluidRow(column(6,offset=3,hr())) , br() ,
#Black line?
#fluidRow( style=" opacity: 0.8 ; background-color: white ; margin-top: 0px ; width: 100%; " ), br(),
# ==== References
fluidRow(align="center",
style="opacity: 1;background-color:white; margin-top: 0px;width: 100%;",
column(6,offset=3,
# Set the style of this page
br(),
helpText(strong("- References -" , style="color:orange ; font-family: 'times'; font-size:30pt ; font-type:bold" ) ) ,
hr()
)),
fluidRow(align="left",
style="opacity:0.9; background-color: white ;margin-top: 0px; width: 100%;",
column(6,offset=3,
br(),
"1. Dereeper A., Nicolas S., Lecunff L., Bacilieri R., Doligez A., Peros JP., Ruiz M., This P. SNiPlay: a web-based tool for detection, management and analysis of SNPs. Application to grapevine diversity projects.. BMC Bioinformatics. 2011. May 5;12(1):134. ", br(),
"2. Margarido GRA, Souza AP, Garcia AAF. OneMap: software for genetic mapping in outcrossing species. Hereditas. Wiley Online Library; 2007;144: 78–79.", br(),
"3. Lander ES, Green P, Abrahamson J, Barlow A, Daly MJ, Lincoln SE, et al. MAPMAKER: an interactive computer package for constructing primary genetic linkage maps of experimental and natural populations. Genomics. Elsevier; 1987;1: 174–181.", br(),
"4. de Givry S, Bouchez M, Chabrier P, Milan D, Schiex T. CARTHAGENE: Multipopulation integrated genetic and radiation hybrid mapping. Bioinformatics. 2005;21: 1703–1704.", br(),
br(), br()
)),
# === Last bandeau for the logos
fluidRow(
# Set the style of this page
style=" opacity: 0.8 ; background-color: black ; margin-top: 0px ; width: 100%; ",
# put the logos
br(),
column(2, offset=2, img(src="logo_INRAE.png", height = 40 ) , br(),br() ),
column(2, offset=1, img(src="logo-institut-agro-montpellier.png", height = 40 ) ),
column(2, offset=1, img(src="logo_arvalis.png", height = 40) )
#column(2, offset=1, img(src="logo_arvalis.png" , height = 70*grand, width = 110*grand) )
)
#Close the tabPanel
)
# --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#Close the shinyUI
))