mergeKEGGgraphs: Merge KEGG graphs, also merging KEGGNode and KEGGEdge...

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/graph.R

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

1
mergeKEGGgraphs(list, edgemode = "directed")

Arguments

list

A list of named KEGG graphs

edgemode

character, '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

Note

From version 1.21.1, lists containing NULL should also work.

Author(s)

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

See Also

mergeGraphs

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
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)

Example output

Attaching package: 'KEGGgraph'

The following object is masked from 'package:graphics':

    plot

A graphNEL graph with directed edges
Number of Nodes = 386 
Number of Edges = 1628 

KEGGgraph documentation built on Nov. 8, 2020, 5:42 p.m.