Further simplify results section

This commit is contained in:
Elias Projahn 2021-12-08 14:11:39 +01:00
parent f318cde5e7
commit ffa90cd667
2 changed files with 65 additions and 101 deletions

View file

@ -107,44 +107,6 @@ server <- function(input, output, session) {
geposan::plot_positions(preset$species_ids, gene_sets) geposan::plot_positions(preset$species_ids, gene_sets)
}) })
output$assessment_synopsis <- renderText({
reference_gene_ids <- preset()$reference_gene_ids
included_reference_count <- results_filtered()[
gene %chin% reference_gene_ids,
.N
]
reference_results <- results()[gene %chin% reference_gene_ids]
total_reference_count <- nrow(reference_results)
if (total_reference_count > 0) {
mean_rank <- as.character(round(
reference_results[, mean(rank)],
digits = 1
))
min_rank <- as.character(reference_results[, min(rank)])
max_rank <- as.character(reference_results[, max(rank)])
} else {
mean_rank <- "Unknown"
min_rank <- "Unknown"
max_rank <- "Unknown"
}
sprintf(
"Included reference genes: %i/%i<br> \
Mean rank of reference genes: %s<br> \
First rank of reference genes: %s<br> \
Last rank of reference genes: %s",
included_reference_count,
total_reference_count,
mean_rank,
min_rank,
max_rank
)
})
output$rank_plot <- plotly::renderPlotly({ output$rank_plot <- plotly::renderPlotly({
preset <- preset() preset <- preset()
gene_sets <- list("Reference genes" = preset$reference_gene_ids) gene_sets <- list("Reference genes" = preset$reference_gene_ids)
@ -210,10 +172,6 @@ server <- function(input, output, session) {
geposan::plot_boxplot(ranking(), gene_sets) geposan::plot_boxplot(ranking(), gene_sets)
}) })
output$chromosome_plot <- plotly::renderPlotly({
geposan::plot_chromosomes(ranking())
})
output$gost <- plotly::renderPlotly({ output$gost <- plotly::renderPlotly({
if (input$enable_gost) { if (input$enable_gost) {
result <- gprofiler2::gost( result <- gprofiler2::gost(

46
R/ui.R
View file

@ -8,7 +8,7 @@ ui <- div(
primary = "#1c71d8" primary = "#1c71d8"
), ),
title = "TPE-OLD candidates", title = "TPE-OLD candidates",
selected = "Ranking", selected = "Results",
tabPanel( tabPanel(
"Input data", "Input data",
sidebarLayout( sidebarLayout(
@ -28,7 +28,7 @@ ui <- div(
), ),
), ),
tabPanel( tabPanel(
"Ranking", "Results",
sidebarLayout( sidebarLayout(
sidebarPanel( sidebarPanel(
width = 3, width = 3,
@ -37,6 +37,10 @@ ui <- div(
), ),
mainPanel( mainPanel(
width = 9, width = 9,
tabsetPanel(
type = "pills",
tabPanel(
title = "Overview",
div( div(
style = "margin-top: 16px", style = "margin-top: 16px",
plotly::plotlyOutput( plotly::plotlyOutput(
@ -44,7 +48,10 @@ ui <- div(
width = "100%", width = "100%",
height = "600px" height = "600px"
) )
)
), ),
tabPanel(
title = "Methods & Distribution",
div( div(
style = "margin-top: 16px", style = "margin-top: 16px",
plotly::plotlyOutput( plotly::plotlyOutput(
@ -52,21 +59,10 @@ ui <- div(
width = "100%", width = "100%",
height = "600px" height = "600px"
) )
),
)
),
),
tabPanel(
"Detailed results",
uiOutput("copy"),
div(
style = "margin-top: 16px",
DT::DTOutput("genes")
) )
), ),
tabPanel( tabPanel(
"Assessment", title = "Comparison",
htmlOutput("assessment_synopsis"),
div( div(
style = "margin-top: 16px", style = "margin-top: 16px",
plotly::plotlyOutput( plotly::plotlyOutput(
@ -74,18 +70,21 @@ ui <- div(
width = "100%", width = "100%",
height = "600px" height = "600px"
) )
)
),
tabPanel(
title = "Detailed results",
div(
style = "margin-top: 16px",
uiOutput("copy"),
), ),
div( div(
style = "margin-top: 16px", style = "margin-top: 16px",
plotly::plotlyOutput( DT::DTOutput("genes")
"chromosome_plot",
width = "100%",
height = "600px"
) )
), ),
),
tabPanel( tabPanel(
"Analysis", title = "g:Profiler",
checkboxInput( checkboxInput(
"enable_gost", "enable_gost",
"Perform a gene set enrichment analysis on the \ "Perform a gene set enrichment analysis on the \
@ -101,4 +100,11 @@ ui <- div(
) )
) )
) )
)
)
),
tabPanel(
title = "Publication"
)
)
) )