The code below worked for 'hg19', but returned an error for 'hg38', indicating that hg38 is not available.
Is there a different way of accessing hg38, or is it just not supported?
> targetTrack = with(targets_df, GRangesForUCSCGenome("hg38", "chr16", ranges, "+", "CDH13"))
Error in GRangesForGenome(genome, chrom = chrom, ranges = ranges, method = "UCSC",  : 
  Failed to obtain information for genome 'hg38'
hg38 does exist in the list of genomes from rtracklayer
> df = rtracklayer::ucscGenomes()
> filter(df, species == "Human")
    db species      date                                                                     name
1 hg16   Human July 2003                                                            NCBI Build 34
2 hg17   Human  May 2004                                                            NCBI Build 35
3 hg18   Human Mar. 2006                                                          NCBI Build 36.1
4 hg19   Human Feb. 2009  GRCh37 Genome Reference Consortium Human Reference 37 (GCA_000001405.1)
5 hg38   Human Dec. 2013 GRCh38 Genome Reference Consortium Human Reference 38 (GCA_000001405.15)
> sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.6 LTS
Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /opt/intel/compilers_and_libraries_2020.0.166/linux/mkl/lib/intel64_lin/libmkl_rt.so
locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8   
 [6] LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
attached base packages:
[1] parallel  stats4    stats     graphics  grDevices utils     datasets  methods   base     
other attached packages:
 [1] forcats_0.5.1        stringr_1.4.0        dplyr_1.0.7          purrr_0.3.4          readr_2.0.2          tidyr_1.1.4          tibble_3.1.5        
 [8] ggplot2_3.3.5        tidyverse_1.3.1      rtracklayer_1.52.1   GenomicRanges_1.44.0 GenomeInfoDb_1.28.4  IRanges_2.26.0       S4Vectors_0.30.2    
[15] BiocGenerics_0.38.0 
loaded via a namespace (and not attached):
 [1] bitops_1.0-7                matrixStats_0.61.0          fs_1.5.0                    usethis_2.1.3               lubridate_1.8.0            
 [6] httr_1.4.2                  rprojroot_2.0.2             tools_4.1.2                 backports_1.3.0             utf8_1.2.2                 
[11] R6_2.5.1                    DBI_1.1.1                   colorspace_2.0-2            withr_2.4.2                 tidyselect_1.1.1           
[16] compiler_4.1.2              cli_3.1.0                   rvest_1.0.2                 Biobase_2.52.0              xml2_1.3.2                 
[21] desc_1.4.0                  DelayedArray_0.18.0         scales_1.1.1                Rsamtools_2.8.0             XVector_0.32.0             
[26] pkgconfig_2.0.3             sessioninfo_1.1.1           MatrixGenerics_1.4.3        dbplyr_2.1.1                rlang_0.4.12               
[31] readxl_1.3.1                rstudioapi_0.13             BiocIO_1.2.0                generics_0.1.1              jsonlite_1.7.2             
[36] BiocParallel_1.26.2         RCurl_1.98-1.5              magrittr_2.0.1              GenomeInfoDbData_1.2.6      Matrix_1.3-4               
[41] Rcpp_1.0.7                  munsell_0.5.0               fansi_0.5.0                 lifecycle_1.0.1             stringi_1.7.5              
[46] whisker_0.4                 yaml_2.2.1                  SummarizedExperiment_1.22.0 zlibbioc_1.38.0             grid_4.1.2                 
[51] crayon_1.4.1                lattice_0.20-45             Biostrings_2.60.2           haven_2.4.3                 hms_1.1.1                  
[56] knitr_1.36                  pillar_1.6.4                rjson_0.2.20                reprex_2.0.1                XML_3.99-0.8               
[61] glue_1.4.2                  BiocManager_1.30.16         modelr_0.1.8                vctrs_0.3.8                 tzdb_0.2.0                 
[66] cellranger_1.1.0            gtable_0.3.0                assertthat_0.2.1            xfun_0.27                   broom_0.7.9                
[71] restfulr_0.0.13             roxygen2_7.1.2              GenomicAlignments_1.28.0    ellipsis_0.3.2
                    
                
                
I am trying to follow the rtracklayer vignette. The object setup is everything before section 2.2, but it is section 2.2 which describes how to launch the UCSC browser.
The annotations themselves are imported using
rtracklayer::import()from gencode38.here is what each of the objects look like:
This works -- no errors, and it launches the UCSC browser correctly:
This does not work:
With the following error:
The
withfunction is intended to be used in the case where you have a bunch of data in an object and you want to simplify operations on it. As an example:If you have a
DataFramethat has a bunch of stuff in it and you are not planning on using those data for anything, then usingwithin that context is not useful and possibly problematic. In other words, there is nothing in your targets_df object that you are extracting, so you don't need to do what you are doing.Anyway, the error you see has nothing to do with any of that. It's coming from
rtracklayer:::GRangesForGenome, where it is trying to get theSeqinfofor hg38. Basically what happens is this:What happens when you do that?