Skip to content

Commit

Permalink
Merge pull request #40 from genesofeve/projectionDriveR
Browse files Browse the repository at this point in the history
Projection drive r
  • Loading branch information
dimalvovs authored Apr 17, 2024
2 parents fd96af3 + 7433cff commit 326c02e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 2 additions & 4 deletions R/plotting.R
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ plotVolcano <- function(
volcano <- ggplot(data = stats,
aes(x = mean_diff, y = -log10(welch_padj),
color = Color,
label = stats$label)) +
label = label)) +
geom_vline(xintercept = c(FC, -FC), lty = "dashed") +
geom_hline(yintercept = -log10(pvalue), lty = "dashed") +
geom_point(na.rm = TRUE) +
Expand Down Expand Up @@ -355,9 +355,7 @@ pdVolcano <- function(
vol_result$plt$weighted_differential_expression +
theme(legend.position = "none"),
ncol = 2L, align = "h")
legend <- cowplot::get_legend(vol_result$plt$differential_expression +
guides(color = guide_legend(nrow = 1L)) +
theme(legend.position = "bottom"))
legend <- cowplot::get_plot_component(result$plt$differential_expression, "guide-box-bottom")
plt <- cowplot::plot_grid(pltgrid,
legend,
ncol = 1L,
Expand Down
4 changes: 1 addition & 3 deletions R/projectionDriveRfun.R
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,7 @@ projectionDriveR <- function(
result$plt$weighted_differential_expression +
theme(legend.position = "none"),
ncol = 2L, align = "h")
legend <- cowplot::get_legend(result$plt$differential_expression +
guides(color = guide_legend(nrow = 1L)) +
theme(legend.position = "bottom"))
legend <- cowplot::get_plot_component(result$plt$differential_expression, "guide-box-bottom")
plt <- cowplot::plot_grid(pltgrid, legend, ncol = 1L, rel_heights = c(1.0, 0.1))
print(plt)
}
Expand Down

0 comments on commit 326c02e

Please sign in to comment.