Skip to content

Commit

Permalink
fix #60: add buttons that move to specified tab
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-d13 committed Sep 18, 2024
1 parent 50d5005 commit f41142c
Showing 1 changed file with 27 additions and 4 deletions.
31 changes: 27 additions & 4 deletions R/DeconvExplorer.R
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ DeconvExplorer <- function(deconvexp_bulk = NULL,
fileInput("userBatchUpload", "Upload Batch IDs"),
div(style = "margin-top: -20px"),
fileInput("userMarkerUpload", "Upload Marker Genes"),
div(style = "margin-top: -20px"), collapsible = T, collapsed = T
div(style = "margin-top: -20px"), collapsible = T, collapsed = T,
shinyWidgets::actionBttn('selectDeconvolution', 'Perform deconvolution', icon = icon('arrow-right'), color = 'success', style = 'simple')
)

deconvUploadPopover <-
Expand Down Expand Up @@ -126,7 +127,12 @@ DeconvExplorer <- function(deconvexp_bulk = NULL,
width = 12,
fileInput("userSignatureUpload", "Upload Signature"),
div(style = "margin-top: -25px"),
p("You can upload a previsouly generated signature matrix of a deconvolution method and analyse it with DeconvExplorer.")
p("You can upload a previsouly generated signature matrix of a deconvolution method and analyse it with DeconvExplorer. Multiple uploads are possible."),
fluidRow(
column(4, shinyWidgets::actionBttn('selectSigExploration', 'Explore the signature', icon = icon('arrow-right'), color = 'success', style = 'simple')),
column(4, shinyWidgets::actionBttn('selectSigRefinement', 'Refine the signature', icon = icon('arrow-right'), color = 'success', style = 'simple'))
)

)

signatureUploadPopover <-
Expand All @@ -142,7 +148,8 @@ DeconvExplorer <- function(deconvexp_bulk = NULL,
width = 12,
fileInput("userFractionsUpload", "Upload table with cell-type fractions"),
div(style = "margin-top: -25px"),
p("You can upload a table containing cell-type fractions, either coming from a deconvolution method or a ground-truth dataset with which you want to compare your deconvolution result.")
p("You can upload a table containing cell-type fractions, either coming from a deconvolution method or a ground-truth dataset with which you want to compare your deconvolution result. Multiple uploads are possible."),
shinyWidgets::actionBttn('selectBenchmark', 'Compare fractions', icon = icon('arrow-right'), color = 'success', style = 'simple')
)

fractionsUploadPopover <-
Expand Down Expand Up @@ -897,7 +904,7 @@ DeconvExplorer <- function(deconvexp_bulk = NULL,
)
)
),
dashboardSidebar(sidebarMenu(
dashboardSidebar(sidebarMenu(id = 'tabs',
shinyjs::useShinyjs(),
rintrojs::introjsUI(),
waiter::use_waiter(),
Expand Down Expand Up @@ -1176,6 +1183,22 @@ DeconvExplorer <- function(deconvexp_bulk = NULL,
updateSelectInput(session, "benchmark_reference", choices = names(internal$deconvolutions))
updateSelectInput(session, "benchmark_ToPlot", choices = names(internal$deconvolutions))
})

observeEvent(input$selectDeconvolution, {
updateTabItems(session, inputId = "tabs", selected = "deconv")
})

observeEvent(input$selectSigExploration, {
updateTabItems(session, inputId = "tabs", selected = "signatureExploration")
})

observeEvent(input$selectSigRefinement, {
updateTabItems(session, inputId = "tabs", selected = "signatureRefinement")
})

observeEvent(input$selectBenchmark, {
updateTabItems(session, inputId = "tabs", selected = "benchmark")
})

observeEvent(input$loadSample, {
waiter::waiter_show(html = tagList(waiter::spin_rotating_plane(), "Loading example data ..."), color = overlay_color)
Expand Down

0 comments on commit f41142c

Please sign in to comment.