rtracklayer::import() BigWig issue on windows (solved)
1
0
Entering edit mode
lsilva.m • 0
@lsilvam-23172
Last seen 4.7 years ago

Hello everyone,

I am having a problem here trying to import a BigWig - from what I could find so far its seems that this function does not ran in windows. if that is the case, what alternatives do I have to import BigWig?

The error is this one

Error in .local(con, format, text, ...) : UCSC library operation failed In addition: Warning message: In .local(con, format, text, ...) : Invalid argument lseek(5, 421489092, invalid 'whence' value (551224928)) failed

The code I ran is below.

Thank you very much,

Be safe, Leonardo

library(rtracklayer)
library(AnnotationHub)

ahub <- AnnotationHub() # snapshotDate() 2019-10-29

qahub <- query(ahub,c('H3K27me3', 'E003','fc.signal'))

fc <- qahub[[1]] 

which <- GRanges(seqnames = "chr22", ranges=IRanges(1,51304566)) # size chr22 = 51304566

rtracklayer::import(fc, which = which)
sessionInfo()

*R version 3.6.3 (2020-02-29)
Platform: i386-w64-mingw32/i386 (32-bit)
Running under: Windows 10 x64 (build 18363)
 Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    
attached base packages:
[1] parallel  stats4    stats     graphics  grDevices utils     datasets  methods   base     
 other attached packages:
[1] AnnotationHub_2.18.0 BiocFileCache_1.10.2 dbplyr_1.4.2         rtracklayer_1.46.0  
[5] GenomicRanges_1.38.0 GenomeInfoDb_1.22.0  IRanges_2.20.2       S4Vectors_0.24.3    
[9] BiocGenerics_0.32.0 
 loaded via a namespace (and not attached):
 [1] rstudioapi_0.11               magrittr_1.5                  GenomicFeatures_1.38.2       
[4] vctrs_0.2.4                   zlibbioc_1.32.0               memoise_1.1.0                
[7] Rsamtools_2.2.3               hms_0.5.3                     RCurl_1.98-1.1               
[10] XVector_0.26.0                askpass_1.1                   htmltools_0.4.0              
[13] pillar_1.4.3                  BiocVersion_3.10.1            progress_1.2.2               
[16] stringr_1.4.0                 curl_4.3                      later_1.0.0                  
[19] dplyr_0.8.5                   lattice_0.20-38               bit_1.1-15.2                 
[22] tidyselect_1.0.0              Biostrings_2.54.0             GenomicAlignments_1.22.1     
 [25] mime_0.9                      pkgconfig_2.0.3               fastmap_1.0.1                
 [28] Matrix_1.2-18                 R6_2.4.1                      shiny_1.4.0.2                
[31] GenomeInfoDbData_1.2.2        SummarizedExperiment_1.16.1   digest_0.6.25                
 [34] Biobase_2.46.0                AnnotationDbi_1.48.0          matrixStats_0.56.0           
[37] stringi_1.4.6                 yaml_2.2.1                    RSQLite_2.2.0                
[40] tibble_2.1.3                  httr_1.4.1                    compiler_3.6.3               
[43] BiocManager_1.30.10           bit64_0.9-7                   xtable_1.8-4                 
 [46] BiocParallel_1.20.1           DBI_1.1.0                     Rcpp_1.0.4.4                 
 [49] biomaRt_2.42.1                XML_3.99-0.3                  openssl_1.4.1                
 [52] rappdirs_0.3.1                assertthat_0.2.1              blob_1.2.1                   
 [55] DelayedArray_0.12.2           prettyunits_1.1.1             tools_3.6.3                  
 [58] bitops_1.0-6                  interactiveDisplayBase_1.24.0 httpuv_1.5.2                 
 [61] packrat_0.5.0                 crayon_1.3.4                  glue_1.3.2                   
 [64] purrr_0.3.3                   rlang_0.4.5                   promises_1.1.0               
 [67] grid_3.6.3*

edit: error message

software error BigWig import windows • 2.1k views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 2 hours ago
United States

Seems to work for me:

