download.kegg: Download KEGG pathway graphs and associated KGML data

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

This is the downloader function for KEGG pathways, automatically download graph images and associated KGML data.

Usage

1
2
download.kegg(pathway.id = "00010", species = "hsa", kegg.dir = ".",
file.type=c("xml", "png"))

Arguments

pathway.id

character, 5-digit KEGG pathway IDs. Default pathway.id="00010".

species

character, either the KEGG code, scientific name or the common name of the target species. When KEGG ortholog pathway is considered, species="ko". Default species="hsa", it is equivalent to use either "Homo sapiens" (scientific name) or "human" (common name).

kegg.dir

character, the directory of KEGG pathway data file (.xml) and image file (.png). Default kegg.dir="." (current working directory).

file.type

character, the file type(s) to be downloaded, either KEGG pathway data file (xml) or image file (png). Default include both types.

Details

Species can be specified as either kegg code, scientific name or the common name. Scientific name and the common name are always mapped to kegg code first. Length of species should be either 1 or the same as pathway.id, if not, the same set of pathway.id will be applied to all species.

Value

a named character vector, either "succeed" or "failed", indicating the download status of corresponding pathways.

Author(s)

Weijun Luo <luo_weijun@yahoo.com>

References

Luo, W. and Brouwer, C., Pathview: an R/Bioconductor package for pathway based data integration and visualization. Bioinformatics, 2013, 29(14): 1830-1831, doi: 10.1093/bioinformatics/btt285

See Also

pathview the main function, node.info the parser,

Examples

1
2
3
4
data(demo.paths)
sel.2paths=demo.paths$sel.paths[1:2]
download.kegg(pathway.id = sel.2paths, species = "hsa")
#pathway files should be downloaded into current working directory

Example output

Loading required package: org.Hs.eg.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, 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: 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


Error in file(file, "rt") : 
  cannot open the connection to 'https://pathview.uncc.edu/data/korg.tsv'
In addition: Warning message:
In file(file, "rt") :
  URL 'https://pathview.uncc.edu/data/korg.tsv': status was 'Couldn't resolve host name'
##############################################################################
Pathview is an open source software package distributed under GNU General
Public License version 3 (GPLv3). Details of GPLv3 is available at
http://www.gnu.org/licenses/gpl-3.0.html. Particullary, users are required to
formally cite the original Pathview paper (not just mention it) in publications
or products. For details, do citation("pathview") within R.

The pathview downloads and uses KEGG data. Non-academic uses may require a KEGG
license agreement (details at http://www.kegg.jp/kegg/legal.html).
##############################################################################
Info: Downloading xml files for hsa04110, 1/2 pathways..
Warning: Download of hsa04110 xml file failed!
This pathway may not exist!
Info: Downloading xml files for hsa00620, 2/2 pathways..
Warning: Download of hsa00620 xml file failed!
This pathway may not exist!
Info: Downloading png files for hsa04110, 1/2 pathways..
Warning: Download of hsa04110 png file failed!
This pathway may not exist!
Info: Downloading png files for hsa00620, 2/2 pathways..
Warning: Download of hsa00620 png file failed!
This pathway may not exist!
hsa04110 hsa00620 
"failed" "failed" 
Warning messages:
1: In download.file(xml.url, xml.target, quiet = T) :
  URL 'http://rest.kegg.jp/get/hsa04110/kgml': status was 'Couldn't resolve host name'
2: In download.file(xml.url, xml.target, quiet = T) :
  URL 'http://rest.kegg.jp/get/hsa00620/kgml': status was 'Couldn't resolve host name'

pathview documentation built on Dec. 12, 2020, 2 a.m.