Allow filtering by rank

This commit is contained in:
Elias Projahn 2021-11-02 13:41:03 +01:00
parent 667eb8f2a3
commit b57297dfdf
4 changed files with 107 additions and 32 deletions

View file

@ -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(