Error GC content and conservation visualization with Gviz
1
0
Entering edit mode
h • 0
@h-15802
Last seen 6.0 years ago

Hi,

I recently discovered the Gviz package, which I find extremely flexible and easy to use! 
I was wondering if somebody could help with two errors which I don't understand. They concern the following bit of code: 

chr <- 3
from <- 48938762 
to <- 49886319

gcContent <- UcscTrack(genome = "hg19", chromosome = paste0("chr", chr),
                       track = "GC Percent", table = "gc5Base", from = from,
                       to = to, trackType = "DataTrack", start = "start",
                       end = "end", data = "score", type = "hist", window = -1,
                       windowSize = 1500, fill.histogram = "black",
                       col.histogram = "black", ylim = c(30, 70), name = "GC Percent")

Error in UcscTrack(genome = "hg19", chromosome = paste0("chr", chr), track = "GC Percent",  : 
  Error fetching data from UCSC
In addition: Warning messages:
1: In matrix(as.numeric(unlist(split_lines)), nrow = 2) :
  NAs introduced by coercion
2: In matrix(as.numeric(unlist(split_lines)), nrow = 2) :
  data length [200005] is not a sub-multiple or multiple of the number of rows [2]
3: In UcscTrack(genome = "hg19", chromosome = paste0("chr", chr), track = "GC Percent",  :
  Error in .Call2("solve_user_SEW0", start, end, width, PACKAGE = "IRanges") : 
  solving row 100001: range cannot be determined from the supplied arguments (too many NAs)

conservation <- UcscTrack(genome = "hg19", chromosome = paste0("chr", chr),
                          track = "Conservation", table = "multiz100way",
                          from = from, to = to, trackType = "DataTrack",
                          start = "start", end = "end", # data = "score",
                          type = "hist", window = "auto", col.histogram = "darkblue",
                          fill.histogram = "darkblue", ylim = c(-3.7, 4),
                          name = "Conservation")
Error in UcscTrack(genome = "hg19", chromosome = paste0("chr", chr), track = "Conservation",  : 
  Error fetching data from UCSC
In addition: Warning message:
In UcscTrack(genome = "hg19", chromosome = paste0("chr", chr), track = "Conservation",  :
  Error in .local(object, ...) : No supported output types

For the GC content, I got no error when I used a smaller chunk, i.e., replacing in the above:

to <- 49100000

The "conservation" part produces an error anyway..

Any idea on why this happens and on how I could solve this?

Thanks!

 

> sessionInfo()
R version 3.4.3 (2017-11-30)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux Server 7.3 (Maipo)

Matrix products: default
BLAS: /Software/R/R-3.4.3-gcc/lib64/R/lib/libRblas.so
LAPACK: /Software/R/R-3.4.3-gcc/lib64/R/lib/libRlapack.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8       
 [4] LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
[10] LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
 [1] Homo.sapiens_1.3.1                      org.Hs.eg.db_3.5.0                     
 [3] GO.db_3.5.0                             OrganismDbi_1.20.0                     
 [5] BiocInstaller_1.28.0                    TxDb.Hsapiens.UCSC.hg19.knownGene_3.2.2
 [7] GenomicFeatures_1.30.3                  AnnotationDbi_1.40.0                   
 [9] Biobase_2.38.0                          Gviz_1.22.3                            
[11] GenomicRanges_1.30.3                    GenomeInfoDb_1.14.0                    
[13] IRanges_2.12.0                          S4Vectors_0.16.0                       
[15] BiocGenerics_0.24.0                    

loaded via a namespace (and not attached):
 [1] ProtGenerics_1.10.0           bitops_1.0-6                  matrixStats_0.53.1           
 [4] bit64_0.9-7                   RColorBrewer_1.1-2            progress_1.1.2               
 [7] httr_1.3.1                    tools_3.4.3                   backports_1.1.2              
[10] R6_2.2.2                      rpart_4.1-11                  Hmisc_4.1-1                  
[13] DBI_0.7                       lazyeval_0.2.1                colorspace_1.3-2             
[16] nnet_7.3-12                   gridExtra_2.3                 prettyunits_1.0.2            
[19] RMySQL_0.10.14                bit_1.1-12                    curl_3.1                     
[22] compiler_3.4.3                graph_1.56.0                  htmlTable_1.11.2             
[25] DelayedArray_0.4.1            rtracklayer_1.38.3            scales_0.5.0                 
[28] checkmate_1.8.5               RBGL_1.54.0                   stringr_1.2.0                
[31] digest_0.6.15                 Rsamtools_1.30.0              foreign_0.8-69               
[34] XVector_0.18.0                base64enc_0.1-3               dichromat_2.0-0              
[37] pkgconfig_2.0.1               htmltools_0.3.6               ensembldb_2.2.2              
[40] BSgenome_1.46.0               htmlwidgets_1.0               rlang_0.1.6                  
[43] rstudioapi_0.7                RSQLite_2.0                   shiny_1.0.5                  
[46] BiocParallel_1.12.0           acepack_1.4.1                 VariantAnnotation_1.24.5     
[49] RCurl_1.95-4.10               magrittr_1.5                  GenomeInfoDbData_1.0.0       
[52] Formula_1.2-2                 Matrix_1.2-12                 Rcpp_0.12.15                 
[55] munsell_0.4.3                 stringi_1.1.6                 yaml_2.1.16                  
[58] SummarizedExperiment_1.8.1    zlibbioc_1.24.0               plyr_1.8.4                   
[61] AnnotationHub_2.10.1          blob_1.1.0                    lattice_0.20-35              
[64] Biostrings_2.46.0             splines_3.4.3                 knitr_1.20                   
[67] pillar_1.1.0                  reshape2_1.4.3                biomaRt_2.34.2               
[70] XML_3.98-1.10                 biovizBase_1.26.0             latticeExtra_0.6-28          
[73] data.table_1.10.4-3           httpuv_1.3.5                  gtable_0.2.0                 
[76] assertthat_0.2.0              ggplot2_2.2.1                 mime_0.5                     
[79] xtable_1.8-2                  AnnotationFilter_1.2.0        survival_2.41-3              
[82] tibble_1.4.2                  GenomicAlignments_1.14.2      memoise_1.1.0                
[85] cluster_2.0.6                 interactiveDisplayBase_1.16.0
gviz gviz-package • 1.0k views
ADD COMMENT
0
Entering edit mode
Robert Ivanek ▴ 730
@robert-ivanek-5892
Last seen 5 months ago
Switzerland

Hi,

I believe it is caused by the fact that UCSC does not allow you to fetch large hunks of data (it is also mentioned in the rtracklayer vignette). Either you need to download the files from FTP and read them into Gviz or fetch the data in small chunks and combine afterwards. 

Best, Robert

ADD COMMENT

Login before adding your answer.

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