RajLabMSSM / echoannot

echoverse module: Annotate fine-mapping results
2 stars 0 forks source link

roadmap error: `Cannot detect format (no extension found in file name)` #11

Closed bschilder closed 1 year ago

bschilder commented 1 year ago

Reprex

Code

topSNPs <- echodata::topSNPs_Nalls2019
  fullSS_path <- echodata::example_fullSS(dataset = "Nalls2019")

  res <- echolocatoR::finemap_locus(
    fullSS_path = fullSS_path,
    topSNPs = topSNPs,
    # results_dir = "/Desktop/res",
    locus = "BST1",
    dataset_name = "Nalls2019",
    fullSS_genome_build = "hg19",
    zoom = c("1x","4x"),
    bp_distance = 25000,
    n_causal = 5,
    force_new_finemap = TRUE,
    plot_types = c("simple","fancy","LD"),
    roadmap = TRUE,
    roadmap_query = "E053",
    # nott_epigenome = TRUE,
    # nott_show_placseq = TRUE,
    munged = TRUE)

Console output

 ROADMAP:: 1 annotation(s) identified that match: E053
Querying subset from Roadmap API: E053 - 1/1
Constructing GRanges query using min/max ranges across one or more chromosomes.
+ as_blocks=TRUE: Will query a single range per chromosome that covers all regions requested (plus anything in between).
Downloading Roadmap Chromatin Marks: E053
Preexisting file detected. Set force_overwrite=TRUE to override this.
Error in h(simpleError(msg, call)) : 
  error in evaluating the argument 'con' in selecting a method for function 'import': Cannot detect format (no extension found in file name)

Session info

