mirror of
https://github.com/johrpan/geposanui.git
synced 2025-10-26 11:17:24 +01:00
server: Generate rankings plot from preset
This commit is contained in:
parent
41e5e40178
commit
04b615bb7c
1 changed files with 13 additions and 16 deletions
29
R/server.R
29
R/server.R
|
|
@ -86,6 +86,19 @@ server <- function(input, output, session) {
|
|||
|
||||
output$rankings_plot <- plotly::renderPlotly({
|
||||
preset <- preset()
|
||||
|
||||
rankings <- list()
|
||||
methods <- preset$methods
|
||||
all <- ranking()
|
||||
|
||||
for (method in methods) {
|
||||
weights <- list()
|
||||
weights[[method$id]] <- 1.0
|
||||
rankings[[method$name]] <- geposan::ranking(all, weights)
|
||||
}
|
||||
|
||||
rankings[["Combined"]] <- all
|
||||
|
||||
gene_sets <- list("Reference genes" = preset$reference_gene_ids)
|
||||
comparison_gene_ids <- comparison_gene_ids()
|
||||
|
||||
|
|
@ -96,22 +109,6 @@ server <- function(input, output, session) {
|
|||
)
|
||||
}
|
||||
|
||||
all <- ranking()
|
||||
clustering <- geposan::ranking(all, list(clustering = 1))
|
||||
correlation <- geposan::ranking(all, list(correlation = 1))
|
||||
neural <- geposan::ranking(all, list(neural = 1))
|
||||
adjacency <- geposan::ranking(all, list(adjacency = 1))
|
||||
proximity <- geposan::ranking(all, list(proximity = 1))
|
||||
|
||||
rankings <- list(
|
||||
"Clustering" = clustering,
|
||||
"Correlation" = correlation,
|
||||
"Neural" = neural,
|
||||
"Adjacency" = adjacency,
|
||||
"Proximity" = proximity,
|
||||
"Combined" = all
|
||||
)
|
||||
|
||||
geposan::plot_rankings(rankings, gene_sets)
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue