Skip to content

Commit 598d99a

Browse files
committed
fix color_kegg_pathway
1 parent 7e4c07b commit 598d99a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

R/visualization.R

+3-2
Original file line numberDiff line numberDiff line change
@@ -371,9 +371,10 @@ color_kegg_pathway <- function(pw_id, change_vec, scale_vals = TRUE, node_cols =
371371

372372
############ Assign the input change values to any corresponding pathway gene nodes
373373
# create pathway graph object and collect all pathway genes
374+
ggkegg_temp_dir <- tempdir()
374375

375376
g <- tryCatch({
376-
ggkegg::pathway(pid = pw_id, directory = tempdir())
377+
ggkegg::pathway(pid = pw_id, directory = ggkegg_temp_dir)
377378
}, error = function(e) {
378379
message(paste("Cannot parse KEGG pathway for:", pw_id))
379380
message("Here's the original error message:")
@@ -426,7 +427,7 @@ color_kegg_pathway <- function(pw_id, change_vec, scale_vals = TRUE, node_cols =
426427

427428
p <- ggraph::ggraph(g, layout="manual", x=igraph::V(g)$x, y=igraph::V(g)$y)
428429
p <- p + ggkegg::geom_node_rect(ggplot2::aes(filter = !is.na(.data$change_value), fill = .data$change_value))
429-
p <- p + ggkegg::overlay_raw_map(pw_id, directory = tempdir())
430+
p <- p + ggkegg::overlay_raw_map(pw_id, directory = ggkegg_temp_dir, use_cache = FALSE)
430431
p <- p + ggplot2::scale_fill_gradient2(low = low_col, mid = mid_col, high = high_col)
431432
p <- p + ggplot2::theme_void()
432433
p <- p + ggplot2::theme(

0 commit comments

Comments
 (0)