Skip to content

Commit

Permalink
Added respectLevels to plotProfileHeatmap
Browse files Browse the repository at this point in the history
  • Loading branch information
smped committed Sep 29, 2023
1 parent 38be747 commit 8ed7100
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion R/fitAssayDiff.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#' integrating multiple ChIP targets due to the increase in false-negatives when
#' using a range-based H0, and when requiring more accurate identification of
#' truly unchanged sites, as opposed to those which simply fail to achieve
#' significance using a range-based H0.
#' significance using a range-based H0 where arbitrary cutoff values are used.
#'
#' @param x a SummarizedExperiment object
#' @param assay The assay to use for analysis
Expand Down
7 changes: 5 additions & 2 deletions R/plotProfileHeatmap.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
#' Represents the fraction of the plotting area taken up by the summary panel.
#' @param summaryLabelSide Side to place y-axis for the summary plot in the top
#' panel
#' @param respectLevels logical(1) If FALSE, facets along the y-axis will be
#' arranged in descending order of signal, otherwise any original factor levels
#' will be retained
#' @param ... Passed to \link[ggplot2]{facet_grid} internally. Can be utilised
#' for switching panel strips or passing a labeller function
#'
Expand Down Expand Up @@ -140,7 +143,7 @@ setMethod(
facetX = NULL, facetY = NULL, colour = facetY, linetype = NULL,
summariseBy = c("mean", "median", "min", "max", "none"),
xLab = xValue, yLab = NULL, fillLab = fillValue, relHeight = 0.3,
summaryLabelSide = "left", ...
summaryLabelSide = "left", respectLevels = FALSE, ...
) {

## Check the profile data.frames for identical dims & required cols
Expand Down Expand Up @@ -171,7 +174,7 @@ setMethod(
tbl <- arrange(tbl, desc(!!sym(fillValue)))
## Ensure the ranges are shown with the strongest signal at the top
tbl$range <- fct_rev(fct_inorder(tbl$range))
if (!is.null(facetY))
if (!is.null(facetY) & !respectLevels)
tbl[[facetY]] <- fct_inorder(as.character(tbl[[facetY]]))

## Pass to the private function
Expand Down
2 changes: 1 addition & 1 deletion man/fitAssayDiff-methods.Rd

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

5 changes: 5 additions & 0 deletions man/plotProfileHeatmap-methods.Rd

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

0 comments on commit 8ed7100

Please sign in to comment.