bioconductor v3.9.0 KEGGgraph

KEGGGraph is an interface between KEGG pathway and graph

Link to this section Summary

Functions

Class "KEGGEdgeSubType"

Predefinitions of node or edge types

Class 'KEGGEdge'

class 'KEGGGraphics'

Class "KEGGGroup"

Class "KEGGNode"

Class "KEGGPathwayInfo"

Class "KEGGPathway"

Class "KEGGReaction"

Parses KEGGpathway to graph

Convert chemical reaction network of KEGG pathway into graph

Expand KEGG node of paralogues

Expand KEGG Pathway

Get a character string as label for display

Get entry ID for single or list of KEGGNode or KEGGedge object(s)

Get KEGG ID

Get KEGG gene link

Get or set list of KEGG node or edge data

Get KGML file (url) with KEGG PATHWAY ID and (optional) organism

Get 'name' attribute

Extract the value in a vector by name

Get KEGG pathway info

Get KEGG reactions

Get Rgraphviz compatitable edge names

Get subtype

Get title for given element

Get type attribute

Get 'value' attribute

Graph density

Determines whether a list is homogenous

Convert KGML file name to pathway name

A function to merge KEGG graphs

Merge KEGG graphs, also merging KEGGNode and KEGGEdge attributes

Return the neighborhood set of given vertices

Parse ENTRY elements of KGML document

Parse 'graphics' elements in KGML files

KGML file parser

Parse KGML file into a data frame

Parse KGML files into KEGG graph

A convenient function to parse KGML and expand its containing maps into one graph object

Parse information of the pathway from KGML files

Parse reaction from KGML files

Parse RELATION elements from KGML files

Parse KGML relation subtype

Plot KEGG graph with Rgraphviz

Return common significance sign (asterisk) associated with given p value

Query the subgraph of a given KEGG graph with Entrez GeneID (s)

Randomly subset the given graph

Split KEGG group

Subset KEGG graph by node types

Subset KEGG graph, including subsetting node and edge attributes

Get display information for relation subtypes

Colorectal cancer dataset

Translate between KEGGID and Entrez Gene ID

Tranlate the KEGG graph from being indexed by KEGGID to another identifer

Link to this section Functions

Link to this function

KEGGEdgeSubType_class()

Class "KEGGEdgeSubType"

Description

A class to represent subtype in KEGG

Seealso

KEGGEdge-class

Note

Please note that 'KEGGEdgeSubtype' is a data frame storing subtype predefinitions, the 'type' with lowercases. 'KEGGEdgeSubType' is however a class representing these subtypes.

Author

Jitao David Zhang mailto:jitao_david.zhang@roche.com

Examples

showClass("KEGGEdgeSubType")
## use example(KEGGEdge-class) for more examples
Link to this function

KEGGEdgeSubtype()

Predefinitions of node or edge types

Description

The KGML files define node and edge type and subtypes, which are summarized in these data frames.

Format

They are stored as data frames

Usage

data(KEGGEdgeSubtype)
data(KEGGNodeType)
data(KEGGEdgeType)

Details

They are used by graph render functions to identify different types of objects, user could use them to classify edges or nodes.

References

KGML Document manual http://www.genome.jp/kegg/docs/xml/

Examples

data(KEGGEdgeSubtype)
data(KEGGEdgeType)
data(KEGGNodeType)
Link to this function

KEGGEdge_class()

Class 'KEGGEdge'

Description

A class to represent 'relation' elements in KGML files and edge objects in a KEGG graph

Seealso

KEGGNode-class

Author

Jitao David Zhang mailto:jitao_david.zhang@roche.com

References

KGML Manual http://www.genome.jp/kegg/docs/xml/

Examples

mapfile<- system.file("extdata/map00260.xml", package="KEGGgraph")
maptest <- parseKGML(mapfile)

x <- edges(maptest)[[1]]
class(x)

## examples to extract information from KEGGEdge
getName(x)
getEntryID(x)

getType(x)
getSubtype(x)

subtype <- getSubtype(x)[[1]]
getName(subtype)
Link to this function

KEGGGraphics_class()

class 'KEGGGraphics'

Description

A class to represent 'graphics' element in KGML files

Seealso

parseGraphics

Author

Jitao David Zhang mailto:jitao_david.zhang@roche.com

References

KGML Manual http://www.genome.jp/kegg/docs/xml/

Examples

showClass("KEGGGraphics")
Link to this function

KEGGGroup_class()

Class "KEGGGroup"

Description

Class to represent 'group' nodes in KEGG pathways

Seealso

KEGGNode-class

Author

Jitao David Zhang mailto:jitao_david.zhang@roche.com

Examples

showClass("KEGGGroup")
Link to this function

KEGGNode_class()

Class "KEGGNode"

Description

The class to present 'entry' element in KGML files and nodes in KEGG graphs

Seealso

KEGGEdge-class , parseEntry

Author

Jitao David Zhang mailto:jitao_david.zhang@roche.com

References

KGML Document manual http://www.genome.jp/kegg/docs/xml/

Examples

## We show how to extract information from KEGGNode object
sfile <- system.file("extdata/hsa04010.xml",package="KEGGgraph")
pathway <- parseKGML(sfile)

ns <- nodes(pathway)
node <- ns[[1]]

show(node)
getName(node)
getDisplayName(node)
getEntryID(node)
getKEGGID(node)
Link to this function

KEGGPathwayInfo_class()

Class "KEGGPathwayInfo"

Description

A class to represent information of a KEGG pathway

Author

Jitao David Zhang mailto:jitao_david.zhang@roche.com

References

KGML Document Manual http://www.genome.jp/kegg/docs/xml/

Examples

sfile <- system.file("extdata/hsa04010.xml",package="KEGGgraph")
pathway <- parseKGML(sfile)
pi <- getPathwayInfo(pathway)

class(pi)

getTitle(pi)
Link to this function

KEGGPathway_class()

Class "KEGGPathway"

Description

A class to represent KEGG pathway

Seealso

parseKGML , KEGGEdge-class , KEGGNode-class , KEGGReaction-class

Author

Jitao David Zhang mailto:jitao_david.zhang@roche.com

References

KGML Document manual http://www.genome.jp/kegg/docs/xml/

Examples

## We show how to extract information from KEGGPathway objects
## Parse KGML file into a 'KEGGPathway' object
mapfile <- system.file("extdata/map00260.xml", package="KEGGgraph")
maptest <- parseKGML(mapfile)

## short summary of the pathway
maptest

