Skip to content

Commit

Permalink
dev bump ver (1.1.12)
Browse files Browse the repository at this point in the history
  • Loading branch information
noriakis committed Feb 3, 2024
1 parent 97568fc commit 0e48c1e
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: ggkegg
Type: Package
Title: KEGG pathway visualization by ggplot2
Version: 1.1.11
Version: 1.1.12
Authors@R: person("Noriaki", "Sato", email = "[email protected]", role = c("cre", "aut"))
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.
License: MIT + file LICENSE
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
S3method(ggplot_add,geom_kegg)
S3method(ggplot_add,geom_node_rect_kegg)
S3method(ggplot_add,overlay_raw_map)
export(add_title)
export(append_cp)
export(append_label_position)
export(assign_deseq2)
Expand Down
34 changes: 33 additions & 1 deletion R/overlay_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ ggkeggsave <- function(filename, plot, dpi=300, wscale=90, hscale=90) {
#' @export
#' @importFrom grDevices dev.off png
#' @import gtable
#' @return output the image
#' @return output the image and return the path
#' @examples
#' \dontrun{
#' ouput_overlay_image(ggraph(pathway("hsa04110")))
Expand Down Expand Up @@ -301,4 +301,36 @@ output_overlay_image <- function(gg, with_legend=TRUE,
out <- paste0(pid, "_ggkegg.png")
}
image_write(flat, out)
return(out)
}



#' addTitle
#'
#' Add the title to the image produced by output_overlay_image
#' using magick.
#'
#' @param out the image
#' @param title the title
#' @param size the size
#' @param height title height
#' @param color bg color
#' @param titleColor title color
#' @param gravity positioning of the title in the blank image
#' @export
#' @return output the image
add_title <- function(out, title=NULL, size=20, height=30, color="white",
titleColor="black", gravity="west") {

img <- image_read(out)
info <- image_info(img)
w <- info$width
h <- info$height
blank <- image_blank(width=w, height=height, color=color)
imganno <- image_annotate(blank, title, size = size,
color=titleColor, gravity=gravity)
res <- image_append(c(imganno, img), stack=TRUE)
image_write(res, out)
return(res)
}
38 changes: 38 additions & 0 deletions man/add_title.Rd

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

2 changes: 1 addition & 1 deletion man/output_overlay_image.Rd

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

0 comments on commit 0e48c1e

Please sign in to comment.