Add DisGeNET integration

This commit is contained in:
Elias Projahn 2021-12-08 14:49:50 +01:00
parent 36546570e0
commit 2041cf2c2c
3 changed files with 53 additions and 4 deletions

View file

@ -173,14 +173,14 @@ server <- function(input, output, session) {
})
gost <- reactive({
withProgress(
withProgress(
message = "Querying g:Profiler",
value = 0.0,
{ # nolint
setProgress(0.2)
gprofiler2::gost(results_filtered()[, gene])
}
)
)
})
output$gost_plot <- plotly::renderPlotly({
@ -198,15 +198,17 @@ server <- function(input, output, session) {
data[, total_ratio := term_size / effective_domain_size]
data[, query_ratio := intersection_size / query_size]
data <- data[, .(source, term_name, total_ratio, query_ratio, p_value)]
dt <- DT::datatable(
data[, .(source, term_name, total_ratio, query_ratio, p_value)],
data,
rownames = FALSE,
colnames = c(
"Source",
"Term",
"Total ratio",
"Query ratio",
"p-Value"
"p-value"
),
style = "bootstrap",
options = list(
@ -221,4 +223,43 @@ server <- function(input, output, session) {
digits = 1
)
})
output$disgenet <- DT::renderDT({
withProgress(
message = "Querying DisGeNET",
value = 0.0,
{ # nolint
setProgress(0.2)
gene_names <- results_filtered()[, name]
gene_names <- unique(gene_names[gene_names != ""])
diseases <- disgenet2r::disease_enrichment(gene_names)
data <- data.table(diseases@qresult)
data <- data[, .(Description, Ratio, BgRatio, pvalue)]
setorder(data, pvalue)
dt <- DT::datatable(
data,
rownames = FALSE,
colnames = c(
"Disease",
"Query ratio",
"Total ratio",
"p-value"
),
style = "bootstrap",
options = list(
pageLength = 25
)
)
dt <- DT::formatRound(dt, "pvalue", digits = 4)
dt
}
)
})
}

7
R/ui.R
View file

@ -93,6 +93,13 @@ ui <- div(
style = "margin-top: 16px",
DT::DTOutput("gost_details")
)
),
tabPanel(
title = "DisGeNET",
div(
style = "margin-top: 16px",
DT::DTOutput("disgenet")
)
)
)
)