rtracklayer: error in importing bigwig file in r in windows
0
1
Entering edit mode
mzwanelen ▴ 10
@mzwanelen-22944
Last seen 12 months ago
Canada

I cant import bigwig file in r

Code: map_hg18 <- import("wgEncodeCrgMapabilityAlign100mer",format="BigWig")

Error: Error in seqinfo(ranges) : UCSC library operation failed In addition: Warning message: In seqinfo(ranges) : No such file or directory mustOpenFd: Can't open wgEncodeCrgMapabilityAlign100mer to read

Session info:

sessionInfo() R version 3.6.2 (2019-12-12) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 18362)

Matrix products: default

locale: [1] LCCOLLATE=EnglishUnited States.1252 LCCTYPE=EnglishUnited States.1252 LCMONETARY=EnglishUnited States.1252 [4] LCNUMERIC=C LCTIME=English_United States.1252

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

other attached packages: [1] Rsamtools2.2.3 BSgenome.Hsapiens.UCSC.hg181.3.1000 BSgenome1.54.0
[4] rtracklayer
1.46.0 Biostrings2.54.0 XVector0.26.0
[7] HiCDataHumanIMR901.6.0 HiTC1.30.0 GenomicRanges1.38.0
[10] GenomeInfoDb
1.22.0 IRanges2.20.2 S4Vectors0.24.3
[13] BiocGenerics_0.32.0

loaded via a namespace (and not attached): [1] zlibbioc1.32.0 GenomicAlignments1.22.1 BiocParallel1.20.1 lattice0.20-40
[5] tools3.6.2 SummarizedExperiment1.16.1 grid3.6.2 Biobase2.46.0
[9] matrixStats0.55.0 Matrix1.2-18 GenomeInfoDbData1.2.2 BiocManager1.30.10
[13] RColorBrewer1.1-2 bitops1.0-6 RCurl1.98-1.1 DelayedArray0.12.2
[17] compiler3.6.2 XML3.99-0.3

rtracklayer bigwig file • 1.9k views
ADD COMMENT
1
Entering edit mode

As far as I know, rtracklayer::import.bw() does not work on Windows OS.

ADD REPLY
0
Entering edit mode

No, it works on Windows:

> z <- import("hg38.phastCons4way.bw", which = GRanges("chr1:1-1e5"))
> z
GRanges object with 17794 ranges and 1 metadata column:
          seqnames    ranges strand |               score
             <Rle> <IRanges>  <Rle> |           <numeric>
      [1]     chr1     18871      * | 0.00800000037997961
      [2]     chr1     18872      * | 0.00400000018998981
      [3]     chr1     36851      * |                   0
      [4]     chr1     40856      * | 0.00100000004749745
      [5]     chr1     40857      * |  0.0020000000949949
      ...      ...       ...    ... .                 ...
  [17790]     chr1     71832      * |  0.0160000007599592
  [17791]     chr1     71833      * |  0.0149999996647239
  [17792]     chr1     71834      * |  0.0120000001043081
  [17793]     chr1     71835      * | 0.00700000021606684
  [17794]     chr1     98378      * |                   0
  -------
  seqinfo: 244 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] rtracklayer_1.46.0   GenomicRanges_1.38.0 GenomeInfoDb_1.22.0 
[4] IRanges_2.20.2       S4Vectors_0.24.3     BiocGenerics_0.32.0 

loaded via a namespace (and not attached):
 [1] matrixStats_0.55.0          lattice_0.20-38            
 [3] XML_3.99-0.3                Rsamtools_2.2.1            
 [5] Biostrings_2.54.0           GenomicAlignments_1.22.1   
 [7] bitops_1.0-6                grid_3.6.1                 
 [9] zlibbioc_1.32.0             XVector_0.26.0             
[11] Matrix_1.2-17               BiocParallel_1.20.1        
[13] tools_3.6.1                 Biobase_2.46.0             
[15] RCurl_1.98-1.1              DelayedArray_0.12.2        
[17] compiler_3.6.1              SummarizedExperiment_1.16.1
[19] GenomeInfoDbData_1.2.2     
> 
ADD REPLY
0
Entering edit mode

Awesome, thanks James! This didn't use to be the case, but I'm happy to hear that it works now. Looks like I need to remove warnings such as https://github.com/lcolladotor/derfinder/blob/master/R/loadCoverage.R#L222-L224 from my code.

ADD REPLY
0
Entering edit mode

I'm currently experiencing the same. I'm on rtracklayer version 1.53.1.

On ubuntu:

> import("https://rlbase-data.s3.amazonaws.com/coverage/SRX7671349_hg38.bw", which = GRanges("chr1:1e6-1.5e6"))
GRanges object with 11 ranges and 1 metadata column:
       seqnames          ranges strand |     score
          <Rle>       <IRanges>  <Rle> | <numeric>
   [1]     chr1 1000000-1014050      * |         0
   [2]     chr1 1014051-1014250      * |         1
   [3]     chr1 1014251-1110000      * |         0
   [4]     chr1 1110001-1110050      * |         1
   [5]     chr1 1110051-1110100      * |         0
   [6]     chr1 1110101-1110150      * |         1
   [7]     chr1 1110151-1472500      * |         0
   [8]     chr1 1472501-1472600      * |         1
   [9]     chr1 1472601-1472650      * |         0
  [10]     chr1 1472651-1472750      * |         1
  [11]     chr1 1472751-1500000      * |         0
  -------
  seqinfo: 455 sequences from an unspecified genome

On Windows

> import("https://rlbase-data.s3.amazonaws.com/coverage/SRX7671349_hg38.bw", which = GRanges("chr1:1e6-1.5e6"))
Error in seqinfo(con) : UCSC library operation failed
In addition: Warning message:
In seqinfo(con) :
  Couldn't open https://rlbase-data.s3.amazonaws.com/coverage/SRX7671349_hg38.bw
ADD REPLY
0
Entering edit mode

Hi,

rtracklayer::import.bw() is supposed to work on Windows nowadays, but well, I see that I still avoid it on several pieces of derfinder at https://github.com/lcolladotor/derfinder/search?q=windows.

Lately though, I've been using megadepth since Christopher Wilks provides binaries for it that work on Windows (and other OS). See https://github.com/LieberInstitute/megadepth or the Bioconductor landing page for more information.

Best, Leo

ADD REPLY
0
Entering edit mode

Are you sure your filename does not have an extension, like .bw?

ADD REPLY

Login before adding your answer.

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