KEGGpathway2reactionGraph {KEGGgraph} | R Documentation

## 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, uniqueReaction = TRUE)

### Arguments

`pathway` | A `KEGGPathway-class` object, usually as the result of the function `parseKGML`
`uniqueReaction` | logical, to indicate whether several chemical reactions (identified by different KEGG reaction ID) should be treated as one (TRUE) or many (FALSE)

### 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`).

### Value

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

### Author(s)

Jitao David Zhang mailto:j.zhang@dkfz.de

### References

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

### See Also

`KEGGPathway-class`

### Examples

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

[Package KEGGgraph version 1.1.0 Index]