## get information of the pathway
getPathwayInfo(maptest)

## nodes of the pathway
nodes <- nodes(maptest)
node <- nodes[[3]]
getName(node)
getType(node)
getDisplayName(node)

## edges of the pathway
edges <- edges(maptest)
edge <- edges[[3]]
getEntryID(edge)
getSubtype(edge)
Link to this function

KEGGReaction_class()

Class "KEGGReaction"

Description

A class to present 'reaction' elements in KGML files

Author

Jitao David Zhang mailto:jitao_david.zhang@roche.com

References

KGML Document Manual http://www.genome.jp/kegg/docs/xml/

Examples

## We show how to extract reactions from a 'KEGGPathway' object
mapfile <- system.file("extdata/map00260.xml", package="KEGGgraph")

maptest <- parseKGML(mapfile)
mapReactions <- getReactions(maptest)

## More details about reaction
reaction <- mapReactions[[1]]
getName(reaction)
getType(reaction)
getSubstrate(reaction)
getProduct(reaction)
Link to this function

KEGGpathway2Graph()

Parses KEGGpathway to graph

Description

The function parses an object of KEGGPathway-class into graph.

Usage

KEGGpathway2Graph(pathway, genesOnly = TRUE, expandGenes = TRUE)

Arguments

ArgumentDescription
pathwayAn instance of KEGGPathway-class
genesOnlylogical, should only the genes are maintained and other types of nodes (compounds, etc) neglected? TRUE by default
expandGeneslogical, should homologue proteins expanded? TRUE by default

Details

When 'expandGenes=TRUE', the nodes have unique names of KEGGID (in the form of 'org:xxxx', for example 'hsa:1432'), otherwise an auto-increment index given by KEGG is used as node names. In the latter case, the node names are duplicated and graphs cannot be simply merged before the nodes are unique.

KEGG node and edge data is stored in 'nodeData' and 'edgeData' slots respectively, which can be extracted by getKEGGnodeData and getKEGGedgeData .

Value

A directed graph.

Seealso

parseKGML2Graph

Author

Jitao David Zhang mailto:jitao_david.zhang@roche.com

Examples

sfile <- system.file("extdata/hsa04010.xml",package="KEGGgraph")
kegg.pathway <- parseKGML(sfile)
gR.compact<- KEGGpathway2Graph(kegg.pathway,expandGenes=FALSE)
Link to this function

KEGGpathway2reactionGraph()

Convert chemical reaction network of KEGG pathway into graph

Description

Regulatory pathways are always viewed as protein networks, so there is no 'reaction' information saved in their KGML files. Metabolic pathways are viewed both as both protein networks and chemical networks, hence the KEGGPathway-class object may have reactions information among chemical compounds.

This functions extracts reaction information from KEGG pathway, and convert the chemical compound reaction network into directed graph.

Usage

KEGGpathway2reactionGraph(pathway)

Arguments

ArgumentDescription
pathwayA KEGGPathway-class object, usually as the result of the function parseKGML

Details

The direction of the graph is specified by the role of the compound in the reaction, the edges goes always out of 'substrate' and points to 'product'.

For now there is no wrapper to parse the KGML file directly into a reaction graph. In future there maybe one, but we don't want to confuse users with two similar functions to parse the file into a graph (since we assume that most users will need the protein graph, which can be conveniently parsed by parseKGML2Graph ).

From version 1.18.0, reaction graphs returned by KEGGpathway2reactionGraph can be merged with other reaction graphs or pathway graphs.Thus users can combine pathway and reaction graph in one KGML file into a single graph.

Value

A directed graph with compounds as nodes and reactions as edges.

If the pathway does not contain any chemical reactions, a warning message will be printed and NULL is returned.

Seealso

KEGGPathway-class

Author

Jitao David Zhang mailto:jitao_david.zhang@roche.com

References

KGML Document manual http://www.genome.jp/kegg/docs/xml/

Examples

mapfile <-  system.file("extdata/map00260.xml",package="KEGGgraph")
map <- parseKGML(mapfile)
cg <- KEGGpathway2reactionGraph(map)
cg
nodes(cg)[1:3]
edges(cg)[1:3]
Link to this function

expandKEGGNode()

Expand KEGG node of paralogues

Description

The function expands KEGG node of paralogues, and is mainly used internally. The end-users are not expected to call it unless they know exactly what they are doing.

Usage

expandKEGGNode(node)

Arguments

ArgumentDescription
nodeAn object of KEGGNode-class

Author

Jitao David Zhang mailto:jitao_david.zhang@roche.com

Link to this function

expandKEGGPathway()

Expand KEGG Pathway

Description

The function expands paralogue nodes in KEGG pathway and returns expanded KEGG pathway, KEGG node and edge data is maintained.

Usage

expandKEGGPathway(pathway)

Arguments

ArgumentDescription
pathwayAn object of KEGGPathway-class

Details

The function expands nodes with paralogues in KEGG pathway and copy neccessary edges.

Value

An object of KEGGPathway-class

Seealso

expandKEGGNode

Author

Jitao David Zhang mailto:jitao_david.zhang@roche.com

Examples

sfile <- system.file("extdata/hsa04010.xml",package="KEGGgraph")
kegg.pathway <- parseKGML(sfile)
kegg.expandpathway <- expandKEGGPathway(kegg.pathway)
Link to this function

getDisplayName_methods()

Get a character string as label for display

Description

In KGML files, 'graph' element has a 'name' attribute to store the displaying name of a node, which is straighforward for end users. For example, biologists have no idea about a node 'hsa:1432' but its display name 'MAPK14' helps them to link this node to their knowledge. This method extract DisplayName from graph objects for KEGGNode and graph, where the method for graph returns the display names of its nodes.

Author

Jitao David Zhang mailto:jitao_david.zhang@roche.com

References

KGML Document Manual http://www.genome.jp/kegg/docs/xml/

Examples

sfile <- system.file("extdata/hsa04010.xml",package="KEGGgraph")
pathway <- parseKGML(sfile)

nodes <- nodes(pathway)
subnodes <- nodes[10:15]

sapply(subnodes, getDisplayName)
## compare them with getName, one 'displayName' may correspond to many paralogues
sapply(subnodes, getName)
Link to this function

getEntryID_methods()

Get entry ID for single or list of KEGGNode or KEGGedge object(s)

Description

The method extracts EntryIDs from KEGGNode-class or KEGGEdge-class object(s).

In case of KEGGEdge-class objects, the entryID of the nodes involved in the binary are returned as a vector list("in the order ", " specified by the direction of the relation") , that is, if the edge is defined as A->B, then the entryID returned from the edge equals to c(getEntryID(A), getEntryID(B)).

Author

Jitao David Zhang mailto:jitao_david.zhang@roche.com

References

KGML Document Manual http://www.genome.jp/kegg/docs/xml/

Examples

sfile <- system.file("extdata/hsa04010.xml",package="KEGGgraph")
pathway <- parseKGML(sfile)

nodes <- nodes(pathway)
node <- nodes[[7]]
getEntryID(node)

edges <- edges(pathway)
edge <- edges[[7]]
getEntryID(edge)

getEntryID(nodes[1:4])
getEntryID(edges[1:4])
Link to this function

getKEGGID_methods()

Get KEGG ID

Description

Get KEGGID from a KEGGNode-class object.

The KEGGNode-class can be either another pathway (KEGGID in the form like 'hsa'), KEGG Gene ('hsa:') or compound ('cpd:C*'). In case of the KEGG Gene ID, the organism prefix is removed when the value is returned.

Examples

wntfile <- system.file("extdata/hsa04310.xml",package="KEGGgraph")
wnt <- parseKGML(wntfile)
nodes <- nodes(wnt)
getKEGGID(nodes[[1]])
getKEGGID(nodes[[26]])
Link to this function

getKEGGnodeData()

Get or set list of KEGG node or edge data

Description

The 'get' methods extracts KEGG node (edge) attributes from a graph produced by calling parseKGML2Graph or KEGGpathway2Graph . The 'set' methods writes a list into the edge or node data.

Usage

getKEGGnodeData(graph, n)
getKEGGedgeData(graph, n)

Arguments

ArgumentDescription
grapha graph object by parsing KGML file, where KEGG node and edge attributes are maintained
noptional character string, name of the desired node or edge. If is missing all node Data is returned

Details

Node and edge data is stored as list within environments in graphs to save memory and speed up graph manipulations. When using getKEGGnodeData or getKEGGedgeData is called, the list is extracted out of the environment and returned.

Value

Either a list or single item of KEGGNode-class or KEGGEdge-class object(s).

Note

These functions will be unified into 'KEGGnodeData' and 'KEGGnodeData<-' forms.

Author

Jitao David Zhang mailto:jitao_david.zhang@roche.com

Examples

sfile <- system.file("extdata/hsa04010.xml",package="KEGGgraph")
gR <- parseKGML2Graph(sfile,expandGenes=TRUE)
getKEGGnodeData(gR,"hsa:4214")
getKEGGedgeData(gR,"hsa:4214~hsa:5605")

Get KGML file (url) with KEGG PATHWAY ID and (optional) organism

Description

The function simply returns the KGML file url given KEGG PATHWAY ID. If the KEGG PATHWAY ID contains no organism prefix, user can specify the 'organism' parameter. Otherwise the 'organism' option is ignored.

retrieveKGML is a simple wrapper to getKGMLurl, which downloads the KGML file with download.file in utils package.

Usage

getKGMLurl(pathwayid, organism = "hsa")
retrieveKGML(pathwayid, organism, destfile,method="wget", ...)
kgmlNonmetabolicName2MetabolicName(destfile)
getCategoryIndepKGMLurl(pathwayid, organism="hsa", method="wget", ...)

Arguments

ArgumentDescription
pathwayidKEGG PATHWAY ID, e.g. 'hsa00020'
organismthree-alphabet organism code, if pathwayid contains the ocde this option is ignored
destfileDestination file, to which the remote KGML file should be saved
methodMethod to be used for downloading files, passed to download.file function. Currently supports "internal", "wget" and "lynx"
...Parameters passed to download.file

Details

The function getKGMLurl takes the pathway identifier (can be in the form of 'hsa00020' or with 'pathway' prefix, for example 'path:hsa00020'), and returns the url to download KGML file.

The mapping between pathway identifier and pathway name can be found by KEGGPATHNAME2ID (or reversed mappings) in KEGG.db package. See vignette for example.

retrieveKGML calls download.file to download the KGML file from KEGG FTP remotely.

Since July 2011 the KGML is downloaded directly from the HTTP main page of each pathway, instead of from the FTP server. The FTP server is only open to subscribers. Commercial and other users should consider support the KEGG database by subscribing to the FTP service. See the references section below.

Since July 2017, the function uses the REST API service of KEGG.

Value

KGML File URL of the given pathway.

Note

So far the function does not check the correctness of the 'organism' prefix, it is the responsibility of the user to garantee the right spelling.

