Skip to content

Commit

Permalink
update highlight_entities
Browse files Browse the repository at this point in the history
update highlight_entities
  • Loading branch information
noriakis committed Oct 13, 2023
1 parent 7a0df7b commit 60d7355
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions R/highlight_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#' @param name which column to search for
#' @param sep separater for node names
#' @param no_sep not separate node name
#' @param type entitie type, default to 'gene'
#' @param show_type entitie type, default to 'gene'
#' @param fill_color highlight color, default to 'tomato'
#' @param legend_name legend name, NULL to suppress
#' @return overlaid map
Expand All @@ -22,7 +22,7 @@
#'
highlight_entities <- function(pathway, set, how="any",
name="graphics_name", sep=",", no_sep=FALSE,
type="gene", fill_color="tomato",
show_type="gene", fill_color="tomato",
legend_name=NULL) {
graph <- pathway(pathway, use_cache=TRUE)
x <- get.vertex.attribute(graph, name)
Expand All @@ -49,7 +49,8 @@ highlight_entities <- function(pathway, set, how="any",
graph <- graph |> mutate(highlight=vec)

res <- ggraph(graph, layout="manual", x=.data$x, y=.data$y) +
geom_node_rect(aes(filter=.data$type %in% type, fill=.data$highlight))+
geom_node_rect(aes(filter=.data$type %in% show_type,
fill=.data$highlight))+
scale_fill_manual(values=c("grey", fill_color), name=legend_name)+
overlay_raw_map()+
theme_void()
Expand Down
4 changes: 2 additions & 2 deletions man/highlight_entities.Rd

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

0 comments on commit 60d7355

Please sign in to comment.