mirror of
https://github.com/johrpan/geposanui.git
synced 2025-10-26 11:17:24 +01:00
Add DisGeNET integration
This commit is contained in:
parent
36546570e0
commit
2041cf2c2c
3 changed files with 53 additions and 4 deletions
|
|
@ -16,6 +16,7 @@ Roxygen: list(markdown = TRUE)
|
|||
RoxygenNote: 7.1.2
|
||||
Imports:
|
||||
data.table,
|
||||
disgenet2r,
|
||||
DT,
|
||||
geposan,
|
||||
gprofiler2,
|
||||
|
|
|
|||
49
R/server.R
49
R/server.R
|
|
@ -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
7
R/ui.R
|
|
@ -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")
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue