Problem in kegga() and others getting data from KEGG after switch from http to https
Entering edit mode
Jenny Drnevich ★ 2.0k
Last seen 7 months ago
United States

Hi all,

I have codes to download updated KEGG pathways that I have run thousands of times that now fail with an error. Here is a reproducible example using kegga():

> library(limma)
> library(Mus.musculus)
Loading required package: AnnotationDbi
#... deleted for space
> univ_EG <- keys(Mus.musculus, keytype = "ENTREZID")
> sel_EG <- univ_EG[200:1200]
> kegg_out <- kegga(sel_EG, universe = univ_EG, 
+                         species.KEGG = "mmu")
Error in scan(file = file, what = what, sep = sep, quote = quote, dec = dec,  : 
  cannot read from connection
In addition: Warning message:
In scan(file = file, what = what, sep = sep, quote = quote, dec = dec,  :
  URL '': status was 'Failure when receiving data from the peer'

I went to KEGG and this notice was posted that KEGG API moving to HTTPS as of June 1, 2022: . I think this may be the cause of my problem and also this recent post KEGG Pathway in R . Anyone know what settings I need to change?

Thanks, Jenny

sessionInfo( )
R version 4.2.0 (2022-04-22 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)

Matrix products: default

[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] stats4    stats     graphics  grDevices utils     datasets  methods  
[8] base     

other attached packages:
 [1] Mus.musculus_1.3.1                       
 [2] TxDb.Mmusculus.UCSC.mm10.knownGene_3.10.0
 [4] GO.db_3.15.0                             
 [5] OrganismDbi_1.38.0                       
 [6] GenomicFeatures_1.48.0                   
 [7] GenomicRanges_1.48.0                     
 [8] GenomeInfoDb_1.32.1                      
 [9] AnnotationDbi_1.58.0                     
[10] IRanges_2.30.0                           
[11] S4Vectors_0.34.0                         
[12] Biobase_2.56.0                           
[13] BiocGenerics_0.42.0                      
[14] limma_3.52.0                             

loaded via a namespace (and not attached):
 [1] MatrixGenerics_1.8.0        httr_1.4.3                 
 [3] bit64_4.0.5                 assertthat_0.2.1           
 [5] BiocManager_1.30.18         BiocFileCache_2.4.0        
 [7] RBGL_1.72.0                 blob_1.2.3                 
 [9] GenomeInfoDbData_1.2.8      Rsamtools_2.12.0           
[11] yaml_2.3.5                  progress_1.2.2             
[13] pillar_1.7.0                RSQLite_2.2.13             
[15] lattice_0.20-45             glue_1.6.2                 
[17] digest_0.6.29               XVector_0.36.0             
[19] Matrix_1.4-1                XML_3.99-0.9               
[21] pkgconfig_2.0.3             biomaRt_2.52.0             
[23] zlibbioc_1.42.0             purrr_0.3.4                
[25] BiocParallel_1.30.0         tibble_3.1.6               
[27] KEGGREST_1.36.0             generics_0.1.2             
[29] ellipsis_0.3.2              cachem_1.0.6               
[31] SummarizedExperiment_1.26.0 cli_3.3.0                  
[33] magrittr_2.0.3              crayon_1.5.1               
[35] memoise_2.0.1               fansi_1.0.3                
[37] xml2_1.3.3                  graph_1.74.0               
[39] tools_4.2.0                 prettyunits_1.1.1          
[41] hms_1.1.1                   BiocIO_1.6.0               
[43] lifecycle_1.0.1             matrixStats_0.62.0         
[45] stringr_1.4.0               DelayedArray_0.22.0        
[47] Biostrings_2.64.0           compiler_4.2.0             
[49] rlang_1.0.2                 grid_4.2.0                 
[51] RCurl_1.98-1.6              rstudioapi_0.13            
[53] rjson_0.2.21                rappdirs_0.3.3             
[55] bitops_1.0-7                restfulr_0.0.13            
[57] DBI_1.1.2                   curl_4.3.2                 
[59] R6_2.5.1                    GenomicAlignments_1.32.0   
[61] dplyr_1.0.9                 rtracklayer_1.56.0         
[63] fastmap_1.1.0               bit_4.0.4                  
[65] utf8_1.2.2                  filelock_1.0.2             
[67] stringi_1.7.6               parallel_4.2.0             
[69] Rcpp_1.0.8.3                vctrs_0.4.1                
[71] png_0.1-7                   dbplyr_2.1.1               
[73] tidyselect_1.1.2
limma KEGGREST EGSEA • 1.3k views
Entering edit mode
Last seen 41 minutes ago
WEHI, Melbourne, Australia

Yes you're right, the move to https has caused the error. Just reinstall limma -- the issue is fixed in limma 3.52.2.

The issue is system and R version dependent. It depends on whether the system is tolerant of reading https as if it was http. In Windows, the issue only appears in R 4.2.X and not in R 4.1.X. In Linux, the issue doesn't appear at all. On the Mac, the issue appears even in R 4.1.X.

Entering edit mode

Thanks, Gordon! Not only for your speedy answer, but whatever fix you did in limma also fixed my own function that was calling KEGGREST functions directly.

Entering edit mode
shepherl 3.5k
Last seen 20 hours ago
United States

If you updated the KEGGREST package there was a PR to correct this as well in version 1.36.2


Login before adding your answer.

Traffic: 551 users visited in the last hour
Help About
Access RSS

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

Powered by the version 2.3.6