mirror of
https://github.com/johrpan/geposanui.git
synced 2025-10-26 19:27:24 +01:00
Add rankings correlation plot
This commit is contained in:
parent
c78802425c
commit
4e31d4ef79
2 changed files with 101 additions and 1 deletions
48
R/server.R
48
R/server.R
|
|
@ -116,6 +116,54 @@ server <- function(options) {
|
|||
geposan::plot_rankings(rankings, gene_sets)
|
||||
})
|
||||
|
||||
output$ranking_correlation_plot <- plotly::renderPlotly({
|
||||
preset <- preset()
|
||||
ranking <- ranking()
|
||||
|
||||
ranking_x <- if (input$ranking_x == "combined") {
|
||||
ranking
|
||||
} else {
|
||||
weights <- list()
|
||||
weights[[input$ranking_x]] <- 1.0
|
||||
geposan::ranking(ranking, weights)
|
||||
}
|
||||
|
||||
ranking_y <- if (input$ranking_y == "combined") {
|
||||
ranking
|
||||
} else {
|
||||
weights <- list()
|
||||
weights[[input$ranking_y]] <- 1.0
|
||||
geposan::ranking(ranking, weights)
|
||||
}
|
||||
|
||||
gene_sets <- list("Reference genes" = preset$reference_gene_ids)
|
||||
comparison_gene_ids <- comparison_gene_ids()
|
||||
|
||||
if (length(comparison_gene_ids) >= 1) {
|
||||
gene_sets <- c(
|
||||
gene_sets,
|
||||
list("Comparison genes" = comparison_gene_ids)
|
||||
)
|
||||
}
|
||||
|
||||
method_names <- geposan::all_methods() |> purrr::lmap(function(method) {
|
||||
l <- list()
|
||||
l[[method[[1]]$id]] <- method[[1]]$name
|
||||
l
|
||||
})
|
||||
|
||||
method_names[["combined"]] <- "Combined"
|
||||
|
||||
geposan::plot_rankings_correlation(
|
||||
ranking_x,
|
||||
ranking_y,
|
||||
method_names[[input$ranking_x]],
|
||||
method_names[[input$ranking_y]],
|
||||
gene_sets = gene_sets,
|
||||
use_ranks = input$use_ranks
|
||||
)
|
||||
})
|
||||
|
||||
output$comparison_text <- renderUI({
|
||||
reference <- geposan::compare(
|
||||
ranking(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue