Commit 2f2009bb authored by mahendra-mariadassou's avatar mahendra-mariadassou
Browse files

corrected a bug in data16S() with RData import.

No related merge requests found
Showing with 21 additions and 5 deletions
+21 -5
...@@ -47,4 +47,16 @@ ...@@ -47,4 +47,16 @@
tdf[grep("unknown ", tdf)] <- NA tdf[grep("unknown ", tdf)] <- NA
#tdf[grep("Unclassified", tdf)] <- NA #tdf[grep("Unclassified", tdf)] <- NA
return(tdf) return(tdf)
} }
\ No newline at end of file
.import_from_rdata <- function(input) {
## Happy path
ne <- new.env() ## new env to store RData content and avoid border effects
if (!is.null(input$fileRData))
load(input$fileRData$datapath, envir = ne)
if (class(ne$data) == "phyloseq")
return(ne$data)
## Unhappy paths: everything else
return()
}
...@@ -85,12 +85,16 @@ shinyServer ...@@ -85,12 +85,16 @@ shinyServer
## Rdata input ## Rdata input
if (input$dataset == "rdata") if (input$dataset == "rdata")
{ {
## .import_from_rdata(input) ## does not work as a function for some reason
## Happy path ## Happy path
ne <- new.env() ## new env to store RData content and avoid border effects
if (!is.null(input$fileRData)) if (!is.null(input$fileRData))
load(input$fileRData$datapath) load(input$fileRData$datapath, envir = ne)
if (exists("data") && class(data) == "phyloseq") if (class(ne$data) == "phyloseq")
return(data) return(ne$data)
## Unhappy path
## Unhappy paths: everything else
return() return()
} }
......
Supports Markdown
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