-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.R
40 lines (32 loc) · 1.16 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
library(shiny)
library(tidyverse)
#install.packages("d3heatmap", "heatmaply")
#devtools::install_github('neuhausi/canvasXpress')
library(d3heatmap)
library(heatmaply)
library(canvasXpress)
test_matrix <- matrix(
rpois(10000, 5),
nrow = 100,
dimnames = list(
str_c("sample", as.character(1:100)),
str_c("gene", as.character(1:100))
))
# test_df <- test_matrix %>%
# data.frame %>%
# rownames_to_column("sample") %>%
# as_data_frame
ui <- basicPage(
tabsetPanel(
tabPanel("d3heatmap", d3heatmapOutput("d3heatmap")),
tabPanel("heatmaply", plotlyOutput("heatmaply")),
tabPanel("plotly", plotlyOutput("plotly")),
tabPanel("canvasXpress", canvasXpressOutput("canvasXpress"))
))
server <- function(input, output) {
output$d3heatmap <- renderD3heatmap(d3heatmap(test_matrix))
output$heatmaply <- renderPlotly(heatmaply(test_matrix))
output$plotly <- renderPlotly(plot_ly(z = test_matrix, type = "heatmap", showscale = TRUE))
output$canvasXpress <- renderCanvasXpress(canvasXpress(test_matrix, graphType = "Heatmap"))
}
shinyApp(ui = ui, server = server)