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

corrected a bug in data16S() with RData import.

parent 1a448020
......@@ -47,4 +47,16 @@
tdf[grep("unknown ", tdf)] <- NA
#tdf[grep("Unclassified", tdf)] <- NA
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
## Rdata input
if (input$dataset == "rdata")
{
## .import_from_rdata(input) ## does not work as a function for some reason
## Happy path
ne <- new.env() ## new env to store RData content and avoid border effects
if (!is.null(input$fileRData))
load(input$fileRData$datapath)
if (exists("data") && class(data) == "phyloseq")
return(data)
## Unhappy path
load(input$fileRData$datapath, envir = ne)
if (class(ne$data) == "phyloseq")
return(ne$data)
## Unhappy paths: everything else
return()
}
......
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