Skip to content

Commit

Permalink
supports passing ID to showCategory in ridgeplot() (2024-11-06, Wed,
Browse files Browse the repository at this point in the history
  • Loading branch information
GuangchuangYu committed Nov 6, 2024
1 parent 6b4fc0d commit 43da156
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: enrichplot
Title: Visualization of Functional Enrichment Result
Version: 1.27.1.003
Version: 1.27.1.004
Authors@R: c(
person(given = "Guangchuang", family = "Yu", email = "[email protected]", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-6485-8781")),
person(given = "Chun-Hui", family = "Gao", email = "[email protected]", role = "ctb", comment = c(ORCID = "0000-0002-1445-7939")))
Expand All @@ -13,7 +13,7 @@ Imports:
ggnewscale,
ggplot2,
ggrepel (>= 0.9.0),
ggtangle (>= 0.0.4.002),
ggtangle (>= 0.0.4.003),
graphics,
grid,
igraph,
Expand Down
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# enrichplot 1.27.1.003
# enrichplot 1.27.1.004

+ supports passing ID to 'showCategory' in `ridgeplot()` (2024-11-06, Wed, #295)
+ enhancement of `cnetplot()` (2024-11-06, Wed)
- 'node_label' can be a vector of selected items/genes to specify the items to be displayed (#293)
- 'node_label' can be 'exclusive' to label genes that are uniquely belongs to categories (#253)
Expand Down
4 changes: 4 additions & 0 deletions R/ridgeplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ ridgeplot.gseaResult <- function(x, showCategory=30, fill="p.adjust",
selected <- seq_len(showCategory)
} else if (inherits(showCategory, "character")) {
ii <- match(showCategory, x@result$Description)
if (all(is.na(ii))) {
ii <- match(showCategory, x@result$ID)
}
ii <- ii[!is.na(ii)]
selected <- x@result[ii, "ID"]
} else {
warning("showCategory should be a number of pathways or a vector of selected pathways")
Expand Down

0 comments on commit 43da156

Please sign in to comment.