Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Midoux Cedric
easy16S
Commits
f406b4fd
Commit
f406b4fd
authored
Apr 20, 2020
by
Midoux Cedric
Browse files
RDS
parent
231bc957
Changes
1
Hide whitespace changes
Inline
Side-by-side
panels/dataInput.R
View file @
f406b4fd
...
...
@@ -20,7 +20,8 @@ dataInput <- function(failed = FALSE) {
choices
=
list
(
"Demo"
=
"demo"
,
"Input data"
=
"input"
,
"Rdata"
=
"rdata"
"RData"
=
"rdata"
,
"RDS"
=
"rds"
),
selected
=
"demo"
),
...
...
@@ -107,7 +108,13 @@ output$dataUI <- renderUI({
inputId
=
"fileRData"
,
label
=
"RData where 'data' is a phyloseq object : "
,
placeholder
=
"data.RData"
),
"rds"
=
fileInput
(
inputId
=
"fileRDS"
,
label
=
"RDS with a phyloseq object : "
,
placeholder
=
"phyloseq.RDS"
)
)
})
...
...
@@ -153,6 +160,12 @@ observeEvent(input$okData, {
if
(
!
is.null
(
input
$
fileRData
))
{
load
(
input
$
fileRData
$
datapath
,
envir
=
ne
)}
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, {
}
}
})
### Download Data ###
dataDownload
<-
function
()
{
modalDialog
(
title
=
"Download data"
,
size
=
"s"
,
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"
),
downloadButton
(
"okDownload"
,
"Download"
)
)
...
...
@@ -356,6 +370,8 @@ output$okDownload <- downloadHandler(
if
(
input
$
dataFormat
==
"RData"
)
{
data
<-
physeq
()
save
(
data
,
file
=
file
)
}
else
if
(
input
$
dataFormat
==
"RDS"
)
{
saveRDS
(
physeq
(),
file
=
file
)
}
else
if
(
input
$
dataFormat
==
"biom"
)
{
write_phyloseq
(
physeq
=
physeq
(),
biom_file
=
file
,
biom_format
=
"frogs"
)
#"standard"
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment