-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.R
51 lines (46 loc) · 1.73 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
40
41
42
43
44
45
46
47
48
49
50
51
#
# 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(reshape2)
library(DT)
# Define UI for application
ui <- fluidPage(
# Application title
titlePanel("plate map reformatter"),
textAreaInput("map", "Paste plate map here:", "", width = "1000px"),
textAreaInput("data", "Paste 96 well data here:", "", width = "1000px"),
dataTableOutput('table'),
)
# Define server logic
server <- function(input, output) {
output$table <- renderDataTable({
platemap <- read.table(text=input$map, sep="\t", check.names=FALSE, header=TRUE)
platedata <- read.table(text=input$data, sep="\t", check.names=FALSE, header=TRUE)
melted_platemap <- melt(platemap,id.vars=1)
melted_platedata <- melt(platedata, id.vars=1)
melted_df <- cbind(melted_platemap, melted_platedata[,3])
colnames(melted_df) <- c("Row", "Col", "Label", "Value")
datatable(melted_df,
extensions = 'Buttons',
rownames=FALSE,
options = list(dom = 'Blfrtip',
buttons = list(
list(
extend="copy",
text="Copy",
title=NULL
)
),
paging = FALSE,
searching = FALSE,
pageLength = 96))
})
}
# Run the application
shinyApp(ui = ui, server = server)