Download and cache KEGG KGML files.
Details
This function can save an individual KGML to the cache or to a path.
If specified, the BiocFileCache cache is prioritized.
If a path if specified and it is a directory, it will save the file there.
If the path specified a file path, this will be the location to store the
file. If it is left as NULL, it will save the KMGL file in the current
working directory
Examples
data_dir <- tempdir()
kgml_path <- retrieve_kgml("hsa04110", path = data_dir, verbose = TRUE)
#> Downloading KGML from: https://rest.kegg.jp/get/hsa04110/kgml
#> Downloaded & saved in: /tmp/RtmpkwIYXN/hsa04110.xml
cache_dir <- tempdir()
kgml_path_cached <- retrieve_kgml("hsa04110",
bfc = BiocFileCache::BiocFileCache(cache_dir),
verbose = TRUE
)
#> Downloading KGML from: https://rest.kegg.jp/get/hsa04110/kgml
#> adding rname 'https://rest.kegg.jp/get/hsa04110/kgml'
#>
#> Cached: hsa04110