Skip to content

Commit

Permalink
Impl y_limits option #381
Browse files Browse the repository at this point in the history
  • Loading branch information
ShixiangWang committed Aug 26, 2021
1 parent 9fc1e0a commit c7b948c
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# sigminer 2.0.5

- Impl `y_limits` option in `show_sig_profile()` (#381).
- Added function `get_pLOH_score()` for representing the genome that displayed LOH.
- Added function `read_copynumber_ascat()` for reading ASCAT result ASCAT object in `.rds` format.
- Added function `get_intersect_size()` for getting overlap size between intervals.
Expand Down
8 changes: 7 additions & 1 deletion R/show_sig_profile.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#' @param x_label_hjust font hjust for x label.
#' @param x_lab x axis lab.
#' @param y_lab y axis lab.
#' @param y_limits limits to expand in y axis. e.g., `0.2`, `c(0, 0.3)`.
#' @param params params `data.frame` of components, obtained from [sig_tally].
#' @param show_cv default is `FALSE`, if `TRUE`, show coefficient of variation when
#' `params` is not `NULL`.
Expand Down Expand Up @@ -124,6 +125,7 @@ show_sig_profile <- function(Signature,
x_label_hjust = 1,
x_lab = "Components",
y_lab = "auto",
y_limits = NULL,
params = NULL, show_cv = FALSE,
params_label_size = 3,
params_label_angle = 60, y_expand = 1,
Expand Down Expand Up @@ -576,6 +578,10 @@ show_sig_profile <- function(Signature,
}
}

if (!is.null(y_limits)) {
p <- p + expand_limits(y = y_limits)
}

p <- p + facet_grid(class ~ base, scales = "free", space = free_space)

p <- p + scale_y_continuous(
Expand Down Expand Up @@ -668,7 +674,7 @@ show_sig_profile <- function(Signature,
# <<<<<<<<<<<<<<<<< Setting theme

p <- p +
guides(fill = FALSE) + .theme_ss
guides(fill = "none") + .theme_ss

if (all(mode == "copynumber", !is.null(params))) {
p <- p + theme(plot.margin = margin(30 * y_expand, 2, 2, 2, unit = "pt")) # Add regions
Expand Down
1 change: 1 addition & 0 deletions docs/news/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions docs/reference/show_sig_profile.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/show_sig_profile.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# File R/show_sig_profile.R: @testexamples

test_that("Function show_sig_profile() @ L104", {
test_that("Function show_sig_profile() @ L105", {

# Load SBS signature
load(system.file("extdata", "toy_mutational_signature.RData",
Expand Down

0 comments on commit c7b948c

Please sign in to comment.