pathview: Warning: Failed to download KEGG xml/png files, hsa04110 skipped!
1
0
Entering edit mode
덕윤 • 0
@086bf132
Last seen 19 months ago
South Korea

I have been troubles with using pathview command. I followed the "Pathview: pathway based data integration and visualization" and wrote the sample codes as following.

library(pathview)

data(gse16873.d)

filename=system.file("extdata/gse16873.demo",package="pathview")

gse16873=read.delim(filename,row.names=1)

gse16873.d=gse16873[,2*(1:6)]-gse16873[,2*(1:6)-1]

data(demo.paths)

data(paths.hsa)

head(paths.hsa,3) hsa00010 hsa00020 "Glycolysis / Gluconeogenesis" "Citrate cycle (TCA cycle)" hsa00030 "Pentose phosphate pathway"

i <- 1

pv.out <- pathview(gene.data = gse16873.d[, 1], pathway.id = demo.paths$sel.paths[i], + species = "hsa", out.suffix = "gse16873", kegg.native = T)

Info: Downloading xml files for hsa04110, 1/1 pathways.. Info: Downloading png files for hsa04110, 1/1 pathways.. Warning: Failed to download KEGG xml/png files, hsa04110 skipped! 경고메시지(들):

This mean for warning messages; Because the Korean R program was installed, the warning message came out in Korean. I'm sorry :(

1: download.file(xml.url, xml.target, quiet = T)에서: URL https://rest.kegg.jp/get/hsa04110/kgml: cannot open destfile './hsa04110.xml', reason 'Permission denied'

2: download.file(xml.url, xml.target, quiet = T)에서: 다운로드의 종료상태(exit status)가 0이 아닙니다.

In download.file(xml.url, xml.target, quiet = T): The exit status of the download is not 0.

I can't remember why pahtview command did not work.

My R version is following.

R version 4.3.0 alpha (2023-03-28 r84109 ucrt) Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 (64-bit)

I've used previous R versions (3.5.1, 4.2.2 and 4.2.3) as well, but always get stuck at this step. I'm asking because it doesn't seem to be a version issue.

Please let me know how to fix this problem.

Thank you.

pathview • 1.7k views
ADD COMMENT
0
Entering edit mode
Guido Hooiveld ★ 4.1k
@guido-hooiveld-2020
Last seen 1 hour ago
Wageningen University, Wageningen, the …

It seems you are running the example code that is listed on the help page of the pathview function, but I also noticed you inserted some other code that is not relevant! Maybe that is causing the problem, since the example code is running fine in my hands. See below. I am using R-4.2.2 and the current release version of Bioconductor (=3.16) and pathview.

> setwd("E:\\test")
> 
> library(pathview)
> 
> ## load example data, and check
> data(gse16873.d)
> gse16873.d[1:4,1:4]
          DCIS_1      DCIS_2      DCIS_3      DCIS_4
10000 -0.3076448 -0.14722769 -0.02378481 -0.07056193
10001  0.4158680 -0.33477259 -0.51313691 -0.16653712
10002  0.1985493  0.03789588  0.34186534 -0.08527420
10003 -0.2315530 -0.09659311 -0.10472728 -0.04801404
> 
> ## load example pathways, and check
> data(demo.paths)
> demo.paths
$sel.paths
[1] "04110" "00620" "00640"

$kpos1
[1] "topright"    "bottomright" "topright"   

$kpos2
[1] "topright"    "topright"    "bottomright"

$spos
[1] "bottomleft" "bottomleft" "topright"  

$offs
[1] -1.0 -1.0 -0.8

