Skip to contents

Downloads mol files corresponding to individual compounds or compounds in a pathway from KEGG.

Usage

get_mol_kegg(compound_ids, pathway_ids, dir, force = FALSE)

Arguments

compound_ids

Character vector of KEGG compound IDs—5 digits prepended with a "C".

pathway_ids

Character vector of KEGG pathway or pathway module IDs—5 digits prepended with "map" or "M", respectively.

dir

Path to a folder to save .mol files in. Folder will be created if it does not already exist.

force

Logical; by default (FALSE), .mol files will not be downloaded if they are found in dir. Set this to TRUE to download and overwrite existing files.

Value

A tibble with the columns compound_ids, pathway_ids (if used), and mol_paths (paths to downloaded .mol files).

Examples

if (FALSE) { # \dontrun{
get_mol_kegg(compound_ids = c("C16181", "C06074"), dir = tempdir())
get_mol_kegg(pathway_ids = "map00253", dir = tempdir())
} # }