mirror of
https://github.com/johrpan/geposan.git
synced 2025-10-26 02:37:25 +01:00
plots: Rotate and simplify boxplot
This commit is contained in:
parent
c8b94fade8
commit
ba55aa124e
1 changed files with 8 additions and 6 deletions
14
R/plots.R
14
R/plots.R
|
|
@ -453,15 +453,16 @@ plot_boxplot <- function(ranking, gene_sets = NULL) {
|
||||||
plot <- plotly::plot_ly() |>
|
plot <- plotly::plot_ly() |>
|
||||||
plotly::add_boxplot(
|
plotly::add_boxplot(
|
||||||
data = ranking,
|
data = ranking,
|
||||||
x = "All genes",
|
x = ~score,
|
||||||
y = ~score,
|
y = "All genes",
|
||||||
name = "All genes",
|
name = "All genes",
|
||||||
showlegend = FALSE,
|
showlegend = FALSE,
|
||||||
|
boxpoints = FALSE,
|
||||||
line = list(color = base_color())
|
line = list(color = base_color())
|
||||||
) |>
|
) |>
|
||||||
plotly::layout(
|
plotly::layout(
|
||||||
xaxis = list(tickvals = c("All genes", names(gene_sets))),
|
xaxis = list(title = "Score"),
|
||||||
yaxis = list(title = "Score")
|
yaxis = list(tickvals = c("All genes", names(gene_sets)))
|
||||||
)
|
)
|
||||||
|
|
||||||
if (length(gene_sets) > 0) {
|
if (length(gene_sets) > 0) {
|
||||||
|
|
@ -472,10 +473,11 @@ plot_boxplot <- function(ranking, gene_sets = NULL) {
|
||||||
|
|
||||||
plot <- plot |> plotly::add_boxplot(
|
plot <- plot |> plotly::add_boxplot(
|
||||||
data = ranking[gene %chin% gene_set],
|
data = ranking[gene %chin% gene_set],
|
||||||
x = gene_set_name,
|
x = ~score,
|
||||||
y = ~score,
|
y = gene_set_name,
|
||||||
name = gene_set_name,
|
name = gene_set_name,
|
||||||
showlegend = FALSE,
|
showlegend = FALSE,
|
||||||
|
boxpoints = FALSE,
|
||||||
line = list(color = gene_set_color(index))
|
line = list(color = gene_set_color(index))
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue