-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdecrepit_plot_ondemand.R
109 lines (98 loc) · 2.44 KB
/
decrepit_plot_ondemand.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
#
# This is a Shiny web application. You can run the application by clicking
# the 'Run App' button above.
#
# Find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com/
#
library(shiny)
library(ggplot2)
load(file="./temp_test.RData")
# Define UI for application
ui <- fluidPage(
# Application title
titlePanel("Plotting on-demand (Gene_LLPSX, Gene_NEUO3, Gene_MQDSR"),
# Sidebar layout with input and output definitions
sidebarLayout(
sidebarPanel(
# Text input
textInput("input_gene", "Enter gene name:", ""),
# Plot button
actionButton("plot_button", "Plot")
),
# Output: Plot
mainPanel(
plotOutput("text_plot")
)
)
)
# Define server logic
server <- function(input, output) {
# Render plot when plot button is clicked
observeEvent(input$plot_button, {
print("plot button clicked")
gene <- input$input_gene
output$text_plot <- renderPlot({
print("Calling plotting function")
plot_gene_expression(table, gene)
})
})
}
# Run the application
shinyApp(ui = ui, server = server)
# library(shiny)
# library(tidyverse)
# library(magrittr)
# library(ggpubr)
# library(gridExtra)
# library(grid)
# library(cowplot)
#
# # Define UI for application
# ui <- fluidPage(
#
# # Application title
# titlePanel("Plotting on-demand"),
#
# # Sidebar layout with input and output definitions
# sidebarLayout(
# sidebarPanel(
# # Text input
# textInput("input_gene", "Enter gene name:", ""),
# textInput("input_snp", "Enter SNP ID:",""),
#
# # Plot button
# actionButton("plot_button", "Plot")
# ),
#
# # Output: Plot
# mainPanel(
# plotOutput("text_plot")
# )
# )
# )
#
# # Define server logic
# server <- function(input, output) {
# print("loading environment")
# dataEnv <- new.env()
# load("~/Downloads/eQTL_website.github.io/website/data/modeling_results/data_for_plotting_on_demand.RData", envir = dataEnv)
# print("loaded environment")
#
# # Render plot when plot button is clicked
# observeEvent(input$plot_button, {
# print("plot button clicked")
# gene <- input$input_gene
# snp <- input$input_snp
# output$text_plot <- renderPlot({
# print("Calling make_reQTL_plot_CPM_3cts")
# dataEnv$make_reQTL_plot_CPM_3cts(snp, gene, dataEnv)
# })
# })
# }
#
#
#
# # Run the application
# shinyApp(ui = ui, server = server)