From cd17424f444cdb231e59a7b0f735ff76c7fa6bb5 Mon Sep 17 00:00:00 2001 From: Marcel Costa Date: Tue, 3 Oct 2023 19:03:32 +0200 Subject: [PATCH] =?UTF-8?q?He=20a=C3=B1adido=20la=20opci=C3=B3n=20de=20cam?= =?UTF-8?q?biar=20el=20grupo=20y=20de=20a=C3=B1adir=20un=20facet.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scMonitor/app.R | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/scMonitor/app.R b/scMonitor/app.R index ecaebcf..01ff3e0 100644 --- a/scMonitor/app.R +++ b/scMonitor/app.R @@ -11,7 +11,9 @@ ui <- fluidPage( sidebarLayout( sidebarPanel( - shinyFilesButton("file", label="Select File", title="Select a Seurat Object", multiple=F) + shinyFilesButton("file", label="Select File", title="Select a Seurat Object", multiple=F), + uiOutput('groupby'), + uiOutput('facetby') ), mainPanel( @@ -35,10 +37,28 @@ server <- function(input, output) { } }) + output$groupby<-renderUI({ + if (!is.null(dades$seu)){ + selectInput("groupby", "GroupBy", c("Default", colnames(dades$seu@meta.data))) + } + }) + + output$facetby<-renderUI({ + if (!is.null(dades$seu)){ + selectInput("facetby", "FacetBy", c("None", colnames(dades$seu@meta.data))) + } + }) + output$umapPlot <- renderPlot({ observeEvent(dades$seu, {}) if (!is.null(dades$seu)){ - DimPlot(dades$seu)+theme(aspect.ratio=1) + + plot<-DimPlot(dades$seu, + group.by = if(input$groupby != "Default"){input$groupby}else{NULL}, + split.by=if(input$facetby != "None"){input$facetby}else{NULL})+ + theme(aspect.ratio=1) + plot + } }) }