mirror of
https://github.com/johrpan/geposanui.git
synced 2025-10-26 19:27:24 +01:00
Allow filtering by rank
This commit is contained in:
parent
667eb8f2a3
commit
b57297dfdf
4 changed files with 107 additions and 32 deletions
|
|
@ -9,11 +9,8 @@
|
|||
#
|
||||
# @param results Results to display.
|
||||
# @param reference_gene_ids IDs of reference genes.
|
||||
# @param cutoff Cut-off score.
|
||||
rank_plot <- function(results, reference_gene_ids, cutoff) {
|
||||
first_not_included_rank <- results[score < cutoff, min(rank)]
|
||||
last_rank <- results[, .N]
|
||||
|
||||
# @param max_rank Last rank of the included genes.
|
||||
rank_plot <- function(results, reference_gene_ids, max_rank) {
|
||||
plot <- plotly::plot_ly() |> plotly::add_trace(
|
||||
data = results,
|
||||
x = ~rank,
|
||||
|
|
@ -35,6 +32,9 @@ rank_plot <- function(results, reference_gene_ids, cutoff) {
|
|||
yaxis = list(title = "Score")
|
||||
)
|
||||
|
||||
first_not_included_rank <- max_rank + 1
|
||||
last_rank <- results[, .N]
|
||||
|
||||
if (first_not_included_rank <= last_rank) {
|
||||
plot <- plot |> plotly::layout(
|
||||
shapes = list(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue