[BUG report] rtracklayer cannot handle whitespaces in file names
2
0
Entering edit mode
balwierz ▴ 40
@balwierz-8583
Last seen 4.8 years ago
United Kingdom

Since after 10 min of googling I still cannot find the bug tracking system for bioconductor I am posting a bug report here. The problem is import function calls parseURI on file names:

   library(rtracklayer)
   import.bed("my bed file.bed")
Error in parseURI(uri) : cannot parse URI my bed file.bed
   traceback()
12: .Call("R_parseURI", as.character(uri), PACKAGE = "XML")
11: parseURI(uri)
10: .parseURI(resource)
9: connectionForResource(resource)
8: queryForConnection(con, which)
7: .local(con, format, text, ...)
6: import(FileForFormat(con, format), ...)
5: import(FileForFormat(con, format), ...)
4: import(con, format = "bed", ...)
3: import(con, format = "bed", ...)
2: import.bed("my bed file.bed")
1: import.bed("my bed file.bed")


sessionInfo()
R version 3.2.1 (2015-06-18)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux stretch/sid

locale:
 [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C               LC_TIME=en_GB.UTF-8        LC_COLLATE=en_GB.UTF-8    
 [5] LC_MONETARY=en_GB.UTF-8    LC_MESSAGES=en_GB.UTF-8    LC_PAPER=en_GB.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
 [1] XML_3.98-1.3                       BSgenome.Drerio.UCSC.danRer7_1.4.0 BSgenome_1.36.3                   
 [4] Biostrings_2.36.2                  XVector_0.8.0                      gplots_2.17.0                     
 [7] rtracklayer_1.28.7                 GenomicRanges_1.20.5               GenomeInfoDb_1.4.1                
[10] IRanges_2.2.7                      S4Vectors_0.6.3                    BiocGenerics_0.14.0               
[13] genomation_1.1.10                  BiocParallel_1.2.20                colorout_1.1-0                    
[16] BiocInstaller_1.18.4              

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.0             futile.logger_1.4.1     plyr_1.8.3              bitops_1.0-6            futile.options_1.0.0   
 [6] tools_3.2.1             zlibbioc_1.14.0         digest_0.6.8            RSQLite_1.0.0           gtable_0.1.2           
[11] gridBase_0.4-7          DBI_0.3.1               proto_0.3-10            stringr_1.0.0           caTools_1.17.1         
[16] gtools_3.5.0            data.table_1.9.4        impute_1.42.0           plotrix_3.5-12          gdata_2.17.0           
[21] ggplot2_1.0.1           reshape2_1.4.1          readr_0.1.1             lambda.r_1.1.7          magrittr_1.5           
[26] matrixStats_0.14.2      Rsamtools_1.20.4        scales_0.2.5            GenomicAlignments_1.4.1 MASS_7.3-43            
[31] colorspace_1.2-6        KernSmooth_2.23-15      stringi_0.5-5           RCurl_1.95-4.7          munsell_0.4.2          
[36] chron_2.3-47          
software error rtracklayer • 1.3k views
ADD COMMENT
1
Entering edit mode
@michael-lawrence-3846
Last seen 2.4 years ago
United States

I have fixed this, just testing now. Should be checked in release/devel sometime this morning.

ADD COMMENT
0
Entering edit mode

Got distracted, but it's now on its way as 1.28.8 in release.

ADD REPLY
0
Entering edit mode
@valerie-obenchain-4275
Last seen 2.3 years ago
United States

Hi,

It looks like the spaces in the file name is the problem. The argument to parseURI()  must be a single string with no spaces (see ?parseURI). The error can be reproduced with

library(XML)

parseURI("my bed file.bed")

 

Valerie

ADD COMMENT
0
Entering edit mode

Well, I know THAT. The point is import function calls parseURI on strings which are likely not to be URIs.

ADD REPLY

Login before adding your answer.

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