> fc
BigWigFile object
resource: C:\Users\jmacdon\AppData\Local\AnnotationHub\AnnotationHub\Cache/166062c96e63_37473 
> rtracklayer::import(fc, which = which)
GRanges object with 1788633 ranges and 1 metadata column:
            seqnames            ranges strand |             score
               <Rle>         <IRanges>  <Rle> |         <numeric>
        [1]    chr22        1-16050592      * |                 0
        [2]    chr22 16050593-16050706      * | 0.812409996986389
        [3]    chr22 16050707-16051095      * |                 0
        [4]    chr22 16051096-16051173      * | 0.812409996986389
        [5]    chr22 16051174-16051209      * |  1.62481999397278
        ...      ...               ...    ... .               ...
  [1788629]    chr22 51238963-51238970      * | 0.510420024394989
  [1788630]    chr22 51238971-51240804      * |                 0
  [1788631]    chr22 51240805-51240881      * | 0.812409996986389
  [1788632]    chr22 51240882-51240918      * |  1.62481999397278
  [1788633]    chr22 51240919-51240995      * | 0.812409996986389
  -------
  seqinfo: 25 sequences from an unspecified genome
> sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18362)

Matrix products: default

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

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

other attached packages:
[1] AnnotationHub_2.18.0 BiocFileCache_1.10.2 dbplyr_1.4.2        
[4] rtracklayer_1.46.0   GenomicRanges_1.38.0 GenomeInfoDb_1.22.0 
[7] IRanges_2.20.2       S4Vectors_0.24.3     BiocGenerics_0.32.0 

loaded via a namespace (and not attached):
 [1] SummarizedExperiment_1.16.1   tidyselect_1.0.0             
 [3] BiocVersion_3.10.1            purrr_0.3.3                  
 [5] lattice_0.20-38               vctrs_0.2.2                  
 [7] htmltools_0.4.0               yaml_2.2.1                   
 [9] interactiveDisplayBase_1.24.0 blob_1.2.1                   
[11] XML_3.99-0.3                  rlang_0.4.4                  
[13] pillar_1.4.3                  later_1.0.0                  
[15] glue_1.3.1                    DBI_1.1.0                    
[17] BiocParallel_1.20.1           rappdirs_0.3.1               
[19] bit64_0.9-7                   matrixStats_0.55.0           
[21] GenomeInfoDbData_1.2.2        zlibbioc_1.32.0              
[23] Biostrings_2.54.0             memoise_1.1.0                
[25] Biobase_2.46.0                fastmap_1.0.1                
[27] httpuv_1.5.2                  curl_4.3                     
[29] AnnotationDbi_1.48.0          Rcpp_1.0.3                   
[31] xtable_1.8-4                  promises_1.1.0               
[33] BiocManager_1.30.10           DelayedArray_0.12.2          
[35] XVector_0.26.0                mime_0.8                     
[37] bit_1.1-15.1                  Rsamtools_2.2.1              
[39] digest_0.6.23                 dplyr_0.8.4                  
[41] shiny_1.4.0                   grid_3.6.1                   
[43] tools_3.6.1                   bitops_1.0-6                 
[45] magrittr_1.5                  RCurl_1.98-1.1               
[47] tibble_2.1.3                  RSQLite_2.2.0                
[49] crayon_1.3.4                  pkgconfig_2.0.3              
[51] Matrix_1.2-17                 assertthat_0.2.1             
[53] httr_1.4.1                    R6_2.4.1                     
[55] GenomicAlignments_1.22.1      compiler_3.6.1               
> 

Maybe there is a problem with what you downloaded?

> system("md5sum C:/Users/jmacdon/AppData/Local/AnnotationHub/AnnotationHub/Cache/166062c96e63_37473")
94cb511aee2b74cd7f4bc2e8eda2126f 

Maybe compare md5sums?

ADD COMMENT
0
Entering edit mode

Hello James,

I just figured out what was the issue, and your sessions allowed me to double-check it. So, thank you!

I thought that the problem would be the platform; and went to check the Global options, and indeed the default was the

Platform: i386-w64-mingw32/i386 (32-bit)

Yet, I have no idea why R studio make the 32-bit by default, and why the code doesn't ran on that platform.

Anyway, now its working!

Thank you again o/

Keep safe So I changed to 64-bits, like you and it worked:

Platform: x86_64-w64-mingw32/x64 (64-bit)
ADD REPLY
0
Entering edit mode

Ah, I didn't even look at the platform bitsize. I don't use Rstudio, so had no idea it was doing something inadvisable like that.

ADD REPLY
0
Entering edit mode

yeah, I am somewhat surprised that this happened. Now I hope to have less issues. And also running as admin helped me with other issues - when I tried to install packages they failed because the " path was not writable"

ADD REPLY
0
Entering edit mode

The correct solution is to install and use R as a regular user. This is painful initially (because you have to re-install existing packages) but better in the long run -- it is a grave security risk to run programs as admin.

ADD REPLY

Login before adding your answer.

Traffic: 717 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