Last data update: 2014.03.03

R: Number of mapped keys for the maps in package KEGG.db
KEGGMAPCOUNTSR Documentation

Number of mapped keys for the maps in package KEGG.db

Description

KEGGMAPCOUNTS provides the "map count" (i.e. the count of mapped keys) for each map in package KEGG.db.

Details

This "map count" information is precalculated and stored in the package annotation DB. This allows some quality control and is used by the checkMAPCOUNTS function defined in AnnotationDbi to compare and validate different methods (like count.mappedkeys(x) or sum(!is.na(as.list(x)))) for getting the "map count" of a given map.

See Also

  • mappedkeys,

  • count.mappedkeys,

  • checkMAPCOUNTS

  • AnnotationDb-class for use of the select() interface.

Examples

## select() interface:
## Objects in this package can be accessed using the select() interface
## from the AnnotationDbi package. See ?select for details.

## Bimap interface:
KEGGMAPCOUNTS
mapnames <- names(KEGGMAPCOUNTS)
KEGGMAPCOUNTS[mapnames[1]]
x <- get(mapnames[1])
sum(!is.na(as.list(x)))
count.mappedkeys(x)   # much faster!

## Check the "map count" of all the maps in package KEGG.db
checkMAPCOUNTS("KEGG.db")

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(KEGG.db)
Loading required package: AnnotationDbi
Loading required package: stats4
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, xtabs

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

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colnames, 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, rownames, sapply, setdiff, sort, table, tapply, union,
    unique, unsplit

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 objects are masked from 'package:base':

    colMeans, colSums, expand.grid, rowMeans, rowSums


KEGG.db contains mappings based on older data because the original
  resource was removed from the the public domain before the most
  recent update was produced. This package should now be considered
  deprecated and future versions of Bioconductor may not have it
  available.  Users who want more current data are encouraged to look
  at the KEGGREST or reactome.db packages

> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/KEGG.db/KEGGMAPCOUNTS.Rd_%03d_medium.png", width=480, height=480)
> ### Name: KEGGMAPCOUNTS
> ### Title: Number of mapped keys for the maps in package KEGG.db
> ### Aliases: KEGGMAPCOUNTS
> ### Keywords: datasets
> 
> ### ** Examples
> 
> ## select() interface:
> ## Objects in this package can be accessed using the select() interface
> ## from the AnnotationDbi package. See ?select for details.
> 
> ## Bimap interface:
> KEGGMAPCOUNTS
 KEGGENZYMEID2GO KEGGEXTID2PATHID  KEGGGO2ENZYMEID KEGGPATHID2EXTID 
            4178            75100             5224             3152 
 KEGGPATHID2NAME  KEGGPATHNAME2ID 
             478              478 
> mapnames <- names(KEGGMAPCOUNTS)
> KEGGMAPCOUNTS[mapnames[1]]
KEGGENZYMEID2GO 
           4178 
> x <- get(mapnames[1])
> sum(!is.na(as.list(x)))
[1] 4178
> count.mappedkeys(x)   # much faster!
[1] 4178
> 
> ## Check the "map count" of all the maps in package KEGG.db
> checkMAPCOUNTS("KEGG.db")
Counting mapped keys for map KEGGENZYMEID2GO:
  - length(map) = 4178
  - MAPCOUNTS["KEGGENZYMEID2GO"] = 4178
  - count1 = 4178 (0.006 s)
  - count2 = 4178 (0.008 s)
  - count3 = 4178 (0.017 s)
Counting mapped keys for map KEGGEXTID2PATHID:
  - length(map) = 75100
  - MAPCOUNTS["KEGGEXTID2PATHID"] = 75100
  - count1 = 75100 (0.182 s)
  - count2 = 75100 (0.093 s)
  - count3 = 75100 (0.847 s)
Counting mapped keys for map KEGGGO2ENZYMEID:
  - length(map) = 5224
  - MAPCOUNTS["KEGGGO2ENZYMEID"] = 5224
  - count1 = 5224 (0.009 s)
  - count2 = 5224 (0.01 s)
  - count3 = 5224 (0.041 s)
Counting mapped keys for map KEGGPATHID2EXTID:
  - length(map) = 3152
  - MAPCOUNTS["KEGGPATHID2EXTID"] = 3152
  - count1 = 3152 (0.079 s)
  - count2 = 3152 (0.082 s)
  - count3 = 3152 (0.166 s)
Counting mapped keys for map KEGGPATHID2NAME:
  - length(map) = 478
  - MAPCOUNTS["KEGGPATHID2NAME"] = 478
  - count1 = 478 (0.003 s)
  - count2 = 478 (0.002 s)
  - count3 = 478 (0.006 s)
Counting mapped keys for map KEGGPATHNAME2ID:
  - length(map) = 478
  - MAPCOUNTS["KEGGPATHNAME2ID"] = 478
  - count1 = 478 (0.002 s)
  - count2 = 478 (0.002 s)
  - count3 = 478 (0.006 s)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>