mirror of
https://github.com/johrpan/geposan.git
synced 2025-10-26 10:47:25 +01:00
plots: Improve scores plot performance
This commit is contained in:
parent
35fb5e3884
commit
1f5909cc02
1 changed files with 7 additions and 3 deletions
10
R/plots.R
10
R/plots.R
|
|
@ -156,13 +156,17 @@ plot_scores <- function(ranking, gene_sets = NULL, max_rank = NULL) {
|
|||
stop("Please install \"plotly\" to use this function.")
|
||||
}
|
||||
|
||||
# To speed up rendering, don't show every single gene.
|
||||
sample_ranking <- ranking[seq(1, nrow(ranking), 5)]
|
||||
|
||||
plot <- plotly::plot_ly(colors = "Set2") |>
|
||||
plotly::add_markers(
|
||||
data = ranking,
|
||||
plotly::add_lines(
|
||||
data = sample_ranking,
|
||||
x = ~rank,
|
||||
y = ~score,
|
||||
color = "All genes",
|
||||
hoverinfo = "skip"
|
||||
hoverinfo = "skip",
|
||||
line = list(width = 4)
|
||||
) |>
|
||||
plotly::layout(
|
||||
xaxis = list(title = "Rank"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue