From 7170310471e990bec8b5cad59d8d3a9c4db29ff9 Mon Sep 17 00:00:00 2001 From: Marcel Costa Date: Tue, 3 Oct 2023 18:46:19 +0200 Subject: [PATCH] Primera version, solo DimPlot basico --- scMonitor/app.R | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 scMonitor/app.R diff --git a/scMonitor/app.R b/scMonitor/app.R new file mode 100644 index 0000000..ecaebcf --- /dev/null +++ b/scMonitor/app.R @@ -0,0 +1,47 @@ +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)