kegg_link: Use linking data from the KEGG database.

View source: R/data.R

ec2koR Documentation

Use linking data from the KEGG database.

Description

kegg_link() is a convenience function to return a list containing two data.frames; ec2cpd and ec2ko. This will be their most likely use. ec2cpd and ec2ko are two data.frames, used to link ko, ecs and cpd identifiers in the KEGG database.

Usage

data("ec2ko", package = "anansi")

data("ec2cpd", package = "anansi")

kegg_link()

Format

ec2ko: a data.frame of two columns, named "ec" and "ko". The IDs refer to KEGG orthologues. Enzyme commission numbers, ecs, typically describe reactions captured by them.

ec2cpd: a data.frame of two columns, named "ec" and "cpd". The IDs refer to compounds in the KEGG database. Enzyme commission numbers, ecs, typically describe reactions either producing or requiring them.

Value

kegg_link() returns a list containing the two aforementioned data.frames, ec2cpd and ec2ko.

Source

ec2ko: Adapted from https://www.genome.jp/kegg/, using KEGGREST. Script to generate available in example.

ec2cpd: Adapted from https://www.genome.jp/kegg/ using KEGGREST. Script to generate available in example.

Examples

kegg_link()

# Generate ec2ko and ec2cpd:
# Don't download during tests. set to `TRUE` to download.
dry_run <- TRUE

if (!dry_run) {
    ec2ko <- KEGGREST::keggLink("ec", "ko")
    ec2ko <- data.frame(
        ec = gsub("ec:", "", x = ec2ko, fixed = TRUE),
        ko = gsub("ko:", "", x = names(ec2ko), fixed = TRUE),
        row.names = NULL
    )

    ec2cpd <- KEGGREST::keggLink("ec", "cpd")
    ec2cpd <- data.frame(
        ec = gsub("ec:", "", x = ec2cpd, fixed = TRUE),
        cpd = gsub("cpd:", "", x = names(ec2cpd), fixed = TRUE),
        row.names = NULL
    )
}


thomazbastiaanssen/anansi documentation built on June 9, 2025, 3:59 p.m.