-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui.R
executable file
·131 lines (128 loc) · 5.09 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
# ui.R is running----
print("Run ui.R")
# init the app
source("./config.R")
fluidPage(
theme = "style.css",
title = "ShinyCNV", # webpage title
h3("Shiny Copy Number Variation"), # top-left title
p("Example Data: https://gitee.com/hiplot/ShinyCNV/blob/master/inputCNVs.txt"),
conditionalPanel(
"output.fileUploaded != true",
selectInput("getHgVersion", "hg build:", c("hg18", "hg19", "hg38"), selected = "hg19", width = "100px")
),
fluidRow(
column(
12,
fileInput("cnvFile", "Choose CNV File"), # browse cnv file
verbatimTextOutput("inputFileText")
)
),
p("Example SNP Data: https://gitee.com/hiplot/ShinyCNV/tree/master/SNPdata"),
fluidRow(
column(
12,
fileInput("SNPdata", "Choose SNPdata Files (Not require for demo)",
multiple = TRUE), # browse cnv file
)
),
fluidRow(
column(2, textInput("dataSuffix", "SNP Data Suffix:",
placeholder = ".txt.gz", value = ".txt.gz", width = "200"
)),
),
hr(),
conditionalPanel(
"output.fileUploaded == true",
sidebarLayout(
# sidebarPanel----
sidebarPanel(
width = 4,
DT::dataTableOutput("cnvTbl"),
actionButton("getSNPdata", "Read in SNP data"),
actionButton("prevCNV", "Prev CNV"),
actionButton("nextCNV", "Next CNV"),
verbatimTextOutput("SNPdataStatus", placeholder = TRUE),
actionButton("addCNV", "Add CNV"),
actionButton("setGermCNV", "Germ CNV"),
actionButton("setCoveredCNV", "Covered CNV"),
actionButton("setFalseCNV", "False CNV"),
actionButton("setTrueCNV", "True CNV"),
splitLayout(
cellWidths = c(85, 80),
actionButton("setChr", "Set Chr"),
textInput("chr", "", placeholder = ""),
actionButton("setCN", "Set CN"),
textInput("copyNum", "", placeholder = ""),
actionButton("setNormRate", "Set NR"),
textInput("normRate", "", placeholder = "")
),
# delete, set dup and clear SNP data----
actionButton("delCNV", "Delete CNV"),
# actionButton("setDupCNV", "Dup CNV"),
actionButton("clearSNPdata", "Clear SNPdata")
),
conditionalPanel(
"output.SNPloaded == true",
# mainPanel----
mainPanel(
width = 8,
fluidRow(
# BAF, LRR and gene list plot----
column(12, plotOutput("caseBAF",
height = bafLrrHeight, click = "caseBAF_click",
brush = brushOpts("caseBAF_brush", delay = 500, delayType = "debounce", resetOnNew = T)
)),
column(12, plotOutput("ctrlBAF",
height = bafLrrHeight, click = "ctrlBAF_click",
brush = brushOpts("ctrlBAF_brush", delay = 500, delayType = "debounce", resetOnNew = T)
)),
column(12, plotOutput("caseLRR",
height = bafLrrHeight, click = "caseLRR_click",
brush = brushOpts("caseLRR_brush", delay = 500, delayType = "debounce", resetOnNew = T)
)),
column(12, plotOutput("ctrlLRR",
height = bafLrrHeight, click = "ctrlLRR_click",
brush = brushOpts("ctrlLRR_brush", delay = 500, delayType = "debounce", resetOnNew = T)
)),
column(12, plotOutput("genePlot", height = genePlotHeight, click = "genePlot_click")),
# set position by selecting near point----
column(2, selectInput("getChrPos", "Chr:", c("NA", "start", "end"))),
column(2, textInput("position", "Pos:", placeholder = "", width = "200")),
column(1, actionButton("setStart", "Set Start")),
column(1, actionButton("setEnd", "Set End")),
# select padding folds for CNV
column(1, selectInput("getCnvPadX", "Padding X", c(0, 2, 4, 5, 8, 10, 20), selected = 4)),
# max point number for showing BAF and LRR
column(1, selectInput("maxSNPnum", "maxSNP", c(1000, 2000, 5000, 8000, 10000, 20000, 50000), selected = 10000)),
# zoon out----
column(1, actionButton("zoomOut2X", "Zoom out 2X")),
column(1, actionButton("zoomOut5X", "Zoom out 5X")),
column(1, actionButton("zoomOut10X", "Zoom out 10X"))
),
column(2, tableOutput("geneTbl"))
)
)
),
conditionalPanel(
"output.SNPloaded == true",
hr(),
splitLayout(
cellWidths = c(100, 200, 280, 120, 120, 120, 120, 100),
actionButton("setChrGene", "Chr/Gene"),
textInput("chrGeneName", "", placeholder = ""),
verbatimTextOutput("spectPos", placeholder = TRUE),
actionButton("zoomOut2XSpect", "Zoom out 2X"),
actionButton("zoomOut5XSpect", "Zoom out 5X"),
actionButton("zoomOut10XSpect", "Zoom out 10X"),
actionButton("showCNV", "Show CNV"),
actionButton("noCNV", "Hide CNV")
),
plotOutput("spectrumPlot",
brush = brushOpts("spect_brush", delay = 500, delayType = "debounce", resetOnNew = T)
)
)
),
# allow read in cnv file again----
tags$script('$( "#cnvFile" ).on( "click", function() { this.value = null; });')
)