mirror of
https://github.com/johrpan/geposanui.git
synced 2025-10-26 11:17:24 +01:00
Update gprofiler integration
This commit is contained in:
parent
ffa90cd667
commit
36546570e0
3 changed files with 53 additions and 25 deletions
|
|
@ -22,7 +22,7 @@ filters_ui <- function(id) {
|
||||||
min = 0,
|
min = 0,
|
||||||
max = 100,
|
max = 100,
|
||||||
step = 1,
|
step = 1,
|
||||||
value = 60
|
value = 75
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
tabPanelBody(
|
tabPanelBody(
|
||||||
|
|
|
||||||
51
R/server.R
51
R/server.R
|
|
@ -172,20 +172,53 @@ server <- function(input, output, session) {
|
||||||
geposan::plot_boxplot(ranking(), gene_sets)
|
geposan::plot_boxplot(ranking(), gene_sets)
|
||||||
})
|
})
|
||||||
|
|
||||||
output$gost <- plotly::renderPlotly({
|
gost <- reactive({
|
||||||
if (input$enable_gost) {
|
withProgress(
|
||||||
result <- gprofiler2::gost(
|
message = "Querying g:Profiler",
|
||||||
results_filtered()[, gene],
|
value = 0.0,
|
||||||
ordered_query = TRUE
|
{ # nolint
|
||||||
|
setProgress(0.2)
|
||||||
|
gprofiler2::gost(results_filtered()[, gene])
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
output$gost_plot <- plotly::renderPlotly({
|
||||||
gprofiler2::gostplot(
|
gprofiler2::gostplot(
|
||||||
result,
|
gost(),
|
||||||
capped = FALSE,
|
capped = FALSE,
|
||||||
interactive = TRUE
|
interactive = TRUE
|
||||||
)
|
)
|
||||||
} else {
|
})
|
||||||
NULL
|
|
||||||
}
|
output$gost_details <- DT::renderDT({
|
||||||
|
data <- data.table(gost()$result)
|
||||||
|
setorder(data, p_value)
|
||||||
|
|
||||||
|
data[, total_ratio := term_size / effective_domain_size]
|
||||||
|
data[, query_ratio := intersection_size / query_size]
|
||||||
|
|
||||||
|
dt <- DT::datatable(
|
||||||
|
data[, .(source, term_name, total_ratio, query_ratio, p_value)],
|
||||||
|
rownames = FALSE,
|
||||||
|
colnames = c(
|
||||||
|
"Source",
|
||||||
|
"Term",
|
||||||
|
"Total ratio",
|
||||||
|
"Query ratio",
|
||||||
|
"p-Value"
|
||||||
|
),
|
||||||
|
style = "bootstrap",
|
||||||
|
options = list(
|
||||||
|
pageLength = 25
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
dt <- DT::formatRound(dt, "p_value", digits = 4)
|
||||||
|
dt <- DT::formatPercentage(
|
||||||
|
dt,
|
||||||
|
c("total_ratio", "query_ratio"),
|
||||||
|
digits = 1
|
||||||
|
)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
17
R/ui.R
17
R/ui.R
|
|
@ -85,18 +85,13 @@ ui <- div(
|
||||||
),
|
),
|
||||||
tabPanel(
|
tabPanel(
|
||||||
title = "g:Profiler",
|
title = "g:Profiler",
|
||||||
checkboxInput(
|
div(
|
||||||
"enable_gost",
|
style = "margin-top: 16px",
|
||||||
"Perform a gene set enrichment analysis on the \
|
plotly::plotlyOutput("gost_plot"),
|
||||||
filtered result genes."
|
|
||||||
),
|
),
|
||||||
conditionalPanel(
|
div(
|
||||||
"input.enable_gost == true",
|
style = "margin-top: 16px",
|
||||||
plotly::plotlyOutput(
|
DT::DTOutput("gost_details")
|
||||||
"gost",
|
|
||||||
width = "100%",
|
|
||||||
height = "600px"
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue