You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.0 KiB

library(shiny)
library(Seurat)
library(shinyFiles)
library(ggplot2)
# Define UI for application
ui <- fluidPage(
# Application title
titlePanel("scMonitor"),
sidebarLayout(
sidebarPanel(
shinyFilesButton("file", label="Select File", title="Select a Seurat Object", multiple=F)
),
mainPanel(
plotOutput("umapPlot")
)
)
)
# Define server logic required to draw a histogram
server <- function(input, output) {
dades<-reactiveValues()
dades$seu<-NULL
volumes <- c(Home = fs::path_home(), "R Installation" = R.home(), getVolumes()())
shinyFileChoose(input, 'file', roots=volumes)
observe({
if (!is.integer(input$file)){
print(parseFilePaths(volumes, input$file))
dades$seu<-readRDS(parseFilePaths(volumes, input$file)$datapath)
}
})
output$umapPlot <- renderPlot({
observeEvent(dades$seu, {})
if (!is.null(dades$seu)){
DimPlot(dades$seu)+theme(aspect.ratio=1)
}
})
}
# Run the application
shinyApp(ui = ui, server = server)