Browse Source

Primera version, solo DimPlot basico

BuiltinModules
Marcel Costa 1 year ago
parent
commit
7170310471
1 changed files with 47 additions and 0 deletions
  1. +47
    -0
      scMonitor/app.R

+ 47
- 0
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)

Loading…
Cancel
Save