-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcancer-app.R
46 lines (33 loc) · 1010 Bytes
/
cancer-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
library(shiny)
library(Biobase)
ui <- fluidPage(
# Application title
titlePanel("Interrogating the NKI breast cancer dataset"),
sidebarLayout(
sidebarPanel(
selectInput("thegene","Gene to Analyse",
choices=c("ESR1","ERBB2","PTEN"),
selected = "ESR1")
),
# Show a plot of the generated distribution
mainPanel(
plotOutput("boxplot")
)
)
)
server <- function(input, output) {
# If your data are stored in a csv or txt file, you could add the read.csv, read.delim commands here instead
library(breastCancerNKI)
data(nki)
expression.values <- exprs(nki)
features <- fData(nki)
er.status <- pData(nki)$er
output$boxplot <- renderPlot({
gene <- input$thegene
probe.id <- as.character(features$probe[match(gene, features$HUGO.gene.symbol)])
values <- expression.values[probe.id,]
boxplot(values ~ er.status)
})
}
# Run the application
shinyApp(ui = ui, server = server)