-
Notifications
You must be signed in to change notification settings - Fork 47
/
Copy pathui.R
3760 lines (3755 loc) · 222 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
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
options(warn=-1)
library(RLumShiny)
shinyUI(fluidPage(theme="newstyle.css",
title = "shinyCircos",
windowTitle = "interactive creation of Circos plots",
tags$head(tags$script(HTML('Shiny.addCustomMessageHandler("jsCode",function(message) {eval(message.value);});'))),
titlePanel(HTML('<p><font size="6">shinyCircos: an R/Shiny application for interactive creation of Circos plot</font></p>'),
## *** Add some custom CSS; customize the look of the header ***
tags$head(tags$style(type="text/css", "label.radio { display: inline-block; }", ".radio input[type=\"radio\"] { float: none; }"),
tags$style(type="text/css", "select { max-width: 200px; }"),
tags$style(type="text/css", "textarea { max-width: 185px; }"),
tags$style(type="text/css", ".jslider { max-width: 200px; }"),
tags$style(type='text/css', ".well { max-width: 330px; }"),
tags$style(type='text/css', ".span4 { max-width: 330px; }"),
tags$style(HTML(".shiny-output-error-validation {color: red;}"))
)
),
sidebarLayout(
sidebarPanel(
## *** About panel***
conditionalPanel(condition="input.tabs1=='About'",
h4("About")
),
## *** Data upload panel***
conditionalPanel(condition="input.tabs1=='Data upload'",
fileInput("uploadChr", HTML("<table><tr><td><strong>Upload chromosome data</strong></td>
<td>
<div class='help-tip'>
<p>Upload chromosome data for the outermost track which is a compulsory part of a circos plot.</p>
</div></td></tr>
</table>
"), multiple = FALSE),
tags$script('$( "#uploadChr" ).on( "click", function() { this.value = null; });'),
radioButtons("datatypeChr", HTML("<table><tr><td><strong>Data type</strong></td>
<td>
<div class='help-tip'>
<p>Chromosomes data can be either general data with three columns or cytoband data with five columns.
The first three columns of either type of data should be the chromosome ID,
the start and end coordinates of different genomic regions. See example data for more details.</p>
</div></td></tr>
</table>
"), c("General" = "general", "Cytoband" = "")),
fileInput("markTrackfile0", HTML("<table><tr><td><strong>Upload label data</strong></td>
<td>
<div class='help-tip'>
<p>Label data are used to mark genes or genomic regions which is a optional part of a circos plot. The four columns of label data should be chromosome ID,
start coordinate, end coordinate and label text. Label text can be numbers or character strings. See example data for more details.</p>
</div></td></tr>
</table>
"), multiple = FALSE),
tags$script('$( "#markTrackfile0" ).on( "click", function() { this.value = null; });'),
HTML("<table><tr><td><strong>Upload data for inner tracks</strong></td>
<td>
<div class='help-tip'>
<p>Data of zero or more tracks can be uploaded. For now, a maximum of 10 tracks are allowed.
For any track, the first three columns of the uploaded data should be chromosome ID, the start
and end coordinates of genomic regions. For plot of point, line and bar, the uploaded data can
contain one or more columns to indicate the 'color', 'cex' or 'pch' used in the plot.
'cex' is used to control the size of data points while 'pch' is used to specify the
symbols used in plot of point. See example data for more details.</p>
</div></td></tr>
</table>
"),
checkboxInput("seltrack1", HTML("<font color='red'>Track1</font>"), FALSE),
conditionalPanel(condition="input.seltrack1",
radioButtons("uploadtrack1", NULL, c("NULL" = "1", "Upload" = "2"), "1"),
conditionalPanel(condition="input.uploadtrack1 == '2'",
fileInput("uploadTrackfile1", "Upload track1 data:", multiple = FALSE),
tags$script('$( "#uploadTrackfile1" ).on( "click", function() { this.value = null; });'),
selectInput("typeTrack1", "Plot type:", choices = c("point", "line", "bar", "rect", "heatmap", "ideogram"), selected="point"),
fileInput("markTrackfile1", HTML("<table><tr><td><strong>Upload label data</strong></td>
<td>
<div class='help-tip'>
<p>Label data are used to mark genes or genomic regions which is a optional part of a circos plot. The four columns of label data should be chromosome ID,
start coordinate, end coordinate and label text. Label text can be numbers or character strings. See example data for more details.</p>
</div></td></tr>
</table>
"), multiple = FALSE),
tags$script('$( "#markTrackfile1" ).on( "click", function() { this.value = null; });')
)
),
checkboxInput("seltrack2", HTML("<font color='red'>Track2</font>"), FALSE),
conditionalPanel(condition="input.seltrack2",
radioButtons("uploadtrack2", NULL, c("NULL" = "1", "Upload" = "2"), "1"),
conditionalPanel(condition="input.uploadtrack2 == '2'",
fileInput("uploadTrackfile2", "Upload track2 data:", multiple = FALSE),
tags$script('$( "#uploadTrackfile2" ).on( "click", function() { this.value = null; });'),
selectInput("typeTrack2", "Plot type:", choices = c("point", "line", "bar", "rect", "heatmap", "ideogram"), selected="line"),
fileInput("markTrackfile2", HTML("<table><tr><td><strong>Upload label data</strong></td>
<td>
<div class='help-tip'>
<p>Label data are used to mark genes or genomic regions which is a optional part of a circos plot. The four columns of label data should be chromosome ID,
start coordinate, end coordinate and label text. Label text can be numbers or character strings. See example data for more details.</p>
</div></td></tr>
</table>
"), multiple = FALSE),
tags$script('$( "#markTrackfile2" ).on( "click", function() { this.value = null; });')
)
),
checkboxInput("seltrack3", HTML("<font color='red'>Track3</font>"), FALSE),
conditionalPanel(condition="input.seltrack3",
radioButtons("uploadtrack3", NULL, c("NULL" = "1", "Upload" = "2"), "1"),
conditionalPanel(condition="input.uploadtrack3 == '2'",
fileInput("uploadTrackfile3", "Upload track3 data:", multiple = FALSE),
tags$script('$( "#uploadTrackfile3" ).on( "click", function() { this.value = null; });'),
selectInput("typeTrack3", "Plot type:", choices = c("point", "line", "bar", "rect", "heatmap", "ideogram"), selected="bar"),
fileInput("markTrackfile3", HTML("<table><tr><td><strong>Upload label data</strong></td>
<td>
<div class='help-tip'>
<p>Label data are used to mark genes or genomic regions which is a optional part of a circos plot. The four columns of label data should be chromosome ID,
start coordinate, end coordinate and label text. Label text can be numbers or character strings. See example data for more details.</p>
</div></td></tr>
</table>
"), multiple = FALSE),
tags$script('$( "#markTrackfile3" ).on( "click", function() { this.value = null; });')
)
),
checkboxInput("seltrack4", HTML("<font color='red'>Track4</font>"), FALSE),
conditionalPanel(condition="input.seltrack4",
radioButtons("uploadtrack4", NULL, c("NULL" = "1", "Upload" = "2"), "1"),
conditionalPanel(condition="input.uploadtrack4 == '2'",
fileInput("uploadTrackfile4", "Upload track4 data:", multiple = FALSE),
tags$script('$( "#uploadTrackfile4" ).on( "click", function() { this.value = null; });'),
selectInput("typeTrack4", "Plot type:", choices = c("point", "line", "bar", "rect", "heatmap", "ideogram"), selected="heatmap"),
fileInput("markTrackfile4", HTML("<table><tr><td><strong>Upload label data</strong></td>
<td>
<div class='help-tip'>
<p>Label data are used to mark genes or genomic regions which is a optional part of a circos plot. The four columns of label data should be chromosome ID,
start coordinate, end coordinate and label text. Label text can be numbers or character strings. See example data for more details.</p>
</div></td></tr>
</table>
"), multiple = FALSE),
tags$script('$( "#markTrackfile4" ).on( "click", function() { this.value = null; });')
)
),
checkboxInput("seltrack5", HTML("<font color='red'>Track5</font>"), FALSE),
conditionalPanel(condition="input.seltrack5",
radioButtons("uploadtrack5", NULL, c("NULL" = "1", "Upload" = "2"), "1"),
conditionalPanel(condition="input.uploadtrack5 == '2'",
fileInput("uploadTrackfile5", "Upload track5 data:", multiple = FALSE),
tags$script('$( "#uploadTrackfile5" ).on( "click", function() { this.value = null; });'),
selectInput("typeTrack5", "Plot type:", choices = c("point", "line", "bar", "rect", "heatmap", "ideogram"), selected="bar"),
fileInput("markTrackfile5", HTML("<table><tr><td><strong>Upload label data</strong></td>
<td>
<div class='help-tip'>
<p>Label data are used to mark genes or genomic regions which is a optional part of a circos plot. The four columns of label data should be chromosome ID,
start coordinate, end coordinate and label text. Label text can be numbers or character strings. See example data for more details.</p>
</div></td></tr>
</table>
"), multiple = FALSE),
tags$script('$( "#markTrackfile5" ).on( "click", function() { this.value = null; });')
)
),
checkboxInput("seltrack6", HTML("<font color='red'>Track6</font>"), FALSE),
conditionalPanel(condition="input.seltrack6",
radioButtons("uploadtrack6", NULL, c("NULL" = "1", "Upload" = "2"), "1"),
conditionalPanel(condition="input.uploadtrack6 == '2'",
fileInput("uploadTrackfile6", "Upload track6 data:", multiple = FALSE),
tags$script('$( "#uploadTrackfile6" ).on( "click", function() { this.value = null; });'),
selectInput("typeTrack6", "Plot type:", choices = c("point", "line", "bar", "rect", "heatmap", "ideogram"), selected="rect"),
fileInput("markTrackfile6", HTML("<table><tr><td><strong>Upload label data</strong></td>
<td>
<div class='help-tip'>
<p>Label data are used to mark genes or genomic regions which is a optional part of a circos plot. The four columns of label data should be chromosome ID,
start coordinate, end coordinate and label text. Label text can be numbers or character strings. See example data for more details.</p>
</div></td></tr>
</table>
"), multiple = FALSE),
tags$script('$( "#markTrackfile6" ).on( "click", function() { this.value = null; });')
)
),
checkboxInput("seltrack7", HTML("<font color='red'>Track7</font>"), FALSE),
conditionalPanel(condition="input.seltrack7",
radioButtons("uploadtrack7", NULL, c("NULL" = "1", "Upload" = "2"), "1"),
conditionalPanel(condition="input.uploadtrack7 == '2'",
fileInput("uploadTrackfile7", "Upload track7 data:", multiple = FALSE),
tags$script('$( "#uploadTrackfile7" ).on( "click", function() { this.value = null; });'),
selectInput("typeTrack7", "Plot type:", choices = c("point", "line", "bar", "rect", "heatmap", "ideogram"), selected="point"),
fileInput("markTrackfile7", HTML("<table><tr><td><strong>Upload label data</strong></td>
<td>
<div class='help-tip'>
<p>Label data are used to mark genes or genomic regions which is a optional part of a circos plot. The four columns of label data should be chromosome ID,
start coordinate, end coordinate and label text. Label text can be numbers or character strings. See example data for more details.</p>
</div></td></tr>
</table>
"), multiple = FALSE),
tags$script('$( "#markTrackfile7" ).on( "click", function() { this.value = null; });')
)
),
checkboxInput("seltrack8", HTML("<font color='red'>Track8</font>"), FALSE),
conditionalPanel(condition="input.seltrack8",
radioButtons("uploadtrack8", NULL, c("NULL" = "1", "Upload" = "2"), "1"),
conditionalPanel(condition="input.uploadtrack8 == '2'",
fileInput("uploadTrackfile8", "Upload track8 data:", multiple = FALSE),
tags$script('$( "#uploadTrackfile8" ).on( "click", function() { this.value = null; });'),
selectInput("typeTrack8", "Plot type:", choices = c("point", "line", "bar", "rect", "heatmap", "ideogram"), selected="bar"),
fileInput("markTrackfile8", HTML("<table><tr><td><strong>Upload label data</strong></td>
<td>
<div class='help-tip'>
<p>Label data are used to mark genes or genomic regions which is a optional part of a circos plot. The four columns of label data should be chromosome ID,
start coordinate, end coordinate and label text. Label text can be numbers or character strings. See example data for more details.</p>
</div></td></tr>
</table>
"), multiple = FALSE),
tags$script('$( "#markTrackfile8" ).on( "click", function() { this.value = null; });')
)
),
checkboxInput("seltrack9", HTML("<font color='red'>Track9</font>"), FALSE),
conditionalPanel(condition="input.seltrack9",
radioButtons("uploadtrack9", NULL, c("NULL" = "1", "Upload" = "2"), "1"),
conditionalPanel(condition="input.uploadtrack9 == '2'",
fileInput("uploadTrackfile9", "Upload track9 data:", multiple = FALSE),
tags$script('$( "#uploadTrackfile9" ).on( "click", function() { this.value = null; });'),
selectInput("typeTrack9", "Plot type:", choices = c("point", "line", "bar", "rect", "heatmap", "ideogram"), selected="rect"),
fileInput("markTrackfile9", HTML("<table><tr><td><strong>Upload label data</strong></td>
<td>
<div class='help-tip'>
<p>Label data are used to mark genes or genomic regions which is a optional part of a circos plot. The four columns of label data should be chromosome ID,
start coordinate, end coordinate and label text. Label text can be numbers or character strings. See example data for more details.</p>
</div></td></tr>
</table>
"), multiple = FALSE),
tags$script('$( "#markTrackfile9" ).on( "click", function() { this.value = null; });')
)
),
checkboxInput("seltrack10", HTML("<font color='red'>Track10</font>"), FALSE),
conditionalPanel(condition="input.seltrack10",
radioButtons("uploadtrack10", NULL, c("NULL" = "1", "Upload" = "2"), "1"),
conditionalPanel(condition="input.uploadtrack10 == '2'",
fileInput("uploadTrackfile10", "Upload track10 data:", multiple = FALSE),
tags$script('$( "#uploadTrackfile10" ).on( "click", function() { this.value = null; });'),
selectInput("typeTrack10", "Plot type:", choices = c("point", "line", "bar", "rect", "heatmap", "ideogram"), selected="line"),
fileInput("markTrackfile10", HTML("<table><tr><td><strong>Upload label data</strong></td>
<td>
<div class='help-tip'>
<p>Label data are used to mark genes or genomic regions which is a optional part of a circos plot. The four columns of label data should be chromosome ID,
start coordinate, end coordinate and label text. Label text can be numbers or character strings. See example data for more details.</p>
</div></td></tr>
</table>
"), multiple = FALSE),
tags$script('$( "#markTrackfile10" ).on( "click", function() { this.value = null; });')
)
),
HTML('<br>'),
HTML("<table><tr><td><strong>Upload data to create links</strong></td>
<td>
<div class='help-tip'>
<p>Data to create links between different genomic regions should be composed of 6 or 7 columns.
The first three columns of each row represent the coordinate of a genomic region
while the 4th to 6th columns of each row represent the coordinate of another genomic region.
For data with 7 columns, the 7th column should be categorical
characters indicating varying colors or numbers indicating gradual colors used for different links. The name of the 7th column should be 'color'.
A link will be created between the two genomic regions in each row. See example data for more details.</p>
</div></td></tr>
</table>
"),
checkboxInput("linksTrack", "Links data", FALSE),
conditionalPanel(condition="input.linksTrack",
fileInput("linksFile", "Upload region data:", multiple = FALSE),
tags$script('$( "#linksFile" ).on( "click", function() { this.value = null; });')
),
HTML('<br>'),
HTML('<p>Data uploaded should use any of the separator in the set [,\\t |;:].</p>'),
HTML('<br>'),
actionButton("submit1", HTML("<table><tr><td><strong>Go!</strong></td>
<td>
<div class='help-tip'>
<p>Whenever the data are updated, please click 'Go!'.</p>
</div></td></tr>
</table>
"), width="49px")
),
## *** Circos visualization panel***
conditionalPanel(condition="input.tabs1=='Circos visualization'",
h4("Plot options"),
checkboxInput("optionsChr", HTML("<font color='red'>Chromosome</font>"), FALSE),
conditionalPanel(condition="input.optionsChr",
conditionalPanel(condition="input.datatypeChr=='general'",
radioButtons("trackChr", "Chromosome band", c("Show" = "track", "Hide" = "")),
conditionalPanel(condition="input.trackChr=='track'",
textInput("colorChr", HTML("<table><tr><td><strong>Color(s):</strong></td>
<td>
<div class='help-tip'>
<p>Colors to be used for each chromosome/sector. Character vector of arbitrary length representing
colors is accepted and adjusted automatically to the number of sectors.
For example, 'grey' or 'grey,red,green,blue'. Hex color codes as '#FF0000' are also supported.</p>
</div></td></tr>
</table>
"), value="grey")
)
),
conditionalPanel(condition="!(input.datatypeChr=='general' & input.trackChr=='')",
numericInput("heightChr", HTML("<table><tr><td>Band height:</td>
<td>
<div class='help-tip'>
<p>Height of the chromosome band, which should be greater than 0 and smaller than 0.9.</p>
</div></td></tr>
</table>
"), value=0.05, min=0.01, max=0.9, step=0.01)
),
radioButtons("outAxis", "Genomic position axis", c("Show" = "1", "Hide" = "2"), "1"),
conditionalPanel(condition="input.outAxis=='1'",
radioButtons("labelChr", "Chromosome IDs", c("Show" = "labels", "Hide" = "axis")),
radioButtons("unitChr", "Size units of genomic regions", c("Show" = "unit", "Hide" = ""))
),
textInput("gapChr", HTML("<table><tr><td><strong>Gap width(s):</strong></td>
<td>
<div class='help-tip'>
<p>Gaps between neighbouring sectors. Numeric vector of arbitrary length is accepted and
adjusted automatically to the number of sectors. For example, '1' or '1,2,3,1'. The first
value corresponds to the gap between the first and the second sector.</p>
</div></td></tr>
</table>
"), value="1"),
conditionalPanel(condition="output.chrlabel",
radioButtons("labels0", HTML("<table><tr><td><strong>Add labels</strong></td>
<td>
<div class='help-tip'>
<p>Add labels to mark genes or genomic regions for this track using data uploaded in the 'Data upload' menu.</p>
</div></td></tr>
</table>
"), c("Yes" = "1", "No" = "2"), selected="2")
),
conditionalPanel(condition="input.labels0==1 & input.trackChr=='track'",
radioButtons("poslabels0", "Labels position", c("Outer" = "outer", "Inner" = "inner"),selected="inner"),
numericInput("heightlabels0", HTML("<table><tr><td><strong>Labels height:</strong></td>
<td>
<div class='help-tip'>
<p>Height of the labels, which should be greater than 0.</p>
</div></td></tr>
</table>
"), value=0.06, min=0, max=0.8, step=0.01),
numericInput("marginlabels0", HTML("<table><tr><td><strong>Labels margin:</strong></td>
<td>
<div class='help-tip'>
<p>Margin size of the labels.</p>
</div></td></tr>
</table>
"), value=0.01, min=0, max=0.8, step=0.005)
),
conditionalPanel(condition="input.datatypeChr!='general' | input.trackChr=='track'",
textInput("text0", HTML("<table><tr><td><strong>Legend text</strong></td>
<td>
<div class='help-tip'>
<p>The text to appear in the legend.</p>
</div></td></tr>
</table>
"), value=NULL)
)
),
checkboxInput("optionsTrack1", HTML("<font color='red'>Track1</font>"), FALSE),
conditionalPanel(condition="input.optionsTrack1 & input.uploadtrack1 == '2'",
conditionalPanel(condition="input.typeTrack1=='bar'",
radioButtons("directionTrack1", HTML("<table><tr><td><strong>Bar direction</strong></td>
<td>
<div class='help-tip'>
<p>Bars can be unidirectional or bidirectional. For bidirectional bars, the 4th column which
contains the data values will be divided into two groups based on the boundary value.</p>
</div></td></tr>
</table>
"), c("Unidirectional" = "1", "Bidirectional" = "2"), selected="1"),
conditionalPanel(condition="input.directionTrack1=='2'",
numericInput("barBoundary1", "Boundary value:", value=0, step=0.01),
textInput("coldir1Track1", "Outer color:", value="red"),
textInput("coldir2Track1", "Inner color:", value="cyan")
)
),
conditionalPanel(condition="input.typeTrack1!='rect' & input.typeTrack1!='heatmap' & input.typeTrack1!='ideogram'",
conditionalPanel(condition="input.typeTrack1!='bar' | input.directionTrack1=='1'",
radioButtons("coltypeTrack1", HTML("<table><tr><td><strong>Data color</strong></td>
<td>
<div class='help-tip'>
<p>The color to be used to plot the data, which can be random assigned by the application or specified by the users.
To customize color for data with multiple columns, users should provide a character string representing one or multiple
colors separated by commas. For example, 'red' or 'red,orange,blue'.
To customize color for data with multiple groups, the column indicating different groups should be named as 'color' or 'stack'.
Users should provide a character strings assigning colors to each group.
For example, 'a:red;b:green;c:blue', in which 'a b c' represent different data groups.
Color for data groups without assigned color would be set as 'grey'.
Hex color codes as '#FF0000' are also supported. See example data for more details.</p>
</div></td></tr>
</table>
"), c("Random" = "1", "Custom for data with multi-column" = "2",
"Custom for data with multi-group" = "3"), selected="1"),
conditionalPanel(condition="input.coltypeTrack1=='2'",
textInput("colorTrack1", NULL, value="red,blue")
),
conditionalPanel(condition="input.coltypeTrack1=='3'",
textInput("colorcusTrack1", NULL, value="a:red;b:blue;c:cyan")
)
)
),
conditionalPanel(condition="input.typeTrack1=='line' & !output.stackmd1",
radioButtons("fillareaTrack1", HTML("<table><tr><td><strong>Fill area</strong></td>
<td>
<div class='help-tip'>
<p>Fill the area below the lines.</p>
</div></td></tr>
</table>
"), c("Yes" = "add", "No" = ""),selected="")
),
conditionalPanel(condition="input.typeTrack1=='rect'",
radioButtons("rectTrack1", HTML("<table><tr><td><strong>Data type</strong></td>
<td>
<div class='help-tip'>
<p>The rects are filled with gradual or discrete colors. For discrete data, the 4th column
should be a categorical character vector with no more than 50 groups. For gradual data, the 4th
column should be a numeric vector. See example data for more details.</p>
</div></td></tr>
</table>
"), c("Gradual" = "1", "Discrete" = "2"), selected="1"),
conditionalPanel(condition="input.rectTrack1=='2'",
radioButtons("rectcolTrack1", HTML("<table><tr><td><strong>Select color</strong></td>
<td>
<div class='help-tip'>
<p>The color to be used to plot the data, which can be random assigned by the application or specified by the users.
If 'Specific' was chosen, all data will be filled by a specified color.
If 'Custom' was chosen, the 4th column of the uploaded data should be a categorical character vector with no more than 50 groups.
Users should provide values as 'a:red;b:green;c:blue', in which 'a b c' represent different
data category indicated by the 4th column of the uploaded data.
Color for data without customed color will be set to NULL. Hex color codes as '#FF0000' are also supported.</p>
</div></td></tr>
</table>
"), c("Random" = "1", "Specific" = "2", "Custom" = "3"), selected="1"),
conditionalPanel(condition="input.rectcolTrack1=='2'",
textInput("rectcoldisTrack1", NULL, value="red")
),
conditionalPanel(condition="input.rectcolTrack1=='3'",
textInput("rectcoldiscusTrack1", NULL, value="a:red;b:blue;c:cyan")
)
),
conditionalPanel(condition="input.rectTrack1=='1'",
selectInput("colrectTrack1", NULL, choices = c("blue", "red", "green", "cyan", "purple", "pink", "orange",
"yellow", "navy", "seagreen", "maroon", "olivedrab", "gold",
"lightblue", "navy.yellow", "purple.seagreen", "navy.orange",
"navy.cyan", "blue.red", "green.red"))
)
),
conditionalPanel(condition="input.typeTrack1=='line' & !output.stackmd1 & input.fillareaTrack1=='add'",
radioButtons("selreaTrack1", HTML("<table><tr><td><strong>Area color</strong></td>
<td>
<div class='help-tip'>
<p>Filled color to the area, which can be identical with lines color or specified by the users. If 'Specific' was chosen, all data will be filled by a specified color as 'orange'.</p>
</div></td></tr>
</table>
"), c("Identical with lines" = "1", "Specific" = "2"),selected="1"),
conditionalPanel(condition="input.selreaTrack1=='2'",
textInput("borderareaTrack1", NULL, value="orange")
)
),
conditionalPanel(condition="input.typeTrack1!='heatmap' & input.typeTrack1!='ideogram'",
numericInput("transparencyTrack1", HTML("<table><tr><td>Color transparency:</td>
<td>
<div class='help-tip'>
<p>A decimal number in [0, 1] to adjust the color transparency. The higher the value, the deeper the color.</p>
</div></td></tr>
</table>
"), value=1, min=0, max=1, step=0.1)
),
conditionalPanel(condition="input.typeTrack1=='point' & output.stackmd1",
textInput("symbolTrack1", HTML("<table><tr><td><strong>Symbol type:</strong></td>
<td>
<div class='help-tip'>
<p>Symbols used for different points. Applicable value can be a number in [0-25] or a numeric vector of arbitrary length
adjusted automatically to the number of data categories. Type ?pch in R console for more details.</p>
</div></td></tr>
</table>
"), value="16"),
numericInput("pointsizeTrack1", "Point size:", value=0.6, min=0, max=1.5, step=0.05)
),
conditionalPanel(condition="input.typeTrack1!='rect' & input.typeTrack1!='heatmap' & input.typeTrack1!='ideogram' & !output.stackmd1",
textInput("baselineTrack1", HTML("<table><tr><td><strong>Y coordinates of baselines:</strong></td>
<td>
<div class='help-tip'>
<p>Decimal numbers in [0, 1] to adjust y axis coordinates of baselines. Numeric vector of arbitrary length is also accepted.
For example, '0.5' or '0.25,0.5,0.75'.</p>
</div></td></tr>
</table>
"), value="0.25,0.75")
),
conditionalPanel(condition="input.typeTrack1!='rect' & input.typeTrack1!='heatmap' & input.typeTrack1!='ideogram' & !(input.typeTrack1=='line' & output.stackmd1)",
textInput("colorlineTrack1", HTML("<table><tr><td><strong>Baselines color(s):</strong></td>
<td>
<div class='help-tip'>
<p>The color to be used for the baselines which can be null or a character vector of arbitrary length
adjusted automatically to the number of baselines. For example, 'grey' or 'red,green'.
Hex color codes as '#FF0000' are also supported.</p>
</div></td></tr>
</table>
"), value="grey")
),
conditionalPanel(condition="input.typeTrack1!='heatmap' & input.typeTrack1!='ideogram'",
textInput("bgcolTrack1", HTML("<table><tr><td><strong>Background color(s):</strong></td>
<td>
<div class='help-tip'>
<p>The color to be used for the background of the plot which can be null or a color vector of arbitrary length
adjusted automatically to the number of sectors. For example, 'grey95' or 'grey95,grey,pink,yellow'.
Hex color codes as '#FF0000' are also supported.</p>
</div></td></tr>
</table>
"), value="grey95")
),
conditionalPanel(condition="input.typeTrack1=='heatmap'",
radioButtons("heatmapcol1", HTML("<table><tr><td><strong>Colors</strong></td>
<td>
<div class='help-tip'>
<p>Colors to be used for the heatmap, which can be assigned by the application or specified by the users.</p>
</div></td></tr>
</table>
"), c("Typical" = "1", "Custom" = "2"), selected="1"),
conditionalPanel(condition="input.heatmapcol1=='1'",
selectInput("colhmapTrack1", NULL, choices = c("blue.white.red", "green.black.red", "green.yellow.red",
"purple.yellow.red", "blue.green.red", "blue.yellow.green",
"cyan.white.deeppink1"), selected="blue.white.red")
),
conditionalPanel(condition="input.heatmapcol1=='2'",
fluidRow(
column(4,jscolorInput("lowColor1", label = HTML('<p><font size="1.8"><strong>Low Color</strong></font></p>'), value = "#0016DB")),
column(4, jscolorInput("midColor1", label = HTML('<p><font size="1.8"><strong>Middle Color</strong></font></p>'), value = "#FFFFFF")),
column(4, jscolorInput("highColor1", label = HTML('<p><font size="1.8"><strong>High Color</strong></font></p>'), value = "#FFFF00"))),
HTML('<br>')
),
radioButtons("lineshmapTrack1", HTML("<table><tr><td><strong>Add position lines</strong></td>
<td>
<div class='help-tip'>
<p>Add genomic position lines between tracks, which can be used to identify the correspondance between heatmaps and regions.</p>
</div></td></tr>
</table>
"), c("Yes" = "1", "No" = "2"), selected="2"),
conditionalPanel(condition="input.lineshmapTrack1=='1'",
numericInput("heightlinesTrack1", HTML("<table><tr><td><strong>Position lines height:</strong></td>
<td>
<div class='help-tip'>
<p>Height of the position lines.</p>
</div></td></tr>
</table>
"), value=0.06, min=0, max=0.8, step=0.01),
numericInput("marginlinesTrack1", HTML("<table><tr><td><strong>Position lines margin:</strong></td>
<td>
<div class='help-tip'>
<p>Margin size of the position lines.</p>
</div></td></tr>
</table>
"), value=0.01, min=0, max=0.8, step=0.005)
)
),
numericInput("heightTrack1", HTML("<table><tr><td><strong>Track height:</strong></td>
<td>
<div class='help-tip'>
<p>Height of the track.</p>
</div></td></tr>
</table>
"), value=0.06, min=0, max=0.8, step=0.01),
numericInput("marginTrack1", HTML("<table><tr><td><strong>Track margin:</strong></td>
<td>
<div class='help-tip'>
<p>Margin size of the track.</p>
</div></td></tr>
</table>
"), value=0.01, min=0, max=0.8, step=0.005),
conditionalPanel(condition="input.typeTrack1=='heatmap'",
numericInput("innergapTrack1", HTML("<table><tr><td><strong>Inner gap:</strong></td>
<td>
<div class='help-tip'>
<p>Inner gap of the track.</p>
</div></td></tr>
</table>
"), value=0, min=0, max=0.5, step=0.05),
radioButtons("gridsborderTrack1", HTML("<table><tr><td><strong>Add cell borders</strong></td>
<td>
<div class='help-tip'>
<p>Add borders to the heatmap grids, which can separate cells from each other.</p>
</div></td></tr>
</table>
"), c("Yes" = "add", "No" = ""),selected=""),
conditionalPanel(condition="input.gridsborderTrack1=='add'",
textInput("colgridsborderTrack1", HTML("<table><tr><td><strong>Borders color:</strong></td>
<td>
<div class='help-tip'>
<p>The color to be used for the borders of heatmap grids. For example, 'white' or 'red'.
Hex color codes as '#FF0000' are also supported.</p>
</div></td></tr>
</table>
"), value="black")
)
),
conditionalPanel(condition="input.typeTrack1!='heatmap' & input.typeTrack1!='ideogram'",
radioButtons("borderTrack1", HTML("<table><tr><td><strong>Add borders</strong></td>
<td>
<div class='help-tip'>
<p>Add borders to the plotting regions.</p>
</div></td></tr>
</table>
"), c("Yes" = "add", "No" = ""),selected="")
),
conditionalPanel(condition="output.marklabel1",
radioButtons("labels1", HTML("<table><tr><td><strong>Add labels</strong></td>
<td>
<div class='help-tip'>
<p>Add labels to mark genes or genomic regions for this track using data uploaded in the 'Data upload' menu.</p>
</div></td></tr>
</table>
"), c("Yes" = "1", "No" = "2"), selected="2")
),
conditionalPanel(condition="input.labels1==1",
radioButtons("poslabels1", "Labels position", c("Outer" = "outer", "Inner" = "inner"),selected="outer"),
numericInput("heightlabels1", HTML("<table><tr><td><strong>Labels height:</strong></td>
<td>
<div class='help-tip'>
<p>Height of the labels, which should be greater than 0.</p>
</div></td></tr>
</table>
"), value=0.06, min=0, max=0.8, step=0.01),
numericInput("marginlabels1", HTML("<table><tr><td><strong>Labels margin:</strong></td>
<td>
<div class='help-tip'>
<p>Margin size of the labels.</p>
</div></td></tr>
</table>
"), value=0.01, min=0, max=0.8, step=0.005)
),
textInput("text1", HTML("<table><tr><td><strong>Legend text</strong></td>
<td>
<div class='help-tip'>
<p>The text to appear in the legend.</p>
</div></td></tr>
</table>
"), value=NULL),
conditionalPanel(condition="input.typeTrack1!='rect' & input.typeTrack1!='heatmap' & input.typeTrack1!='ideogram' & output.trackdat1 & !output.stackmd1",
radioButtons("highlightTrack1", HTML("<table><tr><td><strong>Highlight regions</strong></td>
<td>
<div class='help-tip'>
<p>Genomic regions to be highlighted with specified colors.</p>
</div></td></tr>
</table>
"), c("Show" = "1", "Hide" = "2"), selected="2"),
conditionalPanel(condition="input.highlightTrack1==1",
HTML("<table><tr><td>Paste data below:</td>
<td>
<div class='help-tip'>
<p>Each row should contain four components separated by commas including the chromosome ID, start coordinate, end coordinate and the specified color.
For example, 'chr1,1,100000000,red'. Hex color codes as '#FF0000' are also supported.</p>
</div></td></tr>
</table>
"),
tags$textarea(id="hltData1", rows=10, cols=30, ""),
HTML('<br>'),
HTML('<p>Data separated by commas.</p>'),
actionButton('clearText_button1','Clear data'),
numericInput("transparencyHlt1", HTML("<table><tr><td>Color transparency:</td>
<td>
<div class='help-tip'>
<p>A decimal number in [0, 1] to adjust the color transparency. The higher the value, the deeper the color.</p>
</div></td></tr>
</table>
"), value=1, min=0, max=1, step=0.1)
)
)
),
checkboxInput("optionsTrack2", HTML("<font color='red'>Track2</font>"), FALSE),
conditionalPanel(condition="input.optionsTrack2 & input.uploadtrack2 == '2'",
conditionalPanel(condition="input.typeTrack2=='bar'",
radioButtons("directionTrack2", HTML("<table><tr><td><strong>Bar direction</strong></td>
<td>
<div class='help-tip'>
<p>Bars can be unidirectional or bidirectional. For bidirectional bars, the 4th column which
contains the data values will be divided into two groups based on the boundary value.</p>
</div></td></tr>
</table>
"), c("Unidirectional" = "1", "Bidirectional" = "2"), selected="1"),
conditionalPanel(condition="input.directionTrack2=='2'",
numericInput("barBoundary2", "Boundary value:", value=0, step=0.01),
textInput("coldir1Track2", "Outer color:", value="red"),
textInput("coldir2Track2", "Inner color:", value="cyan")
)
),
conditionalPanel(condition="input.typeTrack2!='rect' & input.typeTrack2!='heatmap' & input.typeTrack2!='ideogram'",
conditionalPanel(condition="input.typeTrack2!='bar' | input.directionTrack2=='1'",
radioButtons("coltypeTrack2", HTML("<table><tr><td><strong>Data color</strong></td>
<td>
<div class='help-tip'>
<p>The color to be used to plot the data, which can be random assigned by the application or specified by the users.
To customize color for data with multiple columns, users should provide a character string representing one or multiple
colors separated by commas. For example, 'red' or 'red,orange,blue'.
To customize color for data with multiple groups, the column indicating different groups should be named as 'color' or 'stack'.
Users should provide a character strings assigning colors to each group.
For example, 'a:red;b:green;c:blue', in which 'a b c' represent different data groups.
Color for data groups without assigned color would be set as 'grey'.
Hex color codes as '#FF0000' are also supported. See example data for more details.</p>
</div></td></tr>
</table>
"), c("Random" = "1", "Custom for data with multi-column" = "2",
"Custom for data with multi-group" = "3"), selected="1"),
conditionalPanel(condition="input.coltypeTrack2=='2'",
textInput("colorTrack2", NULL, value="red,blue")
),
conditionalPanel(condition="input.coltypeTrack2=='3'",
textInput("colorcusTrack2", NULL, value="a:red;b:blue;c:cyan")
)
)
),
conditionalPanel(condition="input.typeTrack2=='line' & !output.stackmd2",
radioButtons("fillareaTrack2", HTML("<table><tr><td><strong>Fill area</strong></td>
<td>
<div class='help-tip'>
<p>Fill the area below the lines.</p>
</div></td></tr>
</table>
"), c("Yes" = "add", "No" = ""),selected="")
),
conditionalPanel(condition="input.typeTrack2=='rect'",
radioButtons("rectTrack2", HTML("<table><tr><td><strong>Data type</strong></td>
<td>
<div class='help-tip'>
<p>The rects are filled with gradual or discrete colors. For discrete data, the fourth column
should be a categorical character vector with no more than 50 groups. For gradual data, the fourth
column should be a numeric vector. See example data for more details.</p>
</div></td></tr>
</table>
"), c("Gradual" = "1", "Discrete" = "2"), selected="1"),
conditionalPanel(condition="input.rectTrack2=='2'",
radioButtons("rectcolTrack2", HTML("<table><tr><td><strong>Select color</strong></td>
<td>
<div class='help-tip'>
<p>The color to be used to plot the data, which can be random assigned by the application or specified by the users.
If 'Specific' was chosen, all data will be filled by a specified color.
If 'Custom' was chosen, the 4th column of the uploaded data should be a categorical character vector with no more than 50 groups.
Users should provide values as 'a:red;b:green;c:blue', in which 'a b c' represent different
data category indicated by the 4th column of the uploaded data.
Color for data without customed color will be set to NULL. Hex color codes as '#FF0000' are also supported.</p>
</div></td></tr>
</table>
"), c("Random" = "1", "Specific" = "2", "Custom" = "3"), selected="1"),
conditionalPanel(condition="input.rectcolTrack2=='2'",
textInput("rectcoldisTrack2", NULL, value="red")
),
conditionalPanel(condition="input.rectcolTrack2=='3'",
textInput("rectcoldiscusTrack2", NULL, value="a:red;b:blue;c:cyan")
)
),
conditionalPanel(condition="input.rectTrack2=='1'",
selectInput("colrectTrack2", NULL, choices = c("blue", "red", "green", "cyan", "purple", "pink", "orange",
"yellow", "navy", "seagreen", "maroon", "olivedrab", "gold",
"lightblue", "navy.yellow", "purple.seagreen", "navy.orange",
"navy.cyan", "blue.red", "green.red"))
)
),
conditionalPanel(condition="input.typeTrack2=='line' & !output.stackmd2 & input.fillareaTrack2=='add'",
radioButtons("selreaTrack2", HTML("<table><tr><td><strong>Area color</strong></td>
<td>
<div class='help-tip'>
<p>Filled color to the area, which can be identical with lines color or specified by the users. If 'Specific' was chosen, all data will be filled by a specified color as 'orange'.</p>
</div></td></tr>
</table>
"), c("Identical with lines" = "1", "Specific" = "2"),selected="1"),
conditionalPanel(condition="input.selreaTrack2=='2'",
textInput("borderareaTrack2", NULL, value="orange")
)
),
conditionalPanel(condition="input.typeTrack2!='heatmap' & input.typeTrack2!='ideogram'",
numericInput("transparencyTrack2", HTML("<table><tr><td>Color transparency:</td>
<td>
<div class='help-tip'>
<p>A decimal number in [0, 1] to adjust the color transparency. The higher the value, the deeper the color.</p>
</div></td></tr>
</table>
"), value=1, min=0, max=1, step=0.1)
),
conditionalPanel(condition="input.typeTrack2=='point' & output.stackmd2",
textInput("symbolTrack2", HTML("<table><tr><td><strong>Symbol type:</strong></td>
<td>
<div class='help-tip'>
<p>Symbols used for different points. Applicable value can be a number in [0-25] or a numeric vector of arbitrary length
adjusted automatically to the number of data categories. Type ?pch in R console for more details.</p>
</div></td></tr>
</table>
"), value="16"),
numericInput("pointsizeTrack2", "Point size:", value=0.6, min=0, max=1.5, step=0.05)
),
conditionalPanel(condition="input.typeTrack2!='rect' & input.typeTrack2!='heatmap' & input.typeTrack2!='ideogram' & !output.stackmd2",
textInput("baselineTrack2", HTML("<table><tr><td><strong>Y coordinates of baselines:</strong></td>
<td>
<div class='help-tip'>
<p>Decimal numbers in [0, 1] to adjust y axis coordinates of baselines. Numeric vector of arbitrary length is also accepted.
For example, '0.5' or '0.25,0.5,0.75'.</p>
</div></td></tr>
</table>
"), value="0.25,0.75")
),
conditionalPanel(condition="input.typeTrack2!='rect' & input.typeTrack2!='heatmap' & input.typeTrack2!='ideogram' & !(input.typeTrack2=='line' & output.stackmd2)",
textInput("colorlineTrack2", HTML("<table><tr><td><strong>Baselines color(s):</strong></td>
<td>
<div class='help-tip'>
<p>The color to be used for the baselines which can be null or a character vector of arbitrary length
adjusted automatically to the number of baselines. For example, 'grey' or 'red,green'.
Hex color codes as '#FF0000' are also supported.</p>
</div></td></tr>
</table>
"), value="grey")
),
conditionalPanel(condition="input.typeTrack2!='heatmap' & input.typeTrack2!='ideogram'",
textInput("bgcolTrack2", HTML("<table><tr><td><strong>Background color(s):</strong></td>
<td>
<div class='help-tip'>
<p>The color to be used for the background of the plot which can be null or a color vector of arbitrary
length adjusted automatically to the number of sectors. For example, 'grey95' or 'grey95,grey,pink,yellow'.
Hex color codes as '#FF0000' are also supported.</p>
</div></td></tr>
</table>
"), value="grey95")
),
conditionalPanel(condition="input.typeTrack2=='heatmap'",
radioButtons("heatmapcol2", HTML("<table><tr><td><strong>Colors</strong></td>
<td>
<div class='help-tip'>
<p>Colors to be used for the heatmap, which can be assigned by the application or specified by the users.</p>
</div></td></tr>
</table>
"), c("Typical" = "1", "Custom" = "2"), selected="1"),
conditionalPanel(condition="input.heatmapcol2=='1'",
selectInput("colhmapTrack2", NULL, choices = c("blue.white.red", "green.black.red", "green.yellow.red",
"purple.yellow.red", "blue.green.red", "blue.yellow.green",
"cyan.white.deeppink1"), selected="blue.white.red")
),
conditionalPanel(condition="input.heatmapcol2=='2'",
fluidRow(
column(4,jscolorInput("lowColor2", label = HTML('<p><font size="1.8"><strong>Low Color</strong></font></p>'), value = "#0016DB")),
column(4, jscolorInput("midColor2", label = HTML('<p><font size="1.8"><strong>Middle Color</strong></font></p>'), value = "#FFFFFF")),
column(4, jscolorInput("highColor2", label = HTML('<p><font size="1.8"><strong>High Color</strong></font></p>'), value = "#FFFF00"))),
HTML('<br>')
),
radioButtons("lineshmapTrack2", HTML("<table><tr><td><strong>Add position lines</strong></td>
<td>
<div class='help-tip'>
<p>Add genomic position lines between tracks, which can be used to identify the correspondance between heatmaps and regions.</p>
</div></td></tr>
</table>
"), c("Yes" = "1", "No" = "2"),selected="2"),
conditionalPanel(condition="input.lineshmapTrack2=='1'",
numericInput("heightlinesTrack2", HTML("<table><tr><td><strong>Position lines height:</strong></td>
<td>
<div class='help-tip'>
<p>Height of the position lines.</p>
</div></td></tr>
</table>
"), value=0.06, min=0, max=0.8, step=0.01),
numericInput("marginlinesTrack2", HTML("<table><tr><td><strong>Position lines margin:</strong></td>
<td>
<div class='help-tip'>
<p>Margin size of the position lines.</p>
</div></td></tr>
</table>
"), value=0.01, min=0, max=0.8, step=0.005)
)
),
numericInput("heightTrack2", HTML("<table><tr><td><strong>Track height:</strong></td>
<td>
<div class='help-tip'>
<p>Height of the track.</p>
</div></td></tr>
</table>
"), value=0.06, min=0, max=0.8, step=0.01),
numericInput("marginTrack2", HTML("<table><tr><td><strong>Track margin:</strong></td>
<td>
<div class='help-tip'>
<p>Margin size of the track.</p>
</div></td></tr>
</table>
"), value=0.01, min=0, max=0.8, step=0.005),
conditionalPanel(condition="input.typeTrack2=='heatmap'",
numericInput("innergapTrack2", HTML("<table><tr><td><strong>Inner gap:</strong></td>
<td>
<div class='help-tip'>
<p>Inner gap of the track.</p>
</div></td></tr>
</table>
"), value=0, min=0, max=0.5, step=0.05),
radioButtons("gridsborderTrack2", HTML("<table><tr><td><strong>Add cell borders</strong></td>
<td>
<div class='help-tip'>
<p>Add borders to the heatmap grids, which can separate cells from each other.</p>
</div></td></tr>
</table>
"), c("Yes" = "add", "No" = ""),selected=""),
conditionalPanel(condition="input.gridsborderTrack2=='add'",
textInput("colgridsborderTrack2", HTML("<table><tr><td><strong>Borders color:</strong></td>
<td>
<div class='help-tip'>
<p>The color to be used for the borders of heatmap grids. For example, 'white' or 'red'.
Hex color codes as '#FF0000' are also supported.</p>
</div></td></tr>
</table>
"), value="black")
)
),
conditionalPanel(condition="input.typeTrack2!='heatmap' & input.typeTrack2!='ideogram'",
radioButtons("borderTrack2", HTML("<table><tr><td><strong>Add borders</strong></td>
<td>
<div class='help-tip'>
<p>Add borders to the plotting regions.</p>
</div></td></tr>
</table>
"), c("Yes" = "add", "No" = ""),selected="")
),
conditionalPanel(condition="output.marklabel2",
radioButtons("labels2", HTML("<table><tr><td><strong>Add labels</strong></td>
<td>
<div class='help-tip'>
<p>Add labels to mark genes or genomic regions for this track using data uploaded in the 'Data upload' menu.</p>
</div></td></tr>
</table>
"), c("Yes" = "1", "No" = "2"), selected="2")
),
conditionalPanel(condition="input.labels2==1",
radioButtons("poslabels2", "Labels position", c("Outer" = "outer", "Inner" = "inner"),selected="outer"),
numericInput("heightlabels2", HTML("<table><tr><td><strong>Labels height:</strong></td>
<td>
<div class='help-tip'>
<p>Height of the labels, which should be greater than 0.</p>
</div></td></tr>
</table>
"), value=0.06, min=0, max=0.8, step=0.01),
numericInput("marginlabels2", HTML("<table><tr><td><strong>Labels margin:</strong></td>
<td>
<div class='help-tip'>
<p>Margin size of the labels.</p>
</div></td></tr>
</table>
"), value=0.01, min=0, max=0.8, step=0.005)
),
textInput("text2", HTML("<table><tr><td><strong>Legend text</strong></td>
<td>
<div class='help-tip'>
<p>The text to appear in the legend.</p>
</div></td></tr>
</table>
"), value=NULL),
conditionalPanel(condition="input.typeTrack2!='rect' & input.typeTrack2!='heatmap' & input.typeTrack2!='ideogram' & output.trackdat2 & !output.stackmd2",
radioButtons("highlightTrack2", HTML("<table><tr><td><strong>Highlight regions</strong></td>
<td>
<div class='help-tip'>
<p>Genomic regions to be highlighted with specified colors.</p>
</div></td></tr>
</table>
"), c("Show" = "1", "Hide" = "2"), selected="2"),
conditionalPanel(condition="input.highlightTrack2==1",
HTML("<table><tr><td>Paste data below:</td>
<td>
<div class='help-tip'>
<p>Each row should contain four components separated by commas including the chromosome ID, start coordinate,
end coordinate and the specified color. For example, 'chr1,1,100000000,red'. Hex color codes as '#FF0000' are also supported.</p>
</div></td></tr>
</table>
"),
tags$textarea(id="hltData2", rows=10, cols=30, ""),
HTML('<br>'),
HTML('<p>Data separated by commas.</p>'),
actionButton('clearText_button2','Clear data'),
numericInput("transparencyHlt2", HTML("<table><tr><td>Color transparency:</td>
<td>
<div class='help-tip'>
<p>A decimal number in [0, 1] to adjust the color transparency. The higher the value, the deeper the color.</p>
</div></td></tr>
</table>
"), value=1, min=0, max=1, step=0.1)
)
)
),
checkboxInput("optionsTrack3", HTML("<font color='red'>Track3</font>"), FALSE),
conditionalPanel(condition="input.optionsTrack3 & input.uploadtrack3 == '2'",
conditionalPanel(condition="input.typeTrack3=='bar'",
radioButtons("directionTrack3", HTML("<table><tr><td><strong>Bar direction</strong></td>
<td>
<div class='help-tip'>
<p>Bars can be unidirectional or bidirectional. For bidirectional bars, the 4th column which
contains the data values will be divided into two groups based on the boundary value.</p>
</div></td></tr>
</table>
"), c("Unidirectional" = "1", "Bidirectional" = "2"), selected="1"),
conditionalPanel(condition="input.directionTrack3=='2'",
numericInput("barBoundary3", "Boundary value:", value=0, step=0.01),
textInput("coldir1Track3", "Outer color:", value="red"),
textInput("coldir2Track3", "Inner color:", value="cyan")
)
),
conditionalPanel(condition="input.typeTrack3!='rect' & input.typeTrack3!='heatmap' & input.typeTrack3!='ideogram'",
conditionalPanel(condition="input.typeTrack3!='bar' | input.directionTrack3=='1'",
radioButtons("coltypeTrack3", HTML("<table><tr><td><strong>Data color</strong></td>
<td>
<div class='help-tip'>
<p>The color to be used to plot the data, which can be random assigned by the application or specified by the users.
To customize color for data with multiple columns, users should provide a character string representing one or multiple
colors separated by commas. For example, 'red' or 'red,orange,blue'.
To customize color for data with multiple groups, the column indicating different groups should be named as 'color' or 'stack'.
Users should provide a character strings assigning colors to each group.
For example, 'a:red;b:green;c:blue', in which 'a b c' represent different data groups.
Color for data groups without assigned color would be set as 'grey'.