keggDF2graph: create a graph from a specific data frame format for KEGG...

Description Usage Arguments Details Value Note Author(s) Examples

View source: R/keggDF2graph.R

Description

create a graph from a specific data frame format for KEGG orthology

Usage

1
2
keggDF2graph(df, root="KO.June07root")
data(KOgraph)

Arguments

df

the data frame

root

a name for root node

Details

the obvious directed graph structure from root to leaf nodes (pathway names) is instantiated for the orthology, nodeData attribute tag is loaded with the numerical tag for the term in KEGG, and nodeData attribute depth is loaded with depth from root

Based on keggorthology read of KEGG orthology, March 2 2010. Specifically, we run wget on ftp://ftp.genome.jp/pub/kegg/brite/ko/ko00001.keg and use parsing and modeling code given in inst/keggHTML to generate a data frame respecting the hierarchy, and then keggDF2graph to construct the graph.

Value

a graphNEL-class instance

Note

This is only a support function. The graph is serialized in the package data directory.

Author(s)

Vince Carey <stvjc@channing.harvard.edu>

Examples

1
2
3
4
5
6
data(keggOrthDF)
keggOrthDF[1:5,]
data(KOgraph)
nodes(KOgraph)[1:4]
nodeData(KOgraph,,"tag")[1:5]
nodeData(KOgraph,,"depth")[1:5]

Example output

Loading required package: graph
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, sd, var, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, basename, cbind, colMeans, colSums, colnames,
    dirname, do.call, duplicated, eval, evalq, get, grep, grepl,
    intersect, is.unsorted, lapply, lengths, mapply, match, mget,
    order, paste, pmax, pmax.int, pmin, pmin.int, rank, rbind,
    rowMeans, rowSums, rownames, sapply, setdiff, sort, table, tapply,
    union, unique, unsplit, which, which.max, which.min

Loading required package: hgu95av2.db
Loading required package: AnnotationDbi
Loading required package: stats4
Loading required package: Biobase
Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.

Loading required package: IRanges
Loading required package: S4Vectors

Attaching package: 'S4Vectors'

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

    expand.grid

Loading required package: org.Hs.eg.db


  lev1 lev2 depth                         term   tag
2    1    1     1                   Metabolism 01100
3    1  1.1     2      Carbohydrate Metabolism 01101
4    1  1.1     3 Glycolysis / Gluconeogenesis 00010
5    1  1.1     3    Citrate cycle (TCA cycle) 00020
6    1  1.1     3    Pentose phosphate pathway 00030
[1] "KO.Feb10root"                 "Metabolism"                  
[3] "Carbohydrate Metabolism"      "Glycolysis / Gluconeogenesis"
$KO.Feb10root
[1] "NONE"

$Metabolism
[1] "01100"

$`Carbohydrate Metabolism`
[1] "01101"

$`Glycolysis / Gluconeogenesis`
[1] "00010"

$`Citrate cycle (TCA cycle)`
[1] "00020"

$KO.Feb10root
[1] 0

$Metabolism
[1] 1

$`Carbohydrate Metabolism`
[1] 2

$`Glycolysis / Gluconeogenesis`
[1] 3

$`Citrate cycle (TCA cycle)`
[1] 3

keggorthology documentation built on Nov. 8, 2020, 6:49 p.m.