From 90959ba1b0ab01a428206c3139eb570764a26a62 Mon Sep 17 00:00:00 2001 From: "AJ.Bassa" Date: Thu, 3 Apr 2025 11:38:32 +0200 Subject: [PATCH 01/34] Added output.dir --- R/keggview.native.R | 11 ++++++++++- R/pathview.R | 3 ++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/R/keggview.native.R b/R/keggview.native.R index 9e946da..f7edd53 100644 --- a/R/keggview.native.R +++ b/R/keggview.native.R @@ -8,6 +8,7 @@ function( pathway.name, out.suffix="pathview", kegg.dir=".", + output.dir = ".", multi.state=TRUE, match.data=TRUE, @@ -82,7 +83,15 @@ if(multi.state) { for(np in 1:nplots){ #plot setup - img.file =paste(pathway.name,pn.suffix[np],"png", sep=".") + if (output.dir == ".") { + img.file = paste(pathway.name,pn.suffix[np],"png", sep=".") + } else { + if (dir.exists(output.dir)) + img.file = paste0(output.dir, paste(pathway.name,pn.suffix[np],"png", sep=".")) + else + warning("Specified output directory ", output.folder, " does not exists. Saved images in working directory.") + } + out.msg=sprintf(out.fmt, img.file) message("Info: ", out.msg) png(img.file, width = width, height = height, res=res) diff --git a/R/pathview.R b/R/pathview.R index 2c7adbc..984cde8 100644 --- a/R/pathview.R +++ b/R/pathview.R @@ -6,6 +6,7 @@ function( pathway.id, species = "hsa", kegg.dir=".", + output.dir = ".", cpd.idtype="kegg", gene.idtype="entrez", gene.annotpkg=NULL, @@ -252,7 +253,7 @@ function( } else plot.data.cpd=cols.ts.cpd=NULL if(kegg.native){ - pv.pars= keggview.native(plot.data.gene=plot.data.gene, cols.ts.gene=cols.ts.gene, plot.data.cpd=plot.data.cpd, cols.ts.cpd=cols.ts.cpd, node.data=node.data, pathway.name=pathway.name[i], kegg.dir=kegg.dir, limit=limit, bins=bins, both.dirs=both.dirs,discrete=discrete, low=low, mid=mid, high=high, na.col=na.col, ...) + pv.pars= keggview.native(plot.data.gene=plot.data.gene, cols.ts.gene=cols.ts.gene, plot.data.cpd=plot.data.cpd, cols.ts.cpd=cols.ts.cpd, node.data=node.data, pathway.name=pathway.name[i], kegg.dir=kegg.dir, output.dir = output.dir, limit=limit, bins=bins, both.dirs=both.dirs,discrete=discrete, low=low, mid=mid, high=high, na.col=na.col, ...) } else{ pv.pars= keggview.graph(plot.data.gene=plot.data.gene, cols.ts.gene=cols.ts.gene, plot.data.cpd=plot.data.cpd, cols.ts.cpd=cols.ts.cpd, node.data=node.data, path.graph=gR1, pathway.name=pathway.name[i], map.cpdname=map.cpdname, split.group=split.group, limit=limit, bins=bins, both.dirs=both.dirs, discrete=discrete, low=low, mid=mid, high=high, na.col=na.col, ...) } From c94074772167e79997c01da18557136eecb0c9fc Mon Sep 17 00:00:00 2001 From: "AJ.Bassa" Date: Thu, 3 Apr 2025 11:39:33 +0200 Subject: [PATCH 02/34] Description --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 67a6920..886b830 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: pathview +Package: pathview-AJB Type: Package Title: a tool set for pathway based data integration and visualization Version: 1.47.1 From 354d1eceb5d468cb0ccd530076cf2dc445845d35 Mon Sep 17 00:00:00 2001 From: "AJ.Bassa" Date: Thu, 3 Apr 2025 11:40:07 +0200 Subject: [PATCH 03/34] --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 886b830..67a6920 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: pathview-AJB +Package: pathview Type: Package Title: a tool set for pathway based data integration and visualization Version: 1.47.1 From 710f4a33dcd5403510e890110cba79ed6cacd148 Mon Sep 17 00:00:00 2001 From: "AJ.Bassa" Date: Thu, 3 Apr 2025 11:41:34 +0200 Subject: [PATCH 04/34] Added output.dir --- R/keggview.native.R | 1 + 1 file changed, 1 insertion(+) diff --git a/R/keggview.native.R b/R/keggview.native.R index f7edd53..10ed82c 100644 --- a/R/keggview.native.R +++ b/R/keggview.native.R @@ -90,6 +90,7 @@ for(np in 1:nplots){ img.file = paste0(output.dir, paste(pathway.name,pn.suffix[np],"png", sep=".")) else warning("Specified output directory ", output.folder, " does not exists. Saved images in working directory.") + img.file = paste(pathway.name,pn.suffix[np],"png", sep=".") } out.msg=sprintf(out.fmt, img.file) From 46f4858f540f19816a4919d89b32468e9130cf54 Mon Sep 17 00:00:00 2001 From: "AJ.Bassa" Date: Thu, 3 Apr 2025 11:46:31 +0200 Subject: [PATCH 05/34] --- R/keggview.native.R | 3 +++ 1 file changed, 3 insertions(+) diff --git a/R/keggview.native.R b/R/keggview.native.R index 10ed82c..228415e 100644 --- a/R/keggview.native.R +++ b/R/keggview.native.R @@ -84,6 +84,7 @@ if(multi.state) { for(np in 1:nplots){ #plot setup if (output.dir == ".") { + message("Info AJB 1:", output.dir) img.file = paste(pathway.name,pn.suffix[np],"png", sep=".") } else { if (dir.exists(output.dir)) @@ -93,6 +94,8 @@ for(np in 1:nplots){ img.file = paste(pathway.name,pn.suffix[np],"png", sep=".") } + message("Info AJB 2:", output.img.file) + out.msg=sprintf(out.fmt, img.file) message("Info: ", out.msg) png(img.file, width = width, height = height, res=res) From 71acdf483ded0068f10b44da710cbda19cf851fe Mon Sep 17 00:00:00 2001 From: "AJ.Bassa" Date: Thu, 3 Apr 2025 11:47:37 +0200 Subject: [PATCH 06/34] --- R/keggview.native.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/R/keggview.native.R b/R/keggview.native.R index 228415e..5893408 100644 --- a/R/keggview.native.R +++ b/R/keggview.native.R @@ -87,6 +87,7 @@ for(np in 1:nplots){ message("Info AJB 1:", output.dir) img.file = paste(pathway.name,pn.suffix[np],"png", sep=".") } else { + message("Info AJB 2:", output.dir) if (dir.exists(output.dir)) img.file = paste0(output.dir, paste(pathway.name,pn.suffix[np],"png", sep=".")) else @@ -94,7 +95,7 @@ for(np in 1:nplots){ img.file = paste(pathway.name,pn.suffix[np],"png", sep=".") } - message("Info AJB 2:", output.img.file) + message("Info AJB 3:", img.file) out.msg=sprintf(out.fmt, img.file) message("Info: ", out.msg) From 2f888cadc668e804ee654c6f0971a59165ef8ced Mon Sep 17 00:00:00 2001 From: "AJ.Bassa" Date: Thu, 3 Apr 2025 11:49:34 +0200 Subject: [PATCH 07/34] Added output.dir --- R/keggview.native.R | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/R/keggview.native.R b/R/keggview.native.R index 5893408..82a128f 100644 --- a/R/keggview.native.R +++ b/R/keggview.native.R @@ -88,11 +88,12 @@ for(np in 1:nplots){ img.file = paste(pathway.name,pn.suffix[np],"png", sep=".") } else { message("Info AJB 2:", output.dir) - if (dir.exists(output.dir)) + if (dir.exists(output.dir)) { img.file = paste0(output.dir, paste(pathway.name,pn.suffix[np],"png", sep=".")) - else + } else { warning("Specified output directory ", output.folder, " does not exists. Saved images in working directory.") img.file = paste(pathway.name,pn.suffix[np],"png", sep=".") + } } message("Info AJB 3:", img.file) From 3d254d7eaede154786cdd714a29e09a1ce7b8f78 Mon Sep 17 00:00:00 2001 From: "AJ.Bassa" Date: Thu, 3 Apr 2025 11:51:08 +0200 Subject: [PATCH 08/34] Added output.dir --- R/keggview.native.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/keggview.native.R b/R/keggview.native.R index 82a128f..9c1b558 100644 --- a/R/keggview.native.R +++ b/R/keggview.native.R @@ -89,7 +89,7 @@ for(np in 1:nplots){ } else { message("Info AJB 2:", output.dir) if (dir.exists(output.dir)) { - img.file = paste0(output.dir, paste(pathway.name,pn.suffix[np],"png", sep=".")) + img.file = paste0(output.dir, "/", paste(pathway.name,pn.suffix[np],"png", sep=".")) } else { warning("Specified output directory ", output.folder, " does not exists. Saved images in working directory.") img.file = paste(pathway.name,pn.suffix[np],"png", sep=".") From a34483e635a957070b30cedcd0c9faab5210178b Mon Sep 17 00:00:00 2001 From: "AJ.Bassa" Date: Thu, 3 Apr 2025 11:56:05 +0200 Subject: [PATCH 09/34] Removed debugging info --- R/keggview.native.R | 4 ---- 1 file changed, 4 deletions(-) diff --git a/R/keggview.native.R b/R/keggview.native.R index 9c1b558..450d7ae 100644 --- a/R/keggview.native.R +++ b/R/keggview.native.R @@ -84,10 +84,8 @@ if(multi.state) { for(np in 1:nplots){ #plot setup if (output.dir == ".") { - message("Info AJB 1:", output.dir) img.file = paste(pathway.name,pn.suffix[np],"png", sep=".") } else { - message("Info AJB 2:", output.dir) if (dir.exists(output.dir)) { img.file = paste0(output.dir, "/", paste(pathway.name,pn.suffix[np],"png", sep=".")) } else { @@ -96,8 +94,6 @@ for(np in 1:nplots){ } } - message("Info AJB 3:", img.file) - out.msg=sprintf(out.fmt, img.file) message("Info: ", out.msg) png(img.file, width = width, height = height, res=res) From 2df60e6bb1621fd5d890c06556e09e0eb43e5e4f Mon Sep 17 00:00:00 2001 From: "AJ.Bassa" Date: Thu, 3 Apr 2025 11:57:44 +0200 Subject: [PATCH 10/34] Corrected spelling mistake --- R/keggview.native.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/keggview.native.R b/R/keggview.native.R index 450d7ae..41c8782 100644 --- a/R/keggview.native.R +++ b/R/keggview.native.R @@ -89,7 +89,7 @@ for(np in 1:nplots){ if (dir.exists(output.dir)) { img.file = paste0(output.dir, "/", paste(pathway.name,pn.suffix[np],"png", sep=".")) } else { - warning("Specified output directory ", output.folder, " does not exists. Saved images in working directory.") + warning("Specified output directory ", output.folder, " does not exist. Saved images in working directory.") img.file = paste(pathway.name,pn.suffix[np],"png", sep=".") } } From 901b064d4fa9d3a3050d17501757ddadf22bbef3 Mon Sep 17 00:00:00 2001 From: "AJ.Bassa" Date: Thu, 3 Apr 2025 12:15:05 +0200 Subject: [PATCH 11/34] Cleaned code to add output.dir. Added option to add output.dir for keggview.graph.R --- R/keggview.graph.R | 10 +++++++--- R/keggview.native.R | 15 +++++---------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/R/keggview.graph.R b/R/keggview.graph.R index 750fa41..cb47bb5 100644 --- a/R/keggview.graph.R +++ b/R/keggview.graph.R @@ -276,9 +276,13 @@ if(multi.state) { if(sum(cpd.idx)>0) ell.col.plot=ell.col } -for(np in 1:nplots){ - gfile=paste(pathway.name, pn.suffix[np],"pdf", sep=".") -# gfile=paste(pathway.name, pn.suffix[1],"pdf", sep=".") +for(np in 1:nplots) { + if (!dir.exists(output.dir)) { + warning("Specified output directory ", output.dir, " does not exist. Saved images in working directory.") + output.dir = "." + } + gfile <- file.path(output.dir, paste(pathway.name, pn.suffix[np], "pdf", sep = ".")) + out.msg=sprintf(out.fmt, gfile) message("Info: ", out.msg) diff --git a/R/keggview.native.R b/R/keggview.native.R index 41c8782..ad01cd5 100644 --- a/R/keggview.native.R +++ b/R/keggview.native.R @@ -83,16 +83,11 @@ if(multi.state) { for(np in 1:nplots){ #plot setup - if (output.dir == ".") { - img.file = paste(pathway.name,pn.suffix[np],"png", sep=".") - } else { - if (dir.exists(output.dir)) { - img.file = paste0(output.dir, "/", paste(pathway.name,pn.suffix[np],"png", sep=".")) - } else { - warning("Specified output directory ", output.folder, " does not exist. Saved images in working directory.") - img.file = paste(pathway.name,pn.suffix[np],"png", sep=".") - } - } + if (!dir.exists(output.dir)) { + warning("Specified output directory ", output.dir, " does not exist. Saved images in working directory.") + output.dir = "." + } + img.file <- file.path(output.dir, paste(pathway.name, pn.suffix[np], "png", sep = ".")) out.msg=sprintf(out.fmt, img.file) message("Info: ", out.msg) From 334fbf5b0b4a7476476bcf804a84815e06995ca9 Mon Sep 17 00:00:00 2001 From: "AJ.Bassa" Date: Thu, 3 Apr 2025 12:15:40 +0200 Subject: [PATCH 12/34] Added option to add output.dir for keggview.graph.R --- R/pathview.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/pathview.R b/R/pathview.R index 984cde8..7eec004 100644 --- a/R/pathview.R +++ b/R/pathview.R @@ -255,7 +255,7 @@ function( if(kegg.native){ pv.pars= keggview.native(plot.data.gene=plot.data.gene, cols.ts.gene=cols.ts.gene, plot.data.cpd=plot.data.cpd, cols.ts.cpd=cols.ts.cpd, node.data=node.data, pathway.name=pathway.name[i], kegg.dir=kegg.dir, output.dir = output.dir, limit=limit, bins=bins, both.dirs=both.dirs,discrete=discrete, low=low, mid=mid, high=high, na.col=na.col, ...) } else{ - pv.pars= keggview.graph(plot.data.gene=plot.data.gene, cols.ts.gene=cols.ts.gene, plot.data.cpd=plot.data.cpd, cols.ts.cpd=cols.ts.cpd, node.data=node.data, path.graph=gR1, pathway.name=pathway.name[i], map.cpdname=map.cpdname, split.group=split.group, limit=limit, bins=bins, both.dirs=both.dirs, discrete=discrete, low=low, mid=mid, high=high, na.col=na.col, ...) + pv.pars= keggview.graph(plot.data.gene=plot.data.gene, cols.ts.gene=cols.ts.gene, plot.data.cpd=plot.data.cpd, cols.ts.cpd=cols.ts.cpd, node.data=node.data, path.graph=gR1, pathway.name=pathway.name[i], map.cpdname=map.cpdname, split.group=split.group, limit=limit, bins=bins, both.dirs=both.dirs, discrete=discrete, low=low, mid=mid, high=high, na.col=na.col, output.dir = output.dir, ...) } plot.data.gene=cbind(plot.data.gene, cols.ts.gene) From ba4fb15f6cfc504ba0cedf9006c41d3d0ac23a32 Mon Sep 17 00:00:00 2001 From: "AJ.Bassa" Date: Thu, 3 Apr 2025 12:17:59 +0200 Subject: [PATCH 13/34] Added option to add output.dir for keggview.graph.R --- R/keggview.graph.R | 1 + 1 file changed, 1 insertion(+) diff --git a/R/keggview.graph.R b/R/keggview.graph.R index cb47bb5..d77b833 100644 --- a/R/keggview.graph.R +++ b/R/keggview.graph.R @@ -8,6 +8,7 @@ keggview.graph <-function( pathway.name, out.suffix="pathview", pdf.size=c(7,7), + output.dir = ".", multi.state=TRUE, same.layer=TRUE, From 6fae1bd2c1fcfb5ad085edd6d8f8ece9b26be032 Mon Sep 17 00:00:00 2001 From: "AJ.Bassa" Date: Thu, 3 Apr 2025 12:27:20 +0200 Subject: [PATCH 14/34] --- R/render.kegg.node.R | 2 ++ 1 file changed, 2 insertions(+) diff --git a/R/render.kegg.node.R b/R/render.kegg.node.R index 12f69d7..4beff30 100644 --- a/R/render.kegg.node.R +++ b/R/render.kegg.node.R @@ -1,5 +1,7 @@ render.kegg.node <- function(plot.data, cols.ts, img, same.layer=TRUE, type=c("gene","compound")[1], text.col="black", cex=0.25){ + tmpajb = plot.data + width=ncol(img) height=nrow(img) nn=nrow(plot.data) From e7141102d123c6af8a67f1a1d4d3aabc90a321f3 Mon Sep 17 00:00:00 2001 From: "AJ.Bassa" Date: Thu, 3 Apr 2025 12:30:12 +0200 Subject: [PATCH 15/34] --- R/render.kegg.node.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/render.kegg.node.R b/R/render.kegg.node.R index 4beff30..f0ae943 100644 --- a/R/render.kegg.node.R +++ b/R/render.kegg.node.R @@ -1,7 +1,7 @@ render.kegg.node <- function(plot.data, cols.ts, img, same.layer=TRUE, type=c("gene","compound")[1], text.col="black", cex=0.25){ - tmpajb = plot.data - + assign("tmpajb", plot.data, , envir = .GlobalEnv) + width=ncol(img) height=nrow(img) nn=nrow(plot.data) From e31258fb3e254a7d3dd3754dce82d3006b5d94ef Mon Sep 17 00:00:00 2001 From: "AJ.Bassa" Date: Thu, 3 Apr 2025 12:31:54 +0200 Subject: [PATCH 16/34] --- R/render.kegg.node.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/render.kegg.node.R b/R/render.kegg.node.R index f0ae943..cdcfc95 100644 --- a/R/render.kegg.node.R +++ b/R/render.kegg.node.R @@ -1,6 +1,6 @@ render.kegg.node <- function(plot.data, cols.ts, img, same.layer=TRUE, type=c("gene","compound")[1], text.col="black", cex=0.25){ - assign("tmpajb", plot.data, , envir = .GlobalEnv) + data(plot.data) width=ncol(img) height=nrow(img) From 27dcf9fb0b8185f524efe08e630ca9d63d6fa03b Mon Sep 17 00:00:00 2001 From: "AJ.Bassa" Date: Thu, 3 Apr 2025 12:39:52 +0200 Subject: [PATCH 17/34] Update render.kegg.node.R --- R/render.kegg.node.R | 2 -- 1 file changed, 2 deletions(-) diff --git a/R/render.kegg.node.R b/R/render.kegg.node.R index cdcfc95..12f69d7 100644 --- a/R/render.kegg.node.R +++ b/R/render.kegg.node.R @@ -1,7 +1,5 @@ render.kegg.node <- function(plot.data, cols.ts, img, same.layer=TRUE, type=c("gene","compound")[1], text.col="black", cex=0.25){ - data(plot.data) - width=ncol(img) height=nrow(img) nn=nrow(plot.data) From cf08f37bbe18a3c8fbc57fe172fefb5a6c6f8a29 Mon Sep 17 00:00:00 2001 From: "AJ.Bassa" Date: Thu, 3 Apr 2025 13:13:08 +0200 Subject: [PATCH 18/34] Updated pathview.Rd --- man/pathview.Rd | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/man/pathview.Rd b/man/pathview.Rd index 93fb647..2a073c0 100644 --- a/man/pathview.Rd +++ b/man/pathview.Rd @@ -21,7 +21,7 @@ interface to downloader, parser, mapper and viewer functions. } \usage{ pathview(gene.data = NULL, cpd.data = NULL, pathway.id, -species = "hsa", kegg.dir = ".", cpd.idtype = "kegg", gene.idtype = +species = "hsa", kegg.dir = ".", output.dir = ".", cpd.idtype = "kegg", gene.idtype = "entrez", gene.annotpkg = NULL, min.nnodes = 3, kegg.native = TRUE, map.null = TRUE, expand.node = FALSE, split.group = FALSE, map.symbol = TRUE, map.cpdname = TRUE, node.sum = "sum", discrete=list(gene=FALSE, @@ -93,6 +93,9 @@ character, the directory of KEGG pathway data file (.xml) and image file naming convention of KEGG's (species code + pathway id, e.g. hsa04110.xml, hsa04110.png etc) in this directory. Default kegg.dir="." (current working directory). +} + \item{output.dir}{ +character, the directory for the output (.png or .pdf). Default output.dir = "." (current working directory) } \item{cpd.idtype}{ character, ID type used for the cpd.data. Default cpd.idtype="kegg" (include From f6b51d742a6fcd7a41282b12f1ebd7d24ecc16ae Mon Sep 17 00:00:00 2001 From: "AJ.Bassa" Date: Fri, 4 Apr 2025 15:22:41 +0200 Subject: [PATCH 19/34] Resolved some spelling issues --- man/pathview.Rd | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/man/pathview.Rd b/man/pathview.Rd index 2a073c0..e2624f9 100644 --- a/man/pathview.Rd +++ b/man/pathview.Rd @@ -135,7 +135,7 @@ logical, whether the multiple-gene nodes are expanded into single-gene nodes. Each expanded single-gene nodes inherits all edges from the original multiple-gene node. This option only affects graphviz graph view, i.e. when kegg.native=FALSE. This option is not effective for most metabolic -pathways where it conflits with converting reactions to edges. Default expand.node=FLASE. +pathways where it conflits with converting reactions to edges. Default expand.node=FALSE. } \item{split.group}{ logical, whether split node groups are split to individual nodes. Each @@ -145,7 +145,7 @@ kegg.native=FALSE. This option also effects most metabolic pathways even without group nodes defined orginally. For these pathways, genes involved in the same reaction are grouped automatically when converting reactions to edges unless split.group=TRUE. d -split.group=FLASE. +split.group=FALSE. } \item{map.symbol}{ logical, whether map gene IDs to symbols for gene node labels or use the @@ -168,7 +168,7 @@ kept. Default map.cpdname=TRUE. \item{discrete}{ a list of two logical elements with "gene" and "cpd" as the names. This argument tells whether gene.data or cpd.data should be treated as -discrete. Default dsicrete=list(gene=FALSE, cpd=FALSE), i.e. both data should +discrete. Default discrete=list(gene=FALSE, cpd=FALSE), i.e. both data should be treated as continuous. } \item{limit}{ @@ -219,7 +219,7 @@ special arguments for keggview.native or keggview.graph function. data.frame returned by node.map function for rendering mapped gene nodes, including node name, type, positions (x, y), sizes (width, height), and mapped gene.data. This data is also used as input for - pseduo-color coding through node.color function. Default plot.data.gene=NULL. + pseudo-color coding through node.color function. Default plot.data.gene=NULL. } \item{plot.data.cpd}{ same as plot.data.gene function, except for mapped compound node data. d @@ -260,7 +260,7 @@ character, the suffix to be added after the pathway name as part of the paired. Default match.data=TRUE. When let sample sizes of gene.data and cpd.data be m and n, when m>n, extra columns of NA's (mapped to no color) will be added to cpd.data as to make the sample size the - same. This will result in the smae number of slice in gene nodes and + same. This will result in the same number of slice in gene nodes and compound when multi.state=TRUE. } \item{same.layer}{ @@ -295,14 +295,14 @@ character, controlling how the color keys are aligned when both by x coordinates, and "y", aligned by y coordinates. Default key.align="x". } \item{key.pos}{ -character, controlling the position of color key(s). Potentail values +character, controlling the position of color key(s). Potential values are "bottomleft", "bottomright", "topleft" and "topright". d key.pos="topright". } \item{sign.pos}{ character, controlling the position of pathview signature. Only effective when kegg.native=FALSE, Signature position is fixed in place - of the original KEGG signature when kegg.native=TRUE. Potentail values + of the original KEGG signature when kegg.native=TRUE. Potential values are "bottomleft", "bottomright", "topleft" and "topright". d sign.pos="bottomright". } @@ -331,7 +331,7 @@ kegg.native=FALSE. Default is.signal=TRUE. \item{afactor}{ numeric, node amplifying factor. This argument is for node size fine-tuning, its effect is subtler than expected. Only effective when -kegg.native=FALSE. Default afctor=1. +kegg.native=FALSE. Default afactor=1. } \item{text.width}{ numeric, specifying the line width for text wrap. Only effective when From 9046a0d6701e02fc33d2b66c9755a1014f7a29aa Mon Sep 17 00:00:00 2001 From: "AJ.Bassa" Date: Mon, 7 Apr 2025 16:09:01 +0200 Subject: [PATCH 20/34] --- .vscode/settings.json | 5 +++++ R/keggview.native.R | 4 ++++ 2 files changed, 9 insertions(+) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..0589549 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "githubPullRequests.ignoredPullRequestBranches": [ + "master" + ] +} \ No newline at end of file diff --git a/R/keggview.native.R b/R/keggview.native.R index ad01cd5..2e52fd1 100644 --- a/R/keggview.native.R +++ b/R/keggview.native.R @@ -11,6 +11,7 @@ function( output.dir = ".", multi.state=TRUE, + multi.labels=FALSE, match.data=TRUE, same.layer=TRUE, # res=300, # @@ -128,6 +129,9 @@ if(!is.null(cols.ts.cpd) & nc.cpd>=np){ off.sets=c(x=0,y=0) align="n" +if (multi.labels == TRUE) + text(x = colnames(x = 0, y = 0, labels = plot.data.gene)) + # na.col=colorpanel2(1, low=na.col, high=na.col) ucol.gene=unique(as.vector(cols.ts.gene)) na.col.gene=ucol.gene %in% c(na.col, NA) From 33cba0ff8162f93b553a66923d1224e5b9cfdddf Mon Sep 17 00:00:00 2001 From: "AJ.Bassa" Date: Mon, 7 Apr 2025 16:11:10 +0200 Subject: [PATCH 21/34] --- R/keggview.native.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/keggview.native.R b/R/keggview.native.R index 2e52fd1..5e6c454 100644 --- a/R/keggview.native.R +++ b/R/keggview.native.R @@ -130,7 +130,7 @@ if(!is.null(cols.ts.cpd) & nc.cpd>=np){ align="n" if (multi.labels == TRUE) - text(x = colnames(x = 0, y = 0, labels = plot.data.gene)) + text(x = 0, y = 0, labels = colnames(plot.data.gene)) # na.col=colorpanel2(1, low=na.col, high=na.col) ucol.gene=unique(as.vector(cols.ts.gene)) From 25502a9472518a80f8be1ef93d9c245fc94924c0 Mon Sep 17 00:00:00 2001 From: "AJ.Bassa" Date: Mon, 7 Apr 2025 16:13:29 +0200 Subject: [PATCH 22/34] --- R/keggview.native.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/keggview.native.R b/R/keggview.native.R index 5e6c454..e086c24 100644 --- a/R/keggview.native.R +++ b/R/keggview.native.R @@ -130,7 +130,7 @@ if(!is.null(cols.ts.cpd) & nc.cpd>=np){ align="n" if (multi.labels == TRUE) - text(x = 0, y = 0, labels = colnames(plot.data.gene)) + text(x = 35, y = 17, labels = colnames(plot.data.gene), cex = 0.5) # na.col=colorpanel2(1, low=na.col, high=na.col) ucol.gene=unique(as.vector(cols.ts.gene)) From ba833bab9f9e85fb9022458dd74e0389f3f7afc0 Mon Sep 17 00:00:00 2001 From: "AJ.Bassa" Date: Mon, 7 Apr 2025 16:42:48 +0200 Subject: [PATCH 23/34] --- R/keggview.native.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/keggview.native.R b/R/keggview.native.R index e086c24..7880f9d 100644 --- a/R/keggview.native.R +++ b/R/keggview.native.R @@ -130,7 +130,7 @@ if(!is.null(cols.ts.cpd) & nc.cpd>=np){ align="n" if (multi.labels == TRUE) - text(x = 35, y = 17, labels = colnames(plot.data.gene), cex = 0.5) + text(x = 150, y = 100, labels = paste(colnames(plot.data.gene), collapse = "|"), cex = 0.5) # na.col=colorpanel2(1, low=na.col, high=na.col) ucol.gene=unique(as.vector(cols.ts.gene)) From 176c8aa3a139b609270d2eb3f1326e4fcf3beef2 Mon Sep 17 00:00:00 2001 From: "AJ.Bassa" Date: Mon, 7 Apr 2025 16:50:48 +0200 Subject: [PATCH 24/34] Add text with labels for multi plot --- R/keggview.native.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/keggview.native.R b/R/keggview.native.R index 7880f9d..7e6806c 100644 --- a/R/keggview.native.R +++ b/R/keggview.native.R @@ -11,7 +11,7 @@ function( output.dir = ".", multi.state=TRUE, - multi.labels=FALSE, + multi.labels="", match.data=TRUE, same.layer=TRUE, # res=300, # @@ -129,8 +129,8 @@ if(!is.null(cols.ts.cpd) & nc.cpd>=np){ off.sets=c(x=0,y=0) align="n" -if (multi.labels == TRUE) - text(x = 150, y = 100, labels = paste(colnames(plot.data.gene), collapse = "|"), cex = 0.5) +if (multi.state & length(multi.labels) > 0) + text(x = 17, y = height, labels = paste(multi.labels, collapse = "|"), pos = 4, cex = 0.15) # na.col=colorpanel2(1, low=na.col, high=na.col) ucol.gene=unique(as.vector(cols.ts.gene)) From a18cf3ff990ee46000b9ee32bd8b5632f9ad3c2a Mon Sep 17 00:00:00 2001 From: "AJ.Bassa" Date: Mon, 7 Apr 2025 16:51:13 +0200 Subject: [PATCH 25/34] --- R/keggview.native.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/keggview.native.R b/R/keggview.native.R index 7e6806c..12bfd24 100644 --- a/R/keggview.native.R +++ b/R/keggview.native.R @@ -130,7 +130,7 @@ if(!is.null(cols.ts.cpd) & nc.cpd>=np){ align="n" if (multi.state & length(multi.labels) > 0) - text(x = 17, y = height, labels = paste(multi.labels, collapse = "|"), pos = 4, cex = 0.15) + text(x = 17, y = height, labels = paste(multi.labels, collapse = "|"), offset = 10, pos = 4, cex = 0.15) # na.col=colorpanel2(1, low=na.col, high=na.col) ucol.gene=unique(as.vector(cols.ts.gene)) From 2e727874fec4eaea099d590fe02b1c995df99545 Mon Sep 17 00:00:00 2001 From: "AJ.Bassa" Date: Mon, 7 Apr 2025 16:52:56 +0200 Subject: [PATCH 26/34] --- R/keggview.native.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/keggview.native.R b/R/keggview.native.R index 12bfd24..8aaaf9f 100644 --- a/R/keggview.native.R +++ b/R/keggview.native.R @@ -130,7 +130,7 @@ if(!is.null(cols.ts.cpd) & nc.cpd>=np){ align="n" if (multi.state & length(multi.labels) > 0) - text(x = 17, y = height, labels = paste(multi.labels, collapse = "|"), offset = 10, pos = 4, cex = 0.15) + text(x = 17, y = height, labels = paste(multi.labels, collapse = "|"), offset = 25, cex = 0.25) # na.col=colorpanel2(1, low=na.col, high=na.col) ucol.gene=unique(as.vector(cols.ts.gene)) From 33eb2b8d18b78e899a367aa39b040e0374743da1 Mon Sep 17 00:00:00 2001 From: "AJ.Bassa" Date: Mon, 7 Apr 2025 16:54:55 +0200 Subject: [PATCH 27/34] --- R/keggview.native.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/keggview.native.R b/R/keggview.native.R index 8aaaf9f..8df1cb6 100644 --- a/R/keggview.native.R +++ b/R/keggview.native.R @@ -130,7 +130,7 @@ if(!is.null(cols.ts.cpd) & nc.cpd>=np){ align="n" if (multi.state & length(multi.labels) > 0) - text(x = 17, y = height, labels = paste(multi.labels, collapse = "|"), offset = 25, cex = 0.25) + text(x = 0, y = height, labels = paste(multi.labels, collapse = "|"), offset = 150, cex = 0.25) # na.col=colorpanel2(1, low=na.col, high=na.col) ucol.gene=unique(as.vector(cols.ts.gene)) From c160a2a999a2e57c451040cc575a9c12fb711329 Mon Sep 17 00:00:00 2001 From: "AJ.Bassa" Date: Mon, 7 Apr 2025 16:56:32 +0200 Subject: [PATCH 28/34] --- R/keggview.native.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/keggview.native.R b/R/keggview.native.R index 8df1cb6..0d4d941 100644 --- a/R/keggview.native.R +++ b/R/keggview.native.R @@ -130,7 +130,7 @@ if(!is.null(cols.ts.cpd) & nc.cpd>=np){ align="n" if (multi.state & length(multi.labels) > 0) - text(x = 0, y = height, labels = paste(multi.labels, collapse = "|"), offset = 150, cex = 0.25) + text(x = 150, y = height - 150, labels = paste(multi.labels, collapse = "|"), pos = 1, cex = 0.25) # na.col=colorpanel2(1, low=na.col, high=na.col) ucol.gene=unique(as.vector(cols.ts.gene)) From 2115292ef33671b9be11d2983ab67461bfd75922 Mon Sep 17 00:00:00 2001 From: "AJ.Bassa" Date: Mon, 7 Apr 2025 16:58:00 +0200 Subject: [PATCH 29/34] --- R/keggview.native.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/keggview.native.R b/R/keggview.native.R index 0d4d941..144dca7 100644 --- a/R/keggview.native.R +++ b/R/keggview.native.R @@ -130,7 +130,7 @@ if(!is.null(cols.ts.cpd) & nc.cpd>=np){ align="n" if (multi.state & length(multi.labels) > 0) - text(x = 150, y = height - 150, labels = paste(multi.labels, collapse = "|"), pos = 1, cex = 0.25) + text(x = 17, y = height - 20, labels = paste(multi.labels, collapse = "|"), pos = 1, cex = 0.25) # na.col=colorpanel2(1, low=na.col, high=na.col) ucol.gene=unique(as.vector(cols.ts.gene)) From 65a338df53569e32f0a3df9151353ce1279dc6b5 Mon Sep 17 00:00:00 2001 From: "AJ.Bassa" Date: Mon, 7 Apr 2025 16:59:03 +0200 Subject: [PATCH 30/34] --- R/keggview.native.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/keggview.native.R b/R/keggview.native.R index 144dca7..a0c3d67 100644 --- a/R/keggview.native.R +++ b/R/keggview.native.R @@ -130,7 +130,7 @@ if(!is.null(cols.ts.cpd) & nc.cpd>=np){ align="n" if (multi.state & length(multi.labels) > 0) - text(x = 17, y = height - 20, labels = paste(multi.labels, collapse = "|"), pos = 1, cex = 0.25) + text(x = 17, y = height - 20, labels = paste(multi.labels, collapse = "|"), pos = 4, cex = 0.25) # na.col=colorpanel2(1, low=na.col, high=na.col) ucol.gene=unique(as.vector(cols.ts.gene)) From 12acade8cb55af08c518046b8cf1fb01eeff49ac Mon Sep 17 00:00:00 2001 From: "AJ.Bassa" Date: Mon, 7 Apr 2025 17:00:00 +0200 Subject: [PATCH 31/34] --- R/keggview.native.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/keggview.native.R b/R/keggview.native.R index a0c3d67..e3d499a 100644 --- a/R/keggview.native.R +++ b/R/keggview.native.R @@ -130,7 +130,7 @@ if(!is.null(cols.ts.cpd) & nc.cpd>=np){ align="n" if (multi.state & length(multi.labels) > 0) - text(x = 17, y = height - 20, labels = paste(multi.labels, collapse = "|"), pos = 4, cex = 0.25) + text(x = 30, y = height - 10, labels = paste(multi.labels, collapse = "|"), pos = 4, cex = 0.25) # na.col=colorpanel2(1, low=na.col, high=na.col) ucol.gene=unique(as.vector(cols.ts.gene)) From bc3c3ffaa25a39c84ffef7b05d366e2ba9971cd9 Mon Sep 17 00:00:00 2001 From: "AJ.Bassa" Date: Mon, 7 Apr 2025 17:01:14 +0200 Subject: [PATCH 32/34] --- R/keggview.native.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/keggview.native.R b/R/keggview.native.R index e3d499a..89a8626 100644 --- a/R/keggview.native.R +++ b/R/keggview.native.R @@ -130,7 +130,7 @@ if(!is.null(cols.ts.cpd) & nc.cpd>=np){ align="n" if (multi.state & length(multi.labels) > 0) - text(x = 30, y = height - 10, labels = paste(multi.labels, collapse = "|"), pos = 4, cex = 0.25) + text(x = 30, y = height - 15, labels = paste(multi.labels, collapse = "|"), pos = 4, cex = 0.25) # na.col=colorpanel2(1, low=na.col, high=na.col) ucol.gene=unique(as.vector(cols.ts.gene)) From 2a7e5376fcea1edd16ef1931e796badf1bc34e67 Mon Sep 17 00:00:00 2001 From: "AJ.Bassa" Date: Mon, 7 Apr 2025 18:36:18 +0200 Subject: [PATCH 33/34] Corrected some mistakes --- man/pathview.Rd | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/man/pathview.Rd b/man/pathview.Rd index e2624f9..2ef0509 100644 --- a/man/pathview.Rd +++ b/man/pathview.Rd @@ -144,7 +144,7 @@ option only affects graphviz graph view, i.e. when kegg.native=FALSE. This option also effects most metabolic pathways even without group nodes defined orginally. For these pathways, genes involved in the same reaction are grouped automatically when -converting reactions to edges unless split.group=TRUE. d +converting reactions to edges unless split.group=TRUE. Default split.group=FALSE. } \item{map.symbol}{ @@ -182,18 +182,18 @@ directional data. Default limit=list(gene=1, cpd=1). \item{bins}{ a list of two integer elements with "gene" and "cpd" as the names. This argument specifies the number of levels or bins for gene.data and cpd.data when converting -them to pseudo colors. Default limit=list(gene=10, cpd=10). +them to pseudo colors. Default bins=list(gene=10, cpd=10). } \item{both.dirs}{ a list of two logical elements with "gene" and "cpd" as the names. This argument specifies whether gene.data and cpd.data are 1 directional or 2 -directional data when converting them to pseudo colors. Default limit=list(gene=TRUE, cpd=TRUE). +directional data when converting them to pseudo colors. Default both.dirs=list(gene=TRUE, cpd=TRUE). } \item{trans.fun}{ a list of two function (not character) elements with "gene" and "cpd" as the names. This argument specifies whether and how gene.data and cpd.data are transformed. Examples are \code{log}, \code{abs} or users' own -functions. Default limit=list(gene=NULL, cpd=NULL). +functions. Default trans.fun=list(gene=NULL, cpd=NULL). } \item{low, mid, high}{ each is a list of two colors with "gene" and "cpd" as the names. This @@ -207,7 +207,7 @@ The values for 'low, mid, high' can be given as color names ("\#FF0000"=red). } \item{na.col}{ -color used for NA's or missing values in gene.data and cpd.data. d +color used for NA's or missing values in gene.data and cpd.data. Default na.col="transparent". } \item{\dots}{ @@ -296,14 +296,14 @@ character, controlling how the color keys are aligned when both } \item{key.pos}{ character, controlling the position of color key(s). Potential values - are "bottomleft", "bottomright", "topleft" and "topright". d + are "bottomleft", "bottomright", "topleft" and "topright". Default key.pos="topright". } \item{sign.pos}{ character, controlling the position of pathview signature. Only effective when kegg.native=FALSE, Signature position is fixed in place of the original KEGG signature when kegg.native=TRUE. Potential values - are "bottomleft", "bottomright", "topleft" and "topright". d + are "bottomleft", "bottomright", "topleft" and "topright". Default sign.pos="bottomright". } From bdbec9b69f4ba3f82cc0b3e610268a9f13a9799f Mon Sep 17 00:00:00 2001 From: "AJ.Bassa" Date: Mon, 7 Apr 2025 18:36:59 +0200 Subject: [PATCH 34/34] --- man/pathview.Rd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/pathview.Rd b/man/pathview.Rd index 2ef0509..3c6fa49 100644 --- a/man/pathview.Rd +++ b/man/pathview.Rd @@ -462,4 +462,4 @@ head(pv.out$plot.data.cpd) % Add one or more standard keywords, see file 'KEYWORDS' in the % R documentation directory. \keyword{ ~kwd1 } -\keyword{ ~kwd2 }% __ONLY ONE__ keyword per line +\keyword{ ~kwd2 }% __ONLY ONE__ keyword per line \ No newline at end of file