Commit f406b4fd authored by Midoux Cedric's avatar Midoux Cedric

RDS

parent 231bc957
...@@ -20,7 +20,8 @@ dataInput <- function(failed = FALSE) { ...@@ -20,7 +20,8 @@ dataInput <- function(failed = FALSE) {
choices = list( choices = list(
"Demo" = "demo", "Demo" = "demo",
"Input data" = "input", "Input data" = "input",
"Rdata" = "rdata" "RData" = "rdata",
"RDS" = "rds"
), ),
selected = "demo" selected = "demo"
), ),
...@@ -107,7 +108,13 @@ output$dataUI <- renderUI({ ...@@ -107,7 +108,13 @@ output$dataUI <- renderUI({
inputId = "fileRData", inputId = "fileRData",
label = "RData where 'data' is a phyloseq object : ", label = "RData where 'data' is a phyloseq object : ",
placeholder = "data.RData" placeholder = "data.RData"
),
"rds" = fileInput(
inputId = "fileRDS",
label = "RDS with a phyloseq object : ",
placeholder = "phyloseq.RDS"
) )
) )
}) })
...@@ -153,6 +160,12 @@ observeEvent(input$okData, { ...@@ -153,6 +160,12 @@ observeEvent(input$okData, {
if (!is.null(input$fileRData)) if (!is.null(input$fileRData))
{load(input$fileRData$datapath, envir = ne)} {load(input$fileRData$datapath, envir = ne)}
ne$data ne$data
},
"rds" =
{
message <- as.character(input$fileRDS$name)
if (!is.null(input$fileRDS))
{readRDS(input$fileRDS$datapath)}
} }
) )
), ),
...@@ -335,13 +348,14 @@ observeEvent(input$transformData, { ...@@ -335,13 +348,14 @@ observeEvent(input$transformData, {
} }
} }
}) })
### Download Data ### ### Download Data ###
dataDownload <- function() { dataDownload <- function() {
modalDialog( modalDialog(
title = "Download data", title = "Download data",
size = "s", size = "s",
textInput("dataName", "File name : ", value = paste("Easy16S-data", Sys.Date(), sep = "-")), textInput("dataName", "File name : ", value = paste("Easy16S-data", Sys.Date(), sep = "-")),
radioButtons("dataFormat", "File format : ", choices = c("RData", "biom"), selected = "RData", inline = TRUE), radioButtons("dataFormat", "File format : ", choices = c("RData", "RDS", "biom"), selected = "RData", inline = TRUE),
footer = tagList(modalButton("Cancel"), footer = tagList(modalButton("Cancel"),
downloadButton("okDownload", "Download") downloadButton("okDownload", "Download")
) )
...@@ -356,6 +370,8 @@ output$okDownload <- downloadHandler( ...@@ -356,6 +370,8 @@ output$okDownload <- downloadHandler(
if (input$dataFormat == "RData") { if (input$dataFormat == "RData") {
data <- physeq() data <- physeq()
save(data, file = file) save(data, file = file)
} else if (input$dataFormat == "RDS") {
saveRDS(physeq(), file = file)
} else if (input$dataFormat == "biom") { } else if (input$dataFormat == "biom") {
write_phyloseq(physeq = physeq(), biom_file = file, biom_format = "frogs") #"standard" write_phyloseq(physeq = physeq(), biom_file = file, biom_format = "frogs") #"standard"
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment