diff --git a/NAMESPACE b/NAMESPACE index 90e1e84..0c350af 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -7,14 +7,14 @@ export(SBGNview) export(changeDataId) export(changeIds) export(downloadSbgnFile) -export(fileOutput) export(findPathways) -export(getMolList) export(highlightArcs) export(highlightNodes) export(highlightPath) export(loadMappingTable) +export(outputFile) export(renderSbgn) +export(sbgn.gsets) export(sbgnNodes) import(KEGGREST) import(Rdpack) diff --git a/R/SBGNview.R b/R/SBGNview.R index d80a818..66f148d 100644 --- a/R/SBGNview.R +++ b/R/SBGNview.R @@ -232,7 +232,7 @@ SBGNview <- function(gene.data = NULL, cpd.data = NULL, simulate.data = FALSE, i ### this function is for internal use only # SBGNview S3 class # -# This S3 class of objects contains information generated by the SBGNview function. A demo is available by running 'data(SBGNview.obj)'. +# This S3 class of objects contains information generated by the SBGNview function. # The SBGNview object can be modified by using the "+" binary operator in conjunction with the \code{\link{highlightArcs}}, \code{\link{highlightNodes}}, and \code{\link{highlightPath}} functions. # This mechanism to allow layer-by-layer graph modification is similar to that of ggplot2, a widely used R package for data visualization. # Defining this class as a formal (S4) class will produce an S4 SBGNview object which doesn't work with the binary operator and doesn't allow for layer-by-layer graph modification. @@ -249,7 +249,6 @@ SBGNview <- function(gene.data = NULL, cpd.data = NULL, simulate.data = FALSE, i # 3. output.formats: # A character vector specifying the formats of output image files. The vector should be a subset of c('pdf' , 'ps', 'png'). By default the function will always output a svg file. # @examples -# data(SBGNview.obj) createSBGNviewObject <- function(data, output.file, output.formats){ structure(list(data = data, output.file = output.file, diff --git a/R/SBGNview.obj.fun.R b/R/SBGNview.obj.fun.R index f8efa46..0cf767c 100644 --- a/R/SBGNview.obj.fun.R +++ b/R/SBGNview.obj.fun.R @@ -112,16 +112,15 @@ merge.entity.specific.parameters.list <- function(obj) { ######################################################################################################### #' Retrieve output file information from a SBGNview object #' -#' @param obj An SBGNview class object. +#' @param obj A SBGNview class object. #' @details This function prints the output file path recorded in a SBGNview object. #' @return A string. The output file information. #' @examples #' \dontrun{ -#' fileOutput(SBGNview.obj) +#' outputFile(SBGNview.obj) #' } #' @export - -fileOutput <- function(obj) { +outputFile <- function(obj) { obj$output.file } diff --git a/R/data.R b/R/data.R index 5eea08f..86cf1be 100644 --- a/R/data.R +++ b/R/data.R @@ -20,29 +20,6 @@ #' @usage data(pathways.stats) "pathways.stats" -######################################################################################################### -#' Demo SBGNview object -#' @details An example SBGNview object for demo purposes. -#' This S3 class of objects contains information generated by the SBGNview function. -#' The SBGNview object can be modified by using the "+" binary operator in conjunction with the \code{\link{highlightArcs}}, \code{\link{highlightNodes}}, and \code{\link{highlightPath}} functions. -#' This mechanism to allow layer-by-layer graph modification is similar to that of ggplot2, a widely used R package for data visualization. -#' Defining this class as a formal (S4) class will produce an S4 SBGNview object which doesn't work with the binary operator and doesn't allow for layer-by-layer graph modification. -#' Therefore, we decided to go with the S3 implementation of the SBGNview class since it works well with the binary operator making this -#' functionality more intuitive and user friendly. -#' -#' @format A list containing three elements: -#' -#' 1. data: -#' A list contains information for all input SBGN pathways. Each element is a list (e.g. 'P00001') holding information of a single SBGN pathway. The information include parsed information of glyphs, arcs and SBGNview parameters passed to SBGNview function -#' -#' 2. output.file: -#' A string of the path to the output file. It is the string set by parameter 'output.file' in function SBGNview. -#' -#' 3. output.formats: -#' A character vector specifying the formats of output image files. The vector should be a subset of c('pdf' , 'ps', 'png'). By default the function will always output a svg file. -#' @usage data(SBGNview.obj) -"SBGNview.obj" - ######################################################################################################### #' Mapping tables available in SBGNhub #' @details A collection of ID mapping table files available in SBGNhub. diff --git a/R/download.utilities.R b/R/download.utilities.R index dea1afe..5687dc2 100644 --- a/R/download.utilities.R +++ b/R/download.utilities.R @@ -705,10 +705,10 @@ load.all.ids.mapping <- function(database, all.pairs.id.mapping.list, species, o ######################################################################################################### #' Retrieve gene list or compound list from collected databases #' -#' @param database A character string. Default: "pathwayCommons". The database where gene list will be extracted. Acceptable values: 'MetaCyc', 'pathwayCommons', 'MetaCrop'. The value is case in-sensitive. #' @param id.type A character string. Default: "ENTREZID". The ID type of output gene list. One of the supported types in \code{data('mapped.ids')} -#' @param org A character string. Default: "hsa". The three letter species code used by KEGG. E.g. 'hsa','mmu' #' @param mol.type A character string. Default: "gene". One of 'gene' or 'cpd' +#' @param species A character string. Default: "hsa". The three letter species code used by KEGG. E.g. 'hsa','mmu' +#' @param database A character string. Default: "pathwayCommons". The database where gene list will be extracted. Acceptable values: 'MetaCyc', 'pathwayCommons', 'MetaCrop'. The value is case in-sensitive. #' @param output.pathway.name Logical. Default: T. If set to 'TRUE', the names of returned list are in the format: 'pathway.id::pathway.name'. If set to 'FALSE', the format is 'pahtway.id' #' @param combine.duplicated.set Logical. Default: T. Some pathways have the same geneset. If this parameter is set to 'TRUE', the output list will combine pathways that have the same gene set. The name in the list will be pathway names concatinated with '||' #' @param truncate.name.length Integer. Default: 50. The pathway names will be truncated to at most that length. @@ -716,16 +716,17 @@ load.all.ids.mapping <- function(database, all.pairs.id.mapping.list, species, o #' @return A list. Each element is a genelist of a pathway. #' @examples #' data(pathways.info) -#' mol.list <- getMolList(database = 'pathwayCommons', -#' id.type = 'ENTREZID', -#' org = 'hsa') +#' mol.list <- sbgn.gsets(id.type = 'ENTREZID', +#' species = 'hsa', +#' database = 'pathwayCommons') #' #' @export -getMolList <- function(database = "pathwayCommons", id.type = "ENTREZID", org = "hsa", - mol.type = "gene", output.pathway.name = TRUE, combine.duplicated.set = TRUE, +sbgn.gsets <- function(id.type = "ENTREZID", mol.type = "gene", species = "hsa", database = "pathwayCommons", + output.pathway.name = TRUE, combine.duplicated.set = TRUE, truncate.name.length = 50, SBGNview.data.folder = "./SBGNview.tmp.data") { + if(id.type %in% c("ENTREZID", "eg", "entrez", "entrezid")) id.type <- "ENTREZID" if (tolower(database) == "metacrop") { if (mol.type == "gene") { id.in.pathway <- "ENZYME" @@ -745,7 +746,7 @@ getMolList <- function(database = "pathwayCommons", id.type = "ENTREZID", org = } # metacrop initial list is using enzyme ref.to.pathway <- loadMappingTable(input.type = id.in.pathway, output.type = "pathway.id", - mol.type = mol.type, species = org, SBGNview.data.folder = SBGNview.data.folder) + mol.type = mol.type, species = species, SBGNview.data.folder = SBGNview.data.folder) if (id.type == id.in.pathway) { out.id.to.pathway <- ref.to.pathway @@ -755,7 +756,7 @@ getMolList <- function(database = "pathwayCommons", id.type = "ENTREZID", org = out.id.type.to.ref <- loadMappingTable(input.type = id.in.pathway, output.type = id.type, mol.type = mol.type, limit.to.ids = ref.to.pathway[, id.in.pathway], - species = org, SBGNview.data.folder = SBGNview.data.folder) + species = species, SBGNview.data.folder = SBGNview.data.folder) out.id.type.to.ref <- out.id.type.to.ref # merge KO to pathway and KO to output id diff --git a/R/highlight.utilities.R b/R/highlight.utilities.R index 460d238..00d05ed 100644 --- a/R/highlight.utilities.R +++ b/R/highlight.utilities.R @@ -46,7 +46,7 @@ highlight.edges <- function(node.set, arcs = NULL, node.set.id.type = NULL, arc. ######################################################################################################### #' Highlight input nodes #' -#' Change node properties such as border color and width to highlight a list of input nodes. This function should be used as the second argument to function \code{\link{+.SBGNview}}. +#' Change node properties such as border color and width to highlight a list of input nodes. This function should be used as the second argument to function. Run \code{help("+.SBGNview")} for more information. #' #' @param node.set A vector of character strings. Default: "all". Input molecule IDs whose nodes are to be highlighted. It can be any ID types supported by SBGNview. #' @param node.set.id.type A character string. Default: "CompoundName". ID type of input nodes. @@ -190,7 +190,7 @@ highlight.nodes.each.sbgn <- function(node.set = "all", select.glyph.class = c() ######################################################################################################### #' Highlight shortest path between two nodes #' -#' Given two nodes, find the shortest path between them and highlight the path. Other molecules/nodes and edges involved in reactions in the path are also highlighted. +#' Given two nodes, find the shortest path between them and highlight the path. Other molecules/nodes and edges involved in reactions in the path are also highlighted. This function should be used as the second argument to function. Run \code{help("+.SBGNview")} for more information. #' #' @param from.node A character string. The molecule ID of source node. #' @param to.node A character string. The molecule ID of target node. @@ -349,7 +349,7 @@ highlight.path.each.sbgn <- function(from.node, to.node, glyphs = NULL, arcs = N ######################################################################################################### #' Highlight arcs by arc class #' -#' This function can modify a SBGNview object's arc. Normally we use it as an argument to \code{\link{+.SBGNview}} and modify a SBGNview object +#' This function can modify a SBGNview object's arc. Normally we use it as an argument to \code{+.SBGNview} and modify a SBGNview object. Run \code{help("+.SBGNview")} for more information. #' #' @param class A character string. Default: "arc". The arc class to modify. #' @param color A character string. Default: "black". The color of arcs with selected 'class'. diff --git a/data/SBGNview.obj.RData b/data/SBGNview.obj.RData deleted file mode 100644 index 5a1e712..0000000 Binary files a/data/SBGNview.obj.RData and /dev/null differ diff --git a/man/SBGNview.obj.Rd b/man/SBGNview.obj.Rd deleted file mode 100644 index efd9299..0000000 --- a/man/SBGNview.obj.Rd +++ /dev/null @@ -1,34 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/data.R -\docType{data} -\name{SBGNview.obj} -\alias{SBGNview.obj} -\title{Demo SBGNview object} -\format{ -A list containing three elements: - - 1. data: - A list contains information for all input SBGN pathways. Each element is a list (e.g. 'P00001') holding information of a single SBGN pathway. The information include parsed information of glyphs, arcs and SBGNview parameters passed to SBGNview function - - 2. output.file: - A string of the path to the output file. It is the string set by parameter 'output.file' in function SBGNview. - - 3. output.formats: - A character vector specifying the formats of output image files. The vector should be a subset of c('pdf' , 'ps', 'png'). By default the function will always output a svg file. -} -\usage{ -data(SBGNview.obj) -} -\description{ -Demo SBGNview object -} -\details{ -An example SBGNview object for demo purposes. -This S3 class of objects contains information generated by the SBGNview function. -The SBGNview object can be modified by using the "+" binary operator in conjunction with the \code{\link{highlightArcs}}, \code{\link{highlightNodes}}, and \code{\link{highlightPath}} functions. -This mechanism to allow layer-by-layer graph modification is similar to that of ggplot2, a widely used R package for data visualization. -Defining this class as a formal (S4) class will produce an S4 SBGNview object which doesn't work with the binary operator and doesn't allow for layer-by-layer graph modification. -Therefore, we decided to go with the S3 implementation of the SBGNview class since it works well with the binary operator making this -functionality more intuitive and user friendly. -} -\keyword{datasets} diff --git a/man/highlightArcs.Rd b/man/highlightArcs.Rd index 4ca37d0..1f6d5c6 100644 --- a/man/highlightArcs.Rd +++ b/man/highlightArcs.Rd @@ -19,7 +19,7 @@ highlightArcs(class = "all", color = "black", line.width = 2, tip.size = 6) A SBGNview object } \description{ -This function can modify a SBGNview object's arc. Normally we use it as an argument to \code{\link{+.SBGNview}} and modify a SBGNview object +This function can modify a SBGNview object's arc. Normally we use it as an argument to \code{+.SBGNview} and modify a SBGNview object. Run \code{help("+.SBGNview")} for more information. } \examples{ \dontrun{ diff --git a/man/highlightNodes.Rd b/man/highlightNodes.Rd index 734ffdb..d55084a 100644 --- a/man/highlightNodes.Rd +++ b/man/highlightNodes.Rd @@ -57,7 +57,7 @@ highlightNodes( A SBGNview obj } \description{ -Change node properties such as border color and width to highlight a list of input nodes. This function should be used as the second argument to function \code{\link{+.SBGNview}}. +Change node properties such as border color and width to highlight a list of input nodes. This function should be used as the second argument to function. Run \code{help("+.SBGNview")} for more information. } \examples{ \dontrun{ diff --git a/man/highlightPath.Rd b/man/highlightPath.Rd index 3a48bfa..8606250 100644 --- a/man/highlightPath.Rd +++ b/man/highlightPath.Rd @@ -57,7 +57,7 @@ highlightPath( A SBGNview obj } \description{ -Given two nodes, find the shortest path between them and highlight the path. Other molecules/nodes and edges involved in reactions in the path are also highlighted. +Given two nodes, find the shortest path between them and highlight the path. Other molecules/nodes and edges involved in reactions in the path are also highlighted. This function should be used as the second argument to function. Run \code{help("+.SBGNview")} for more information. } \examples{ \dontrun{ diff --git a/man/fileOutput.Rd b/man/outputFile.Rd similarity index 78% rename from man/fileOutput.Rd rename to man/outputFile.Rd index 1ca6ff5..ade09f4 100644 --- a/man/fileOutput.Rd +++ b/man/outputFile.Rd @@ -1,13 +1,13 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/SBGNview.obj.fun.R -\name{fileOutput} -\alias{fileOutput} +\name{outputFile} +\alias{outputFile} \title{Retrieve output file information from a SBGNview object} \usage{ -fileOutput(obj) +outputFile(obj) } \arguments{ -\item{obj}{An SBGNview class object.} +\item{obj}{A SBGNview class object.} } \value{ A string. The output file information. @@ -20,6 +20,6 @@ This function prints the output file path recorded in a SBGNview object. } \examples{ \dontrun{ -fileOutput(SBGNview.obj) +outputFile(SBGNview.obj) } } diff --git a/man/getMolList.Rd b/man/sbgn.gsets.Rd similarity index 84% rename from man/getMolList.Rd rename to man/sbgn.gsets.Rd index 77b4dcc..43a6e40 100644 --- a/man/getMolList.Rd +++ b/man/sbgn.gsets.Rd @@ -1,14 +1,14 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/download.utilities.R -\name{getMolList} -\alias{getMolList} +\name{sbgn.gsets} +\alias{sbgn.gsets} \title{Retrieve gene list or compound list from collected databases} \usage{ -getMolList( - database = "pathwayCommons", +sbgn.gsets( id.type = "ENTREZID", - org = "hsa", mol.type = "gene", + species = "hsa", + database = "pathwayCommons", output.pathway.name = TRUE, combine.duplicated.set = TRUE, truncate.name.length = 50, @@ -16,14 +16,14 @@ getMolList( ) } \arguments{ -\item{database}{A character string. Default: "pathwayCommons". The database where gene list will be extracted. Acceptable values: 'MetaCyc', 'pathwayCommons', 'MetaCrop'. The value is case in-sensitive.} - \item{id.type}{A character string. Default: "ENTREZID". The ID type of output gene list. One of the supported types in \code{data('mapped.ids')}} -\item{org}{A character string. Default: "hsa". The three letter species code used by KEGG. E.g. 'hsa','mmu'} - \item{mol.type}{A character string. Default: "gene". One of 'gene' or 'cpd'} +\item{species}{A character string. Default: "hsa". The three letter species code used by KEGG. E.g. 'hsa','mmu'} + +\item{database}{A character string. Default: "pathwayCommons". The database where gene list will be extracted. Acceptable values: 'MetaCyc', 'pathwayCommons', 'MetaCrop'. The value is case in-sensitive.} + \item{output.pathway.name}{Logical. Default: T. If set to 'TRUE', the names of returned list are in the format: 'pathway.id::pathway.name'. If set to 'FALSE', the format is 'pahtway.id'} \item{combine.duplicated.set}{Logical. Default: T. Some pathways have the same geneset. If this parameter is set to 'TRUE', the output list will combine pathways that have the same gene set. The name in the list will be pathway names concatinated with '||'} @@ -40,8 +40,8 @@ Retrieve gene list or compound list from collected databases } \examples{ data(pathways.info) -mol.list <- getMolList(database = 'pathwayCommons', - id.type = 'ENTREZID', - org = 'hsa') +mol.list <- sbgn.gsets(id.type = 'ENTREZID', + species = 'hsa', + database = 'pathwayCommons') } diff --git a/tests/testthat/test-user.level.functions.R b/tests/testthat/test-user.level.functions.R index 2f82880..cfcf2c2 100644 --- a/tests/testthat/test-user.level.functions.R +++ b/tests/testthat/test-user.level.functions.R @@ -29,11 +29,11 @@ test_that("downloadSbgn", { }) ################################################### -test_that("getMolList", { +test_that("sbgn.gsets", { - mol.list <- getMolList(database = "metacrop", + mol.list <- sbgn.gsets(database = "metacrop", id.type = "ENZYME", - org = "ath", + species = "ath", output.pathway.name = FALSE, truncate.name.length = 50) expect_gte(length(mol.list), 0) diff --git a/vignettes/SBGNview.Vignette.Rmd b/vignettes/SBGNview.Vignette.Rmd index 0c4584f..e021e55 100644 --- a/vignettes/SBGNview.Vignette.Rmd +++ b/vignettes/SBGNview.Vignette.Rmd @@ -242,7 +242,7 @@ The main function *SBGNview* returns a S3 class *SBGNview* object (similar to th + `SBGNview.obj = SBGNview(...) + highlightNodes(...)`. The assign operation "=" will make the returned object invisible therefore it will not be printed. ## Structure of *SBGNview* object -The *SBGNview* object is a S3 object defined as a list structure containing 'data' and 'output.file' and 'output.formats' elements. The object is created by the SBGNview S3 class defined within the package. The 'data' element of the object is a list containing information for all input SBGN pathways. Each element in 'data' is a list holding information of a single SBGN pathway. The information includes parsed glyphs, parsed arcs and other parameters to control graph features passed into *SBGNview* function. The 'output.file' element of the object is a string specified for the 'output.file' parameter in *SBGNview* function. The output file name can be modified using *outputFile*. The output formats can be updated by assigning a character vector of supported file formats by *SBGNview* function. The code chucks below demonstrate how you can access glyphs and arcs information of a *SBGNview* object as well as changing output file name and output formats. A demo *SBGNview* object can be loaded by running `data("SBGNview.obj")`. +The *SBGNview* object is a S3 object defined as a list structure containing 'data' and 'output.file' and 'output.formats' elements. The object is created by the SBGNview S3 class defined within the package. The 'data' element of the object is a list containing information for all input SBGN pathways. Each element in 'data' is a list holding information of a single SBGN pathway. The information includes parsed glyphs, parsed arcs and other parameters to control graph features passed into *SBGNview* function. The 'output.file' element of the object is a string specified for the 'output.file' parameter in *SBGNview* function. The output file name can be modified using *outputFile*. The output formats can be updated by assigning a character vector of supported file formats by *SBGNview* function. The code chucks below demonstrate how you can access glyphs and arcs information of a *SBGNview* object as well as changing output file name and output formats. ## Extract glyphs and arcs infromation from *SBGNview* object ```{r , echo = TRUE, results = 'hide', message = FALSE, warning = FALSE} @@ -264,12 +264,12 @@ Please make sure to read the documentation of *SBGNview* S3 class in the Value s ## Change output file name and format of *SBGNview* objects We can change the name of the output file using built-in function *outputFile*: ```{r , echo = TRUE, results = 'hide', message = FALSE, warning = FALSE} -fileOutput(SBGNview.obj) +outputFile(SBGNview.obj) outputFile(SBGNview.obj) <- "test.change.output.file" -fileOutput(SBGNview.obj) +outputFile(SBGNview.obj) SBGNview.obj outputFile(SBGNview.obj) <- "test.print" -fileOutput(SBGNview.obj) +outputFile(SBGNview.obj) print(SBGNview.obj) ``` @@ -492,9 +492,9 @@ head(mapping) ``` ## Extract molecule list from pathways {#extractList} ```{r , echo = TRUE, results='hide', message = FALSE, warning = FALSE } -mol.list <- getMolList(database = "metacrop", +mol.list <- sbgn.gsets(database = "metacrop", id.type = "ENZYME", - org = "ath", + species = "ath", output.pathway.name = FALSE, truncate.name.length = 50) ``` @@ -502,31 +502,31 @@ mol.list <- getMolList(database = "metacrop", mol.list[[1]] ``` ```{r , echo = TRUE, results='hide', message = FALSE, warning = FALSE } -mol.list <- getMolList(database = "pathwayCommons", +mol.list <- sbgn.gsets(database = "pathwayCommons", id.type = "ENTREZID", - org = "hsa") + species = "hsa") ``` ```{r , echo = TRUE, message = FALSE, warning = FALSE } mol.list[[1]] ``` ```{r , echo = TRUE, results='hide', message = FALSE, warning = FALSE } -mol.list <- getMolList(database = "pathwayCommons", +mol.list <- sbgn.gsets(database = "pathwayCommons", id.type = "ENTREZID", - org = "mmu") + species = "mmu") ``` ```{r , echo = TRUE, message = FALSE, warning = FALSE } mol.list[[1]] ``` ```{r , echo = TRUE, results='hide', message = FALSE, warning = FALSE } -mol.list <- getMolList(database = "MetaCyc", +mol.list <- sbgn.gsets(database = "MetaCyc", id.type = "KO", - org = "eco") + species = "eco") ``` ```{r , echo = TRUE, message = FALSE, warning = FALSE } mol.list[[3]] ``` ```{r , echo = TRUE, results='hide', message = FALSE, warning = FALSE } -mol.list <- getMolList(database = "pathwayCommons", +mol.list <- sbgn.gsets(database = "pathwayCommons", id.type = "chebi", mol.type = "cpd") ``` diff --git a/vignettes/SBGNview.Vignette.html b/vignettes/SBGNview.Vignette.html index dd44059..c1fa69f 100644 --- a/vignettes/SBGNview.Vignette.html +++ b/vignettes/SBGNview.Vignette.html @@ -1527,7 +1527,7 @@

SBGNview: data integration, visualization and analysis on SBGN pathways

Xiaoxi Dong, Kovidh Vegesna, Weijun Luo

-

16 February, 2021

+

17 February, 2021

@@ -1564,9 +1564,9 @@

4.1 Load the SBGNview package, to

4.2 Accessing help and documentation

Use ls("package:SBGNview") to list all available functions in SBGNview. To learn more about how to use the functions and access their manuals, use help() or ?. For example, ?”SBGNview” or help("+.SBGNview").

ls("package:SBGNview")
-
##  [1] "changeDataId"     "changeIds"        "downloadSbgnFile" "fileOutput"      
-##  [5] "findPathways"     "getMolList"       "highlightArcs"    "highlightNodes"  
-##  [9] "highlightPath"    "loadMappingTable" "outputFile<-"     "renderSbgn"      
+
##  [1] "changeDataId"     "changeIds"        "downloadSbgnFile" "findPathways"    
+##  [5] "highlightArcs"    "highlightNodes"   "highlightPath"    "loadMappingTable"
+##  [9] "outputFile"       "outputFile<-"     "renderSbgn"       "sbgn.gsets"      
 ## [13] "sbgnNodes"        "SBGNview"
@@ -1787,7 +1787,7 @@

6 Work with SBGNview obj

6.1 Structure of SBGNview object

-

The SBGNview object is a S3 object defined as a list structure containing ‘data’ and ‘output.file’ and ‘output.formats’ elements. The object is created by the SBGNview S3 class defined within the package. The ‘data’ element of the object is a list containing information for all input SBGN pathways. Each element in ‘data’ is a list holding information of a single SBGN pathway. The information includes parsed glyphs, parsed arcs and other parameters to control graph features passed into SBGNview function. The ‘output.file’ element of the object is a string specified for the ‘output.file’ parameter in SBGNview function. The output file name can be modified using outputFile. The output formats can be updated by assigning a character vector of supported file formats by SBGNview function. The code chucks below demonstrate how you can access glyphs and arcs information of a SBGNview object as well as changing output file name and output formats. A demo SBGNview object can be loaded by running data("SBGNview.obj").

+

The SBGNview object is a S3 object defined as a list structure containing ‘data’ and ‘output.file’ and ‘output.formats’ elements. The object is created by the SBGNview S3 class defined within the package. The ‘data’ element of the object is a list containing information for all input SBGN pathways. Each element in ‘data’ is a list holding information of a single SBGN pathway. The information includes parsed glyphs, parsed arcs and other parameters to control graph features passed into SBGNview function. The ‘output.file’ element of the object is a string specified for the ‘output.file’ parameter in SBGNview function. The output file name can be modified using outputFile. The output formats can be updated by assigning a character vector of supported file formats by SBGNview function. The code chucks below demonstrate how you can access glyphs and arcs information of a SBGNview object as well as changing output file name and output formats.

6.2 Extract glyphs and arcs infromation from SBGNview object

@@ -1809,12 +1809,12 @@

6.3 Modify SBGNview obje

6.4 Change output file name and format of SBGNview objects

We can change the name of the output file using built-in function outputFile:

-
fileOutput(SBGNview.obj)
+
outputFile(SBGNview.obj)
 outputFile(SBGNview.obj) <- "test.change.output.file"
-fileOutput(SBGNview.obj)
+outputFile(SBGNview.obj)
 SBGNview.obj
 outputFile(SBGNview.obj) <- "test.print"
-fileOutput(SBGNview.obj)
+outputFile(SBGNview.obj)
 print(SBGNview.obj)

We can update or change the output file formats of a SBGNview object. Supported output file formats are any combination of “png”, “pdf”, and “ps”. If an empty vector of output file formats are provided, only the SVG file format will be written to current working directory.

print(SBGNview.obj$output.formats)
@@ -2051,30 +2051,30 @@ 

8.1 Map between two types of IDs<

8.2 Extract molecule list from pathways

-
mol.list <- getMolList(database = "metacrop",
+
mol.list <- sbgn.gsets(database = "metacrop",
                        id.type = "ENZYME",
-                       org = "ath",
+                       species = "ath",
                        output.pathway.name = FALSE,
                        truncate.name.length = 50)
mol.list[[1]]
## [1] "2.6.1.2"  "2.6.1.44"
-
mol.list <- getMolList(database = "pathwayCommons",
+
mol.list <- sbgn.gsets(database = "pathwayCommons",
                        id.type = "ENTREZID",
-                       org = "hsa")
+ species = "hsa")
mol.list[[1]]
## [1] "217" "219" "224"
-
mol.list <- getMolList(database = "pathwayCommons",
+
mol.list <- sbgn.gsets(database = "pathwayCommons",
                        id.type = "ENTREZID",
-                       org = "mmu")
+ species = "mmu")
mol.list[[1]]
## [1] "11669" "11671" "72535"
-
mol.list <- getMolList(database = "MetaCyc",
+
mol.list <- sbgn.gsets(database = "MetaCyc",
                        id.type = "KO",
-                       org = "eco")
+ species = "eco")
mol.list[[3]]
##  [1] "K00281" "K00287" "K00288" "K00382" "K00560" "K00600" "K00605" "K01934"
 ##  [9] "K02437" "K13403"
-
mol.list <- getMolList(database = "pathwayCommons",
+
mol.list <- sbgn.gsets(database = "pathwayCommons",
                        id.type = "chebi",
                        mol.type = "cpd")
mol.list[[2]]
diff --git a/vignettes/pathway.enrichment.analysis.Rmd b/vignettes/pathway.enrichment.analysis.Rmd index c9ef0f1..51d0a27 100644 --- a/vignettes/pathway.enrichment.analysis.Rmd +++ b/vignettes/pathway.enrichment.analysis.Rmd @@ -63,12 +63,11 @@ ko.cols <- which(IFNg$group == "ko") ## Gene sets from SBGNview pathway collection ### Load gene set for mouse with ENSEMBL gene IDs ```{r , echo = TRUE , results = 'hide', message = FALSE, warning = FALSE} -ensembl.pathway <- getMolList( - id.type = "ENSEMBL", - org = "mmu", - mol.type = "gene", - output.pathway.name = TRUE -) +ensembl.pathway <- sbgn.gsets(id.type = "ENSEMBL", + species = "mmu", + mol.type = "gene", + output.pathway.name = TRUE + ) head(ensembl.pathway[[2]]) ``` diff --git a/vignettes/pathway.enrichment.analysis.html b/vignettes/pathway.enrichment.analysis.html index 707cb54..5b7b300 100644 --- a/vignettes/pathway.enrichment.analysis.html +++ b/vignettes/pathway.enrichment.analysis.html @@ -1527,7 +1527,7 @@

Pathway analysis and visualization using SBGNview collected gene set

Xiaoxi Dong, Weijun Luo

-

16 February, 2021

+

17 February, 2021

@@ -1567,12 +1567,11 @@

4.1 Load the gene (RNA-seq) data<

4.2 Gene sets from SBGNview pathway collection

4.2.1 Load gene set for mouse with ENSEMBL gene IDs

-
ensembl.pathway <- getMolList(
-    id.type = "ENSEMBL",
-    org = "mmu",
-    mol.type = "gene",
-    output.pathway.name = TRUE
-)
+
ensembl.pathway <- sbgn.gsets(id.type = "ENSEMBL",
+                              species = "mmu",
+                              mol.type = "gene",
+                              output.pathway.name = TRUE
+                              )
 head(ensembl.pathway[[2]])