> 
> ## plot expression data of first sample
> ## on the first pathway (="04110")
> i <- 1
> 
> ## create actual plot. png will be saved in working directory
> pv.out <- pathview(gene.data = gse16873.d[, 1],    ## plot expression data from first sample
+                    pathway.id = demo.paths$sel.paths[i],    ## plot on the first ("04110") of the 3 demo pathways
+                    species = "hsa",    ## hsa = KEGG identifier for humanm
+                    out.suffix = "gse16873",    ## add this suffix to name of png file
+                    kegg.native = TRUE)    ## overlay expression data on KEGG-like pathway (and do not create a graphviz object) 
'select()' returned 1:1 mapping between keys and columns
Info: Working in directory E:/test
Info: Writing image file hsa04110.gse16873.png
>
> str(pv.out)
List of 2
 $ plot.data.gene:'data.frame': 92 obs. of  10 variables:
  ..$ kegg.names: chr [1:92] "1029" "51343" "4171" "4998" ...
  ..$ labels    : chr [1:92] "CDKN2A" "FZR1" "MCM2" "ORC1" ...
  ..$ all.mapped: chr [1:92] "1029" "51343" "4171,4172,4173,4174,4175,4176" "4998,4999,5000,5001,23594,23595" ...
  ..$ type      : chr [1:92] "gene" "gene" "gene" "gene" ...
  ..$ x         : num [1:92] 532 919 553 494 919 919 188 432 123 77 ...
  ..$ y         : num [1:92] 124 536 556 556 297 519 519 191 704 687 ...
  ..$ width     : num [1:92] 46 46 46 46 46 46 46 46 46 46 ...
  ..$ height    : num [1:92] 17 17 17 17 17 17 17 17 17 17 ...
  ..$ mol.data  : num [1:92] 0.129 -0.404 -0.42 0.986 0.936 ...
  ..$ mol.col   : chr [1:92] "#BEBEBE" "#5FDF5F" "#5FDF5F" "#FF0000" ...
 $ plot.data.cpd : NULL
> 
> head(pv.out$plot.data.gene)
  kegg.names labels                                  all.mapped type   x   y
4       1029 CDKN2A                                        1029 gene 532 124
5      51343   FZR1                                       51343 gene 919 536
6       4171   MCM2               4171,4172,4173,4174,4175,4176 gene 553 556
7       4998   ORC1             4998,4999,5000,5001,23594,23595 gene 494 556
8        996  CDC27 996,8697,8881,10393,25847,25906,29882,51433 gene 919 297
9        996  CDC27 996,8697,8881,10393,25847,25906,29882,51433 gene 919 519
  width height   mol.data mol.col
4    46     17  0.1291987 #BEBEBE
5    46     17 -0.4043256 #5FDF5F
6    46     17 -0.4202181 #5FDF5F
7    46     17  0.9864873 #FF0000
8    46     17  0.9363018 #FF0000
9    46     17  0.9363018 #FF0000
> 
> 
> ## version information
> packageVersion("pathview")
[1] ‘1.38.0’
> 
> sessionInfo()
R version 4.2.2 (2022-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)

Matrix products: default

Random number generation:
 RNG:     Mersenne-Twister 
 Normal:  Inversion 
 Sample:  Rounding 

locale:
[1] LC_COLLATE=English_United States.utf8 
[2] LC_CTYPE=English_United States.utf8   
[3] LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.utf8    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] pathview_1.38.0

loaded via a namespace (and not attached):
 [1] graph_1.76.0           KEGGgraph_1.58.3       AnnotationDbi_1.60.2  
 [4] XVector_0.38.0         BiocGenerics_0.44.0    zlibbioc_1.44.0       
 [7] IRanges_2.32.0         bit_4.0.5              R6_2.5.1              
[10] rlang_1.1.0            fastmap_1.1.1          org.Hs.eg.db_3.16.0   
[13] blob_1.2.4             httr_1.4.5             GenomeInfoDb_1.34.9   
[16] tools_4.2.2            grid_4.2.2             Biobase_2.58.0        
[19] png_0.1-8              cli_3.6.1              DBI_1.1.3             
[22] bit64_4.0.5            crayon_1.5.2           GenomeInfoDbData_1.2.9
[25] Rgraphviz_2.42.0       vctrs_0.6.1            S4Vectors_0.36.2      
[28] bitops_1.0-7           KEGGREST_1.38.0        RCurl_1.98-1.10       
[31] cachem_1.0.7           memoise_2.0.1          RSQLite_2.3.0         
[34] compiler_4.2.2         Biostrings_2.66.0      stats4_4.2.2          
[37] XML_3.99-0.14          pkgconfig_2.0.3       
> 

enter image description here

## overlay the expression data of the 1st 3 samples
> c(1:3)
[1] 1 2 3
> pv.out.3 <- pathview(gene.data = gse16873.d[, c(1:3)],
+                    pathway.id = demo.paths$sel.paths[i],
+                    species = "hsa",
+                    out.suffix = "gse16873",
+                    kegg.native = TRUE)
'select()' returned 1:1 mapping between keys and columns
Info: Working in directory E:/test
Info: Writing image file hsa04110.gse16873.multi.png
> 

enter image description here

ADD COMMENT
0
Entering edit mode

Really appreciate your help :)

At last, I can fix my problem. I have learned to check my code.

ADD REPLY

Login before adding your answer.

Traffic: 711 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6