diff --git a/R/ggkegg.R b/R/ggkegg.R index 821bcaa..9c60ece 100644 --- a/R/ggkegg.R +++ b/R/ggkegg.R @@ -214,7 +214,8 @@ ggkegg <- function(pid, #' @examples #' if (require("clusterProfiler")) { #' cp <- enrichKEGG(c("1029","4171")) -#' \dontrun{rawMap(list(cp,cp), pid="hsa04110")} +#' ## Multiple class object can be passed by list +#' rawMap(list(cp,cp), pid="hsa04110") #' } #' @return ggraph with overlaid KEGG map #' @@ -300,6 +301,7 @@ rawMap <- function(enrich, pathway_number=1, pid=NULL, #' typically, "gene", "ortholog", or "compound" #' @export #' @examples +#' ## Colorize by passing the named vector of numeric values #' rv <- rawValue(c(1.1) |> setNames("hsa:6737"), #' man_graph=create_test_pathway()) #' @return ggraph with overlaid KEGG map diff --git a/R/highlight_functions.R b/R/highlight_functions.R index 8abf980..a2c4e69 100644 --- a/R/highlight_functions.R +++ b/R/highlight_functions.R @@ -16,7 +16,12 @@ #' @return boolean vector #' @examples #' graph <- create_test_pathway() +#' ## Highlight set of nodes by specifying ID #' graph <- graph |> mutate(hl=highlight_set_nodes(c("hsa:51428"))) +#' +#' ## node column can be specified by `name` argument +#' graph <- graph |> +#' mutate(hl=highlight_set_nodes(c("DDX41"), name="graphics_name")) highlight_set_nodes <- function(set, how="all", name="name", sep=" ", no_sep=FALSE) { graph <- .G() @@ -63,6 +68,10 @@ highlight_set_nodes <- function(set, how="all", #' @return boolean vector #' @examples #' graph <- create_test_pathway() +#' +#' ## Specify edge column by `name` +#' ## In this example, edges having `degradation` value in +#' ## `subtype_name` column will be highlighted #' graph <- graph |> activate("edges") |> #' mutate(hl=highlight_set_edges(c("degradation"), name="subtype_name")) #' @@ -110,6 +119,7 @@ highlight_set_edges <- function(set, how="all", #' @export #' @return boolean vector #' @examples +#' ## Highlight module within the pathway #' graph <- create_test_pathway() #' mo <- create_test_module() #' graph <- graph |> highlight_module(mo) diff --git a/man/highlight_module.Rd b/man/highlight_module.Rd index 2e92bbb..6167b30 100644 --- a/man/highlight_module.Rd +++ b/man/highlight_module.Rd @@ -27,6 +27,7 @@ the same as KEGG mapper. For instance, `R04293` involved in `M00912` is not included in KGML of `ko01100`. } \examples{ +## Highlight module within the pathway graph <- create_test_pathway() mo <- create_test_module() graph <- graph |> highlight_module(mo) diff --git a/man/highlight_set_edges.Rd b/man/highlight_set_edges.Rd index 895b86b..14fd2c8 100644 --- a/man/highlight_set_edges.Rd +++ b/man/highlight_set_edges.Rd @@ -30,6 +30,10 @@ only return TRUE if all the IDs are in the query. } \examples{ graph <- create_test_pathway() + +## Specify edge column by `name` +## In this example, edges having `degradation` value in +## `subtype_name` column will be highlighted graph <- graph |> activate("edges") |> mutate(hl=highlight_set_edges(c("degradation"), name="subtype_name")) diff --git a/man/highlight_set_nodes.Rd b/man/highlight_set_nodes.Rd index a20d493..0599f9d 100644 --- a/man/highlight_set_nodes.Rd +++ b/man/highlight_set_nodes.Rd @@ -30,5 +30,10 @@ only return TRUE if all the IDs are in the query. } \examples{ graph <- create_test_pathway() +## Highlight set of nodes by specifying ID graph <- graph |> mutate(hl=highlight_set_nodes(c("hsa:51428"))) + +## node column can be specified by `name` argument +graph <- graph |> + mutate(hl=highlight_set_nodes(c("DDX41"), name="graphics_name")) } diff --git a/man/rawMap.Rd b/man/rawMap.Rd index 51d5930..ac9cfd1 100644 --- a/man/rawMap.Rd +++ b/man/rawMap.Rd @@ -38,6 +38,7 @@ enriched pathway. Can be used with the function such as \examples{ if (require("clusterProfiler")) { cp <- enrichKEGG(c("1029","4171")) - \dontrun{rawMap(list(cp,cp), pid="hsa04110")} + ## Multiple class object can be passed by list + rawMap(list(cp,cp), pid="hsa04110") } } diff --git a/man/rawValue.Rd b/man/rawValue.Rd index d30426d..c8b1eed 100644 --- a/man/rawValue.Rd +++ b/man/rawValue.Rd @@ -42,6 +42,7 @@ return the ggplot object with raw KEGG map overlaid. Colors can be changed afterwards. } \examples{ +## Colorize by passing the named vector of numeric values rv <- rawValue(c(1.1) |> setNames("hsa:6737"), man_graph=create_test_pathway()) }