Skip to content

Commit 0e48c1e

Browse files
committed
dev bump ver (1.1.12)
1 parent 97568fc commit 0e48c1e

File tree

5 files changed

+74
-3
lines changed

5 files changed

+74
-3
lines changed

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: ggkegg
22
Type: Package
33
Title: KEGG pathway visualization by ggplot2
4-
Version: 1.1.11
4+
Version: 1.1.12
55
Authors@R: person("Noriaki", "Sato", email = "[email protected]", role = c("cre", "aut"))
66
Description: This package aims to import, parse, and analyze KEGG data such as KEGG PATHWAY and KEGG MODULE. The package supports visualizing KEGG information using ggplot2 and ggraph through using the grammar of graphics. The package enables the direct visualization of the results from various omics analysis packages.
77
License: MIT + file LICENSE

NAMESPACE

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
S3method(ggplot_add,geom_kegg)
44
S3method(ggplot_add,geom_node_rect_kegg)
55
S3method(ggplot_add,overlay_raw_map)
6+
export(add_title)
67
export(append_cp)
78
export(append_label_position)
89
export(assign_deseq2)

R/overlay_functions.R

+33-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ ggkeggsave <- function(filename, plot, dpi=300, wscale=90, hscale=90) {
200200
#' @export
201201
#' @importFrom grDevices dev.off png
202202
#' @import gtable
203-
#' @return output the image
203+
#' @return output the image and return the path
204204
#' @examples
205205
#' \dontrun{
206206
#' ouput_overlay_image(ggraph(pathway("hsa04110")))
@@ -301,4 +301,36 @@ output_overlay_image <- function(gg, with_legend=TRUE,
301301
out <- paste0(pid, "_ggkegg.png")
302302
}
303303
image_write(flat, out)
304+
return(out)
305+
}
306+
307+
308+
309+
#' addTitle
310+
#'
311+
#' Add the title to the image produced by output_overlay_image
312+
#' using magick.
313+
#'
314+
#' @param out the image
315+
#' @param title the title
316+
#' @param size the size
317+
#' @param height title height
318+
#' @param color bg color
319+
#' @param titleColor title color
320+
#' @param gravity positioning of the title in the blank image
321+
#' @export
322+
#' @return output the image
323+
add_title <- function(out, title=NULL, size=20, height=30, color="white",
324+
titleColor="black", gravity="west") {
325+
326+
img <- image_read(out)
327+
info <- image_info(img)
328+
w <- info$width
329+
h <- info$height
330+
blank <- image_blank(width=w, height=height, color=color)
331+
imganno <- image_annotate(blank, title, size = size,
332+
color=titleColor, gravity=gravity)
333+
res <- image_append(c(imganno, img), stack=TRUE)
334+
image_write(res, out)
335+
return(res)
304336
}

man/add_title.Rd

+38
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/output_overlay_image.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)