subGraphByNodeType {KEGGgraph} | R Documentation

## 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

`graph` | A KEGG graph object produced by calling `parseKGML2Graph`
`type` | node type, see `KEGGNodeType` for details
`kegg` | logical, 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(s)

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")

[Package KEGGgraph version 1.40.0 Index]