``` R version 4.2.1 (2022-06-23) Platform: x86_64-apple-darwin17.0 (64-bit) Running under: macOS Monterey 12.4 Matrix products: default LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib locale: [1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] echolocatoR_2.0.1 snpStats_1.46.0 Matrix_1.4-1 survival_3.4-0 loaded via a namespace (and not attached): [1] rappdirs_0.3.3 rtracklayer_1.57.0 GGally_2.1.2 [4] R.methodsS3_1.8.2 ragg_1.2.2 tidyr_1.2.0 [7] echoLD_0.99.6 ggplot2_3.3.6 bit64_4.0.5 [10] knitr_1.40 irlba_2.3.5 DelayedArray_0.22.0 [13] R.utils_2.12.0 data.table_1.14.2 rpart_4.1.16 [16] KEGGREST_1.36.3 RCurl_1.98-1.8 AnnotationFilter_1.20.0 [19] generics_0.1.3 BiocGenerics_0.42.0 GenomicFeatures_1.48.3 [22] RSQLite_2.2.16 proxy_0.4-27 bit_4.0.4 [25] tzdb_0.3.0 xml2_1.3.3 SummarizedExperiment_1.26.1 [28] assertthat_0.2.1 viridis_0.6.2 gargle_1.2.0 [31] xfun_0.32 hms_1.1.2 evaluate_0.16 [34] fansi_1.0.3 restfulr_0.0.15 progress_1.2.2 [37] dbplyr_2.2.1 readxl_1.4.1 Rgraphviz_2.40.0 [40] igraph_1.3.4 DBI_1.1.3 htmlwidgets_1.5.4 [43] reshape_0.8.9 downloadR_0.99.4 stats4_4.2.1 [46] purrr_0.3.4 ellipsis_0.3.2 dplyr_1.0.9 [49] backports_1.4.1 biomaRt_2.52.0 deldir_1.0-6 [52] MatrixGenerics_1.8.1 MungeSumstats_1.5.9 vctrs_0.4.1 [55] Biobase_2.56.0 ensembldb_2.20.2 cachem_1.0.6 [58] BSgenome_1.64.0 checkmate_2.1.0 GenomicAlignments_1.32.1 [61] prettyunits_1.1.1 cluster_2.1.4 ape_5.6-2 [64] dir.expiry_1.4.0 lazyeval_0.2.2 crayon_1.5.1 [67] basilisk.utils_1.8.0 crul_1.2.0 labeling_0.4.2 [70] pkgconfig_2.0.3 GenomeInfoDb_1.32.3 nlme_3.1-159 [73] pkgload_1.3.0 ProtGenerics_1.28.0 XGR_1.1.8 [76] nnet_7.3-17 pals_1.7 rlang_1.0.4 [79] lifecycle_1.0.1 filelock_1.0.2 httpcode_0.3.0 [82] BiocFileCache_2.4.0 echotabix_0.99.7 dichromat_2.0-0.1 [85] cellranger_1.1.0 coloc_5.1.0.1 matrixStats_0.62.0 [88] graph_1.74.0 osfr_0.2.8 boot_1.3-28 [91] base64enc_0.1-3 png_0.1-7 viridisLite_0.4.1 [94] rjson_0.2.21 rootSolve_1.8.2.3 bitops_1.0-7 [97] R.oo_1.25.0 ggnetwork_0.5.10 Biostrings_2.64.1 [100] blob_1.2.3 mixsqp_0.3-43 stringr_1.4.1 [103] echoplot_0.99.4 dnet_1.1.7 readr_2.1.2 [106] jpeg_0.1-9 S4Vectors_0.34.0 echodata_0.99.12 [109] scales_1.2.1 memoise_2.0.1 magrittr_2.0.3 [112] plyr_1.8.7 hexbin_1.28.2 zlibbioc_1.42.0 [115] compiler_4.2.1 echoconda_0.99.7 BiocIO_1.6.0 [118] RColorBrewer_1.1-3 EnsDb.Hsapiens.v75_2.99.0 Rsamtools_2.12.0 [121] cli_3.3.0 XVector_0.36.0 echoannot_0.99.7 [124] patchwork_1.1.2 htmlTable_2.4.1 Formula_1.2-4 [127] MASS_7.3-58.1 tidyselect_1.1.2 stringi_1.7.8 [130] textshaping_0.3.6 yaml_2.3.5 supraHex_1.34.0 [133] latticeExtra_0.6-30 ggrepel_0.9.1 grid_4.2.1 [136] VariantAnnotation_1.42.1 tools_4.2.1 lmom_2.9 [139] parallel_4.2.1 rstudioapi_0.14 foreign_0.8-82 [142] piggyback_0.1.4 gridExtra_2.3 gld_2.6.5 [145] farver_2.1.1 RcppZiggurat_0.1.6 digest_0.6.29 [148] BiocManager_1.30.18 Rcpp_1.0.9 GenomicRanges_1.48.0 [151] OrganismDbi_1.38.1 httr_1.4.4 AnnotationDbi_1.58.0 [154] RCircos_1.2.2 ggbio_1.44.1 biovizBase_1.44.0 [157] colorspace_2.0-3 brio_1.1.3 XML_3.99-0.10 [160] fs_1.5.2 reticulate_1.25 IRanges_2.30.1 [163] splines_4.2.1 RBGL_1.72.0 expm_0.999-6 [166] seqminer_8.4 echofinemap_0.99.3 basilisk_1.8.1 [169] Exact_3.1 mapproj_1.2.8 systemfonts_1.0.4 [172] jsonlite_1.8.0 Rfast_2.0.6 testthat_3.1.4 [175] susieR_0.12.19 R6_2.5.1 Hmisc_4.7-1 [178] pillar_1.8.1 htmltools_0.5.3 glue_1.6.2 [181] fastmap_1.1.0 DT_0.24 BiocParallel_1.30.3 [184] class_7.3-20 codetools_0.2-18 maps_3.4.0 [187] mvtnorm_1.1-3 utf8_1.2.2 lattice_0.20-45 [190] tibble_3.1.8 curl_4.3.2 DescTools_0.99.45 [193] zip_2.2.0 openxlsx_4.2.5 interp_1.1-3 [196] rmarkdown_2.16 googleAuthR_2.0.0 munsell_0.5.0 [199] e1071_1.7-11 GenomeInfoDbData_1.2.8 reshape2_1.4.4 [202] gtable_0.3.0 ```
bschilder commented 1 year ago

This is due to a bug in rtracklayer. I've reached out to the maintainers to try and get it fixed but no response so far: https://github.com/lawremi/rtracklayer/issues/76

Given this, some options are:

  1. Download the entire bed.gz file every time a query is made (highly inefficient but should work)
  2. Find an alternative distribution of Roadmap annotations (eg. AnnotationHub) and rewrite echoannot functions accordingly.
bschilder commented 1 year ago

Just implemented workaround 1 (plus some custom bed import scripts that avoid issues with any NAs in the bed file), that doesn't use rtracklayer.