For Windows users, it is necessary to download and install wget program ( http://gnuwin32.sourceforge.net/packages/wget.htm ) to use the wget method to download files. Sometimes it may be necessary to modify searching path to add GnuWin32 folder (where wget execution file is located) and re-install R to make wget work.

Some user may experience difficulty of retrieving KGML files when the download method is set to auto . In this case setting the method to wget may solve the problem (thanks to the report by Gilbert Feng).

There were a period when the metabolic and non-metabolic pathways were saved separately in different directories, and KEGGgraph was able to handle them. kgmlNonmetabolicName2MetabolicName is used to translate non-metabolic pathway KGML URL to that of metabolic pathway. getCategoryIndepKGMLurl determines the correct URL to download by attempting both possibilities. They were mainly called internally. Now since the KGML file is to be downloaded in each pathway's main page instead from the FTp server, these functions are no more needed and will be removed in the next release.

Author

Jitao David Zhang mailto:jitao_david.zhang@roche.com

References

Plea from KEGG (available as of Aug 2011) http://www.genome.jp/kegg/docs/plea.html

Examples

getKGMLurl("hsa00020")
getKGMLurl("path:hsa00020")
getKGMLurl("00020",organism="hsa")
getKGMLurl(c("00460", "hsa:00461", "path:hsa00453", "path:00453"))

## NOT RUN
tmp <- tempfile()
retrieveKGML(pathwayid='00010', organism='cel', destfile=tmp, method="wget")
## END
Link to this function

getName_methods()

Get 'name' attribute

Description

Get 'name' attribute for given object, this method can be used for almost all objects implemented in KEGGgraph package to extract their name slot. See manual pages of individual objects for examples.

Author

Jitao David Zhang mailto:jitao_david.zhang@roche.com

References

KGML Document Manual http://www.genome.jp/kegg/docs/xml/

Examples

sfile <- system.file("extdata/hsa04010.xml",package="KEGGgraph")
pathway <- parseKGML(sfile)

## get pathway name
getName(pathway)

## get node name
nodes <- nodes(pathway)
getName(nodes[[2]])

## get edge name: it is not informative since the nodes are identified
## with file-dependent indices
edges <- edges(pathway)
getName(edges[[7]])

## get subtype name
subtype <- getSubtype(edges[[2]])[[1]]
getName(subtype)
Link to this function

getNamedElement()

Extract the value in a vector by name

Description

The function extracts the value(s) in a named vector by given name(s), in case no element is found with the given name, NA will be returned

Usage

getNamedElement(vector, name)

Arguments

ArgumentDescription
vectorA named vector of any data type
nameWanted name

Value

The elements with the given name, 'NA' in case no one was found

Author

Jitao David Zhang mailto:jitao_david.zhang@roche.com

Examples

vec <- c(first="Hamburg", second="Hoffenheim",third="Bremen")
getNamedElement(vec, "third")
getNamedElement(vec, "last")
Link to this function

getPathwayInfo_methods()

Get KEGG pathway info

Description

KEGG stores additional information of the pathways in their KGML files, which can be extracted by this function.

The method returns the attributes of the pathway including its full title, short name, organism, image file link (which can be downloaded from KEGG website) and web link.

Examples

sfile <- system.file("extdata/hsa04010.xml",package="KEGGgraph")
pathway <- parseKGML(sfile)
getPathwayInfo(pathway)
Link to this function

getReactions_methods()

Get KEGG reactions

Description

In KGML, the pathway element specifies one graph object with the entry elements as its nodes and the relation and reaction elements as its edges. The relation elements are saved as edges in objects of KEGGPathway-class , and the reactions elements are saved as a slot of the object, which can be retrieved with the function getReactions .

Regulatory pathways are always viewed as protein networks, so there is no 'reaction' information saved in their KGML files. Metabolic pathways are viewed both as both protein networks and chemical networks, hence the KEGGPathway-class object may have reactions information.

Seealso

KEGGPathway-class

Author

Jitao David Zhang mailto:jitao_david.zhang@roche.com

References

KGML Document manual http://www.genome.jp/kegg/docs/xml/

Examples

mapfile <- system.file("extdata/map00260.xml", package="KEGGgraph")
maptest <- parseKGML(mapfile)
maptest

mapReactions <- getReactions(maptest)
mapReactions[1:3]
Link to this function

getRgraphvizEdgeNames()

Get Rgraphviz compatitable edge names

Description

Get Rgraphviz compatitable edge names, where the out- and in-nodes sharing a edge are concatenated by "~".

Usage

getRgraphvizEdgeNames(graph)

Arguments

ArgumentDescription
graphA graph object

Value

A list of names, the order is determined by the edge order.

Author

Jitao David Zhang maito:jitao_david.zhang@roche.com

References

Rgraphviz package

Examples

tnodes <- c("Hamburg","Dortmund","Bremen", "Paris")
tedges <- list("Hamburg"=c("Dortmund", "Bremen"),
"Dortmund"=c("Hamburg"), "Bremen"=c("Hamburg"), "Paris"=c())
tgraph <- new("graphNEL", nodes = tnodes, edgeL = tedges)
getRgraphvizEdgeNames(tgraph)
Link to this function

getSubtype_methods()

Get subtype

Description

KEGG stores sub-type of interactions between entities in the KGML files, which can be extracted with this method. The descriptions for the subtypes can be explored at the KGML document manual in the references.

See KEGGEdge-class for examples. The method for graphs is a wrapper to extract all subtype information from one graph.

Author

Jitao David Zhang mailto:jitao_david.zhang@roche.com

References

KGML Document manual http://www.genome.jp/kegg/docs/xml/

Examples

sfile <- system.file("extdata/hsa04010.xml",package="KEGGgraph")
pathway <- parseKGML(sfile)

edges <- edges(pathway)
subtype <- getSubtype(edges[[1]])
subtype
Link to this function

getTitle_methods()

Get title for given element

Description

The methods get title attribute for given KGML element, for example for objects of KEGGPathway-class or KEGGPathwayInfo-class

Author

Jitao David Zhang mailto:jitao_david.zhang@roche.com

References

KGML Document manual http://www.genome.jp/kegg/docs/xml/

Examples

sfile <- system.file("extdata/hsa04010.xml",package="KEGGgraph")
pathway <- parseKGML(sfile)

getTitle(pathway)

pi <- getPathwayInfo(pathway)
getTitle(pi)
Link to this function

getType_methods()

Get type attribute

Description

This method can be used to extract generic type attribute from several objects implemented in KEGGgraph package.

The meanings and descriptions of the types can be found at KGML manual listed in the reference.

Author

Jitao David Zhang mailto:jitao_david.zhang@roche.com

References

KGML Manual http://www.genome.jp/kegg/docs/xml/

Examples

mapfile <- system.file("extdata/map00260.xml", package="KEGGgraph")
maptest <- parseKGML(mapfile)

## node type
node <- nodes(maptest)[[3]]
getType(node)

## edge type
edge <- edges(maptest)[[5]]
getType(edge)

## reaction type
reaction <- getReactions(maptest)[[5]]
getType(reaction)
Link to this function

getValue_methods()

Get 'value' attribute

Description

Get 'value' attribute, mainly used internally and is not expected to be called by users.

Graph density

Description

The graph density is defined as d = E/(V*(V-1)/2) where E is the number of edges and V of nodes.

Usage

graphDensity(graph)

Arguments

ArgumentDescription
graphA graph object

Details

The density of a graph lies between [0,1]

Value

A value between [0,1]

Author

Jitao David Zhang jitao_david.zhang@roche.com

References

Aittokallio and Schwikowski (2006), Graph-based methods for analysing networks in cell biology, Briefings in Bioinformatics, 7, 243-255.

Examples

tnodes <- c("Hamburg","Dortmund","Bremen", "Paris")
tedges <- list("Hamburg"=c("Dortmund", "Bremen"),
"Dortmund"=c("Hamburg"), "Bremen"=c("Hamburg"), "Paris"=c())
tgraph <- new("graphNEL", nodes = tnodes, edgeL = tedges)
graphDensity(tgraph)

Determines whether a list is homogenous

Description

If a list contains objects of the same class with the given class name, we call it a homogenous list and the function returns TRUE , otherwise it returns FALSE .

Usage

isHomoList(list, class)

Arguments

ArgumentDescription
listA list
classThe class name to be validated

Value

logical

Author

Jitao David Zhang mailto:jitao_david.zhang@roche.com

Examples

testlist <- list("home1"="Hamburg","home2"="Heidelberg",
"home3"="Tianjin")
isHomoList(testlist,"character")
testlist$lucky <- 16
isHomoList(testlist,"character")
Link to this function

kgmlFileName2PathwayName()

Convert KGML file name to pathway name

Description

The function uses KEGG package and converts KGML file name into human readable pathway name.

Usage

kgmlFileName2PathwayName(filename)

Arguments

ArgumentDescription
filenameA KGML file name

Details

So far it only supports KGML files organized by species.

NOTE: there is issue of package loading sequence to use this function: the 'KEGG.db' must be loaded before 'KEGGgraph' to use it properly. Otherwise the mget returns error of 'KEGGPATHID2NAME' is not a environment. So far I don't where does this bug come from, so I commented out the examples.

Value

A character string of pathway name

Author

Jitao David Zhang mailto:jitao_david.zhang@roche.com

A function to merge KEGG graphs

Description

The function merges a list of KEGG graphs into one graph object. The merged graph have unique nodes, and edges are merged into non-duplicate sets.

For the reason of speed, mergeGraphs discards KEGG node and edge informations. To maintain them while merging graphs, please use mergeKEGGgraphs .

Usage

mergeGraphs(list, edgemode = "directed")

Arguments

ArgumentDescription
listA list of graph objects, which can be created by parseKGML2Graph
edgemodeEdge mode of the graph product, by default 'directed'

Details

The function takes a list of graphs and merges them into a new graph. The nodes of individual graphs must be unique. The function takes care of the removal of duplicated edges.

Value

A directed graph

Seealso

parseKGML2Graph

Note

It is known that graphs from C.elegance pathways have problem when merging, because the nodes name are not consistent betweeen edge records and entry IDs.

Author

Jitao David Zhang jitao_david.zhang@roche.com

Link to this function

mergeKEGGgraphs()

Merge KEGG graphs, also merging KEGGNode and KEGGEdge attributes

Description

mergeKEGGgraphs extends function mergeGraphs and merges a list of KEGG graphs. Both mergeGraphs and mergeKEGGgraphs can be used to merge graphs, while the latter form is able to merge the nodes and edges attributes from KEGG, so that the nodes and edges have a one-to-one mapping to the results from getKEGGnodeData and getKEGGEdgeData .

See details below.

Usage

mergeKEGGgraphs(list, edgemode = "directed")

Arguments

ArgumentDescription
listA list of named KEGG graphs
edgemodecharacter, 'directed' by default

Details

mergeGraphs discards the node or edge attributes, hence getKEGGnodeData or getKEGGedgeData will return NULL on the resulting graph.

mergeKEGGgraphs calls mergeGraphs first to merge the graphs, then it also merges the KEGGnodeData and KEGGedgeData.so that they are one-to-one mapped to the nodes and edges in the merged graph.

Value

A graph with nodeData and edgeData

Seealso

mergeGraphs

Note

From version 1.21.1, lists containing NULL should also work.

Author

Jitao David Zhang mailto:jitao_david.zhang@roche.com

Examples

sfile <- system.file("extdata/hsa04010.xml",package="KEGGgraph")
gR <- parseKGML2Graph(sfile,expandGenes=TRUE)

wntfile <- system.file("extdata/hsa04310.xml",package="KEGGgraph")
wntR <- parseKGML2Graph(wntfile, expandGenes=TRUE)

graphlist <- list(mapkG=gR, wntG=wntR)
mergedKEGG <- mergeKEGGgraphs(graphlist)

mergedKEGG

## list containing NULL works also
nlist <- list(gR, wntR, NULL)
nmergedKEGG <- mergeKEGGgraphs(nlist)

Return the neighborhood set of given vertices

Description

The function returns the neighborhood set of given vertices in the form of list. Optionally user can choose to include the given vertices in the list, too.

Usage

neighborhood(graph, index, return.self = FALSE)

Arguments

ArgumentDescription
graphAn object of graphNEL
indexNames of nodes, whose neighborhood set should be returned
return.selflogical, should the vertex itself also be returned?

Details

Let v be a vertex in a (di)graph, the out-neighborhood or successor set (N+(v), x belongs to V(G) and v->x) and the in-neighborhood or predecessor set (N-(v), x belongs to V(G) and x->v) are jointly returned.

The returned list is indexed by the given node indices, NULL is returned in case of non-existing node.

The nodes are unique, that is, duplicated nodes are removed in results.

Value

A list indexed by the given node indices, each entry containing the neighborhood set of that node (or furthermore including that node).

Author

Jitao David Zhang jitao_david.zhang@roche.com

References

D.B. West. Introduction to Graph Theory, Second Edition. Prentice Hall, 2001

Examples

V <- c("Hamburg","Stuttgart","Berlin","Paris","Bremen")
E <- list("Hamburg"=c("Berlin","Bremen"),
"Stuttgart"=c("Berlin","Paris"),
"Berlin"=c("Stuttgart","Bremen"),
"Paris"=c("Stuttgart"),
"Bremen"=c("Hamburg","Berlin"))
g <- new("graphNEL", nodes=V, edgeL=E, edgemode="directed")
if(require(Rgraphviz) & interactive()) {
plot(g, "neato")
}

## simple uses
neighborhood(g, "Hamburg")
neighborhood(g, c("Hamburg", "Berlin","Paris"))

## in case of non-existing nodes
neighborhood(g, c("Stuttgart","Ulm"))

## also applicable to non-directed graphs
neighborhood(ugraph(g), c("Stuttgart","Berlin"))

Parse ENTRY elements of KGML document

Description

ENTRY elements contain information of nodes (proteins, enzymes, compounds, maps, etc) in KEGG pathways. 'parseEntry' function parses the elements into link{KEGGNode-class} or KEGGGroup-class objects. It is not expected to be called directly by the user.

Usage

parseEntry(entry)

Arguments

ArgumentDescription
entryXML node of KGML file

Details

See http://www.genome.jp/kegg/docs/xml/ for more details about 'entry' as well as other elements in KGML files.

Value

An object of link{KEGGNode} or (in case of a group node) link{KEGGGroup}

Seealso

parseGraphics , parseKGML , KEGGNode-class , KEGGGroup-class

Author

Jitao David Zhang jitao_david.zhang@roche.com

References

http://www.genome.jp/kegg/docs/xml/

Link to this function

parseGraphics()

Parse 'graphics' elements in KGML files

Description

The function parses 'graphics' elements in KGML files, and it is mainly used internally.

Usage

parseGraphics(graphics)

Arguments

ArgumentDescription
graphicsXML node

Details

The function is called by other parsing functions and not intended to be called directly by user.

Value

An object of KEGGGraphics-class .

Seealso

KEGGGraphics-class

Author

Jitao David Zhang mailto:jitao_david.zhang@roche.com

References

KGML Document manual http://www.genome.jp/kegg/docs/xml/

KGML file parser

Description

The function parses KGML files according to the KGML XML documentation.

Usage

parseKGML(file)

Arguments

ArgumentDescription
fileName of KGML file

Details

The function parses KGML file (depending on XML package).

Value

An object of KEGGPathway-class .

Seealso

parseEntry , parseRelation , parseReaction , KEGGPathway-class ,

Author

Jitao David Zhang mailto:jitao_david.zhang@roche.com

References

KGML Manual http://www.genome.jp/kegg/docs/xml/

Examples

sfile <- system.file("extdata/hsa04010.xml",package="KEGGgraph")
kegg.pathway <- parseKGML(sfile)
kegg.pathway
Link to this function

parseKGML2DataFrame()

Parse KGML file into a data frame

Description

This function extends the parseKGML2Graph function, by converting the resulting graph into a three-column data frame representing out-nodes (the from column in the data frame), in-nodes ( to ), types and subtypes of edges that connect them ( type and subtype , respectively). It can be used, for example, for exporting KEGG pathway networks in plain text files.

Usage

parseKGML2DataFrame(file, reactions=FALSE,...)

Arguments

ArgumentDescription
fileA KGML file
reactionsLogical, whether metabolic reactions should be parsed and returned as part of the data frame. Default: FALSE
list()Other parameters passed to KEGGpathway2Graph

Details

The out- and in-nodes are represented in the form of KEGG identifiers. For human EntrezIDs the function translateKEGGID2GeneID can be used.

Multile edges are supported: in case more than one subtypes of edges exist between two nodes, they are all listed in the resulting data frame.

Value

A four-column data frame, representing the graph structure: out-nodes (the from column), in-nodes ( to ), edge type ( type ) and subtype ( subtype ).

Seealso

parseKGML2Graph , KEGGpathway2Graph and translateKEGGID2GeneID .

Author

Jitao David Zhang

Examples

sfile <- system.file("extdata/hsa04010.xml",package="KEGGgraph")
gdf <- parseKGML2DataFrame(sfile)
head(gdf)
dim(gdf)

rfile <- system.file("extdata/hsa00020.xml",package="KEGGgraph")
dim(dfWr <- parseKGML2DataFrame(rfile, reactions=TRUE))
dim(dfWOr <- parseKGML2DataFrame(rfile, reactions=FALSE))
stopifnot(nrow(dfWr)>nrow(dfWOr))

## not expanding genes: only the KGML-specific identifiers are used then
## only for expert use
## NOT RUN
gdf.ne <- parseKGML2DataFrame(sfile, expandGenes=FALSE)
dim(gdf.ne)
head(gdf.ne)
## NOT RUN
Link to this function

parseKGML2Graph()

Parse KGML files into KEGG graph

Description

This function is a wrapper for parseKGML and KEGGpathway2Graph. It takes two actions: first it reads in the KGML file and parses it into an object of KEGGPathway-class , the second step it calls KEGGpathway2Graph function to return the graph model.

Usage

parseKGML2Graph(file, ...)

Arguments

ArgumentDescription
fileName of KGML file
list()other parameters passed to KEGGpathway2Graph, see KEGGpathway2Graph

Details

Note that groups of genes will be split into single genes by calling the KEGGpathway2Graph function. Edges that connected to groups will be duplicated to connect each member of the group.

Value

A graph object.

Author

Jitao David Zhang mailto:jitao_david.zhang@roche.com

Examples

sfile <- system.file("extdata/hsa04010.xml",package="KEGGgraph")
gR <- parseKGML2Graph(sfile,expandGenes=TRUE)
gR
Link to this function

parseKGMLexpandMaps()

A convenient function to parse KGML and expand its containing maps into one graph object

Description

The function does several tasks implemented in the KEGGgraph package in sequence to make expanding maps easier.

Usage

parseKGMLexpandMaps(file, downloadmethod = "wget", genesOnly = TRUE, localdir,...)

Arguments

ArgumentDescription
fileA KGML file
downloadmethodpassed to download.file function as 'method', see its documentation for more details
genesOnlylogical, should only the genes nodes remain in the returned graph object?
localdircharacter string, if specified, the function tries to read files with the same base name from a local directory, useful when there are file copies on the client.
list()Other parameters passed to download.file

Details

In KEGG pathways there're usually pathways contained('cross-linked') in other pathways, for example see http://www.genome.jp/kegg/pathway/hsa/hsa04115.html , where p53 signalling pathway contains other two pathways 'apoptosis' and 'cell cycle'. This function parses these pathways (refered as 'maps' in KGML manual), download their KGML files from KEGG FTP website, parse them individually, and merge all the children pathway graphs with the parental pathway into one graph object. The graph is returned as the function value.

Since different graphs does not have unique node identifiers unless the genes are expanded, so by using this function user has to expand the genes. Another disadvantage is that so far due to the implementation, the KEGGnodeData and KEGGedgeData is lost during the merging. This however will probably be changed in the future version.

Value

A directed graph object

Seealso

for most users it is enough to use parseKGML2Graph

Author

Jitao David Zhang jitao_david.zhang@roche.com

References

KGML Document manual http://www.genome.jp/kegg/docs/xml/

Link to this function

parsePathwayInfo()

Parse information of the pathway from KGML files

Description

The function parses the information of the given pathway from KGML files into an object of KEGGPathwayInfo-class . It is used internally and is not expected to be called by users directly.

Usage

parsePathwayInfo(root)

Arguments

ArgumentDescription
rootRoot element of the KGML file

Value

An object of KEGGPathwayInfo-class

Author

Jitao David Zhang mailto:jitao_david.zhang@roche.com

References

KGML Document Manual http://www.genome.jp/kegg/docs/xml/

Link to this function

parseReaction()

Parse reaction from KGML files

Description

The function parses 'reaction' element in KGML files. It is used interally and not expected to be called by users.

Usage

parseReaction(reaction)

Arguments

ArgumentDescription
reactionA node of the type 'reaction' in KGML files

Details

See the reference manual for more information about 'reaction' type

Value

An object of KEGGReaction-class

Author

Jitao David Zhang mail:jitao_david.zhang@roche.com

References

KGML Document Manual http://www.genome.jp/kegg/docs/xml/

Link to this function

parseRelation()

Parse RELATION elements from KGML files

Description

RELATION elements in KGML files record the binary relationships between ENTRY elements, corresponding to (directed) edges in a graph. 'parseRelation' function parses RELATION elements into KEGGEdge-class objects from KGML files. It is not expected to be called directly by the user.

Usage

parseRelation(relation)

Arguments

ArgumentDescription
relationXML node of KGML file

Details

See http://www.genome.jp/kegg/docs/xml/ for more details about 'relation' as well as other elements in KGML files.

Value

An object of link{KEGGEdge} .

Seealso

KEGGEdge-class , parseEntry

Author

Jitao David Zhang jitao_david.zhang@roche.com

References

http://www.genome.jp/kegg/docs/xml/

Parse KGML relation subtype

Description

The function parses KGML relation subtype, called internally and not intended to be used by end users.

Usage

parseSubType(subtype)

Arguments

ArgumentDescription
subtypeKGML subtype node

Value

An object of KEGGEdgeSubType-class

Author

Jitao David Zhang mailto:jitao_david.zhang@roche.com

Link to this function

plotKEGGgraph()

Plot KEGG graph with Rgraphviz

Description

The function provides a simple interface to Rgraphviz to render KEGG graph with custom styles.

KEGGgraphLegend gives the legend of KEGG graphs

Usage

plotKEGGgraph(graph, y = "neato", shortLabel = TRUE,
useDisplayName=TRUE, nodeRenderInfos,  ...)
KEGGgraphLegend()

Arguments

ArgumentDescription
graphA KEGG graph, by calling parseKGML2Graph
ythe layout method, neato by default
shortLabellogical, should be short label used instead of full node name?
useDisplayNamelogical, should the labels of nodes rendered as the 'display name' specified in the KGML file or render them simply with the node names?
nodeRenderInfosList of node rendering info
list()Other functions passed to renderGraph, not implemented for now

Details

Users are not restricted to this function, alternatively you can choose other rendering functions.

Value

The graph after layout and rendering is returned.

Author

Jitao David Zhang mailto:jitao_david.zhang@roche.com

Examples

opar <- par(ask=TRUE)
sfile <- system.file("extdata/hsa04010.xml",package="KEGGgraph")
gR <- parseKGML2Graph(sfile,expandGenes=TRUE)
subs <-  c("hsa:1432",edges(gR)$`hsa:1432`,
"hsa:5778","hsa:5801","hsa:84867",
"hsa:11072","hsa:5606","hsa:5608",
"hsa:5494","hsa:5609")
gR.sub <- subGraph(subs, gR)
if(require(Rgraphviz))
plotKEGGgraph(gR.sub)

KEGGgraphLegend()
par(opar)
Link to this function

pvalue2asterisk()

Return common significance sign (asterisk) associated with given p value

Description

A p-value of 0.05, 0.01, 0.001 correspond to one, two or three asterisks. If 'sig.1' is set to TRUE , then the p-value of 0.1 returns '.'.

Usage

pvalue2asterisk(pvalues, sig.1 = FALSE)

Arguments

ArgumentDescription
pvaluesA numeric value
sig.1logical, whether the significance sign of 0.1 should be returned

Value

A character string containing the signs

Author

Jitao David Zhang mailto:jitao_david.zhang@roche.com

Examples

pvalue2asterisk(0.03)
pvalue2asterisk(0.007)
pvalue2asterisk(3e-5)
pvalue2asterisk(0.55)
Link to this function

queryKEGGsubgraph()

Query the subgraph of a given KEGG graph with Entrez GeneID (s)

Description

Given a list of genes (identified by Entrez GeneID), the function subsets the given KEGG gragh of the genes as nodes (and maintaining all the edges between).

Usage

queryKEGGsubgraph(geneids, graph, organism = "hsa", addmissing = FALSE)

Arguments

ArgumentDescription
geneidsA vector of Entrez GeneIDs
graphA KEGG graph
organisma three-alphabet code of organism
addmissinglogical, in case the given gene is not found in the graph, should it be added as single node to the subgraph?

Details

This function solves the questions like 'How is the list of gene interact with each other in the context of pathways?'

Limited by the translateKEGGID2GeneID , this function supports only human for now. We are working to include other organisms.

If 'addmissing' is set to TRUE , the missing gene in the given list will be added to the returned subgraph as single nodes.

Value

A subgraph with nodes representing genes and edges representing interactions.

Seealso

translateGeneID2KEGGID

Author

Jitao David Zhang jitao_david.zhang@roche.com

Examples

sfile <- system.file("extdata/hsa04010.xml",package="KEGGgraph")
gR <- parseKGML2Graph(sfile,expandGenes=TRUE)
geneids <- c(5594, 5595, 6197, 5603, 1843,5530, 5603)
sub <- queryKEGGsubgraph(geneids, gR)
if(require(Rgraphviz) && interactive()) {
plot(sub, "neato")
}

## add missing nodes
list2 <- c(geneids, 81029)
sub2 <- queryKEGGsubgraph(list2, gR,addmissing=TRUE)
if(require(Rgraphviz) && interactive()) {
plot(sub2, "neato")
}
Link to this function

randomSubGraph()

Randomly subset the given graph

Description

The function is intended to be a test tool. It subset the given graph repeatedly.

Usage

randomSubGraph(graph, per = 0.25, N = 10)

Arguments

ArgumentDescription
graphA graph object
pernumeric, the percentage of the nodes to be sampled, value between (0,1)
NRepeat times

Value

The function is called for its side effect, NULL is returned

Author

Jitao David Zhang mailto:jitao_david.zhang@roche.com

Examples

tnodes <- c("Hamburg","Dortmund","Bremen", "Paris")
tedges <- list("Hamburg"=c("Dortmund", "Bremen"),
"Dortmund"=c("Hamburg"), "Bremen"=c("Hamburg"), "Paris"=c())
tgraph <- new("graphNEL", nodes = tnodes, edgeL = tedges)
randomSubGraph(tgraph, 0.5, 10)
Link to this function

splitKEGGgroup()

Split KEGG group

Description

The function split 'group' entries in KGML files. Most of the cases they are complexes. During the splitting the function copies the edges between groups and nodes (or between groups and groups) correspondingly, so that the existing edges also exist after the groups are split.

Usage

splitKEGGgroup(pathway)

Arguments

ArgumentDescription
pathwayAn object of KEGGPathway-class

Details

By default the groups (complexes) in KEGG pathways are split.

Value

An object of KEGGPathway-class

Seealso

KEGGpathway2Graph

Author

Jitao David Zhang mailto:jitao_david.zhang@roche.com

References

KGML Manual http://www.genome.jp/kegg/docs/xml/

Examples

sfile <- system.file("extdata/hsa04010.xml",package="KEGGgraph")
kegg.pathway <- parseKGML(sfile)
kegg.pathway.split <- splitKEGGgroup(kegg.pathway)

## compare the different number of edges
length(edges(kegg.pathway))
length(edges(kegg.pathway.split))
Link to this function

subGraphByNodeType()

Subset KEGG graph by node types

Description

The function subsets KEGG graph by node types, mostly used in extracting gene networks.

Usage

subGraphByNodeType(graph, type = "gene", kegg=TRUE)

Arguments

ArgumentDescription
graphA KEGG graph object produced by calling parseKGML2Graph
typenode type, see KEGGNodeType for details
kegglogical, should the KEGG Node and Edge attributes be maintained during the subsetting? By default set to 'TRUE'

Value

A subgraph of the original graph

Author

Jitao David Zhang mailto:jitao_david.zhang@roche.com

Examples

sfile <- system.file("extdata/hsa04010.xml",package="KEGGgraph")
sGraph <- parseKGML2Graph(sfile,expandGenes=TRUE, genesOnly=FALSE)
sGraphGene <- subGraphByNodeType(sGraph, type="gene")

Subset KEGG graph, including subsetting node and edge attributes

Description

subKEGGgraph extends generic method subGraph and subsets the KEGG graph. Both 'subKEGGgraph' and 'subGraph' can be used to subset the graph, the difference lies in whether the node and edge attributes from KEGG are also subset ( subKEGGgraph ) or not ( subGraph ).

See details below.

Usage

subKEGGgraph(nodes, graph)

Arguments

ArgumentDescription
nodesNode names to subset
graphA graph parsed from KGML files, produced by parseKGML2Graph , KEGGpathway2Graph or parseKGMLexpandMaps

Details

subGraph does not subset the node or edge attributes, hence the results of getKEGGnodeData and getKEGGedgeData does not map to the nodes and edges in the subgraph in a one-to-one manner, with attributes of removed nodes and edges still remaining in the subGraph.

subKEGGgraph calls subGraph first to subset the graph, and then it also subsets the KEGGnodeData and KEGGedgeData so that they are one-to-one mapped to the nodes and edges in the subgraph.

Value

A graph with nodeData and edgeData.

Author

Jitao David Zhang mailto:jitao_david.zhang@roche.com

Examples

sfile <- system.file("extdata/hsa04010.xml",package="KEGGgraph")
gR <- parseKGML2Graph(sfile,expandGenes=TRUE)
subs <-  c("hsa:1432",edges(gR)$`hsa:1432`,"hsa:5778","hsa:5801",
"hsa:84867","hsa:11072","hsa:5606","hsa:5608","hsa:5494","hsa:5609")
gR.keggsub <- subKEGGgraph(subs, gR)
gR
gR.keggsub
Link to this function

subtypeDisplay_methods()

Get display information for relation subtypes

Description

To render KEGG pathway graphs, we have created a custom style of edges to represent their subtypes. 'subtypeDisplay' extracts this information

Colorectal cancer dataset

Description

Colorectal cancer dataset provided by SPIA package. It is just a copy during the development of SPIA package in case the package is not available. It will be removed when the SPIA package is stable.

see the description of SPIA package.

Format

see the format of SPIA package.

Usage

data(colorectalcancerSPIA)
Link to this function

translateKEGGID2GeneID()

Translate between KEGGID and Entrez Gene ID

Description

translateKEGGID2GeneID translates KEGGID to NCBI Entrez Gene ID, and translateGeneID2KEGGID translates Entrez Gene ID back to KEGGID.

Usage

translateKEGGID2GeneID(x, organism="hsa")
translateGeneID2KEGGID(x, organism="hsa")

Arguments

ArgumentDescription
xKEGGID, e.g. 'hsa:1432', or Entrez Gene ID, e.g. '1432'
organismThree alphabet code for organisms. The mapping between the orgniams and codes can be found at http://www.genome.jp/kegg/kegg3.html

Details

The KEGGID are unique identifiers used by KEGG PATHWAY to identify gene products. After parsing the KEGG pathway into graph, the graph use KEGGID as its nodes' names.

translateKEGGID2GeneID converts KEGGIDs into entrez GeneID, which can be translated to other types of identifiers, for example with biomaRt package or organism-specific annotation packages. See vignette for examples.

translateKEGG2GeneID is maintained for back-compatibility and wrapps translateKEGGID2GeneID .

Value

Entrez GeneID of the given KEGG ID(s)

Note

This function works so far only with human KEGGIDs, since for them the Entrez GeneID can be derived easily with removing the organism prefix.

The complete functional function will be implemented in the later release of the package.

Author

Jitao David Zhang

Examples

egNodes <- c("hsa:1432", "hsa:11072")
translateKEGGID2GeneID(egNodes)
translateGeneID2KEGGID("1432")
Link to this function

translateKEGGgraph()

Tranlate the KEGG graph from being indexed by KEGGID to another identifer

Description

The function translates the KEGG graph into a graph of equivalant topology while index with unique identifiers given by user. The new identifiers could be, for example, GeneSymbol or other identifiers mapped to KEGGID.

Usage

translateKEGGgraph(graph, newNodes)

Arguments

ArgumentDescription
graphA KEGG graph
newNodesA character vector giving the new nodes, must be of the same length and same order of the nodes of the given graph

Details

The function is still experimental and users are welcomed to report any difficulties

Value

Another graph indexed by the given identifier

Author

Jitao David Zhang jitao_david.zhang@roche.com

Examples

sfile <- system.file("extdata/hsa04010.xml",package="KEGGgraph")
gR <- parseKGML2Graph(sfile,expandGenes=TRUE)

subG <- subKEGGgraph(c("hsa:1848","hsa:1432","hsa:2002","hsa:8986"),gR)
symbols <- c("DUSP6","MAPK14","ELK1","RPS6KA4")
sub2G <- translateKEGGgraph(subG, symbols)
sub2G
nodes(sub2G)

if(require(Rgraphviz) & interactive()) {
plot(sub2G, "neato")
}