RajLabMSSM / echolocatoR

Automated statistical and functional fine-mapping pipeline with extensive API access to datasets.
https://rajlabmssm.github.io/echolocatoR
MIT License
34 stars 11 forks source link

echofinemap missing functions - Installation issues #101

Closed AMCalejandro closed 2 years ago

AMCalejandro commented 2 years ago

Hi,

Problem description

Keeping an eye on the echofinemap non-zero exit status from #100, I am missing some functions to run polyfun_sussie, making finemap_loci fail

Code example

I have tried to run finemap_loci within the echoverse

  echolocatoR::finemap_loci(top_SNPs = top_SNPs, loci = top_SNPs$Locus,
                dataset_name = study_name, dataset_type = study_type,
                force_new_subset = F, force_new_LD = T,
                force_new_finemap = T, remove_tmps = F,

               # SUMMARY STATS ARGUMENTS
               fullSS_genome_build = build,
               fullSS_path = .metadata[2], results_dir = .metadata[1], query_by = "tabix",
               chrom_col = "CHR", position_col = "POS", snp_col = "SNP",
               pval_col = "Pval", effect_col = "Effect", stderr_col = "StdErr",
               freq_col = "Freq1", MAF_col = "calculate",
               A1_col = "Allele1", A2_col = "Allele2",
               #N_cases_col = "TotalSampleSize",
               #N_controls = 0,

               # FILTERING ARGUMENTS
               ## It's often desirable to use a larger window size
               ## (e.g. 2Mb which is bp_distance=500000*2),
               ## but we use a small window here to speed up the process.
               bp_distance = 500000*2,
               min_MAF = 0.001,
               trim_gene_limits = F,
               # FINE-MAPPING ARGUMENTS
               ## General
               finemap_methods = finemap_tools,
               n_causal = 5,
               PP_threshold = .95,
               consensus_threshold = 2,
               # LD ARGUMENTS
               LD_genome_build = build,
               LD_reference = ld_ref,
               superpopulation = "EUR",
               download_method = "axel",

              # Additional arguments - My arguments
              case_control = F,
              nThread = 15,
              sample_size = mean_SS,

              # PLOT ARGUMENTS
              ## general
              plot.types = c("fancy"),
              server = T,
              ## Generate multiple plots of different window sizes;
              ### all SNPs, 4x zoomed-in, and a 50000bp window
              plot.zoom = c("All", "1x","4x","10x"),
              verbose = TRUE,
              # ENVIRONMENT ARGS
              conda_env= "echoverse" )

Probably due to installation issues with echofinemap, the finemap_loci function from echolocatoR is failing at the very beginning trying to run:

if(any(grepl("polyfun",finemap_methods, ignore.case = TRUE))){ echofinemap:::POLYFUN_install() }

The output

image

My session info

> sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-conda-linux-gnu (64-bit)
Running under: Ubuntu 20.04.4 LTS

Matrix products: default
BLAS/LAPACK: /home/acarrasco/.conda/envs/echoverse/lib/libopenblasp-r0.3.18.so

locale:
 [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C
 [3] 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
 [7] LC_PAPER=en_GB.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C

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

other attached packages:
 [1] SNPlocs.Hsapiens.dbSNP144.GRCh37_0.99.20
 [2] BSgenome_1.62.0
 [3] rtracklayer_1.54.0
 [4] Biostrings_2.62.0
 [5] XVector_0.34.0
 [6] GenomicRanges_1.46.1
 [7] GenomeInfoDb_1.30.1
 [8] IRanges_2.28.0
 [9] S4Vectors_0.32.4
[10] BiocGenerics_0.40.0
[11] colochelpR_0.99.0
[12] here_1.0.1
[13] rlang_1.0.5
[14] forcats_0.5.2
[15] stringr_1.4.1
[16] dplyr_1.0.10
[17] purrr_0.3.4
[18] readr_2.1.2
[19] tidyr_1.2.0
[20] tibble_3.1.8
[21] ggplot2_3.3.6
[22] tidyverse_1.3.1
[23] data.table_1.14.2
[24] echolocatoR_2.0.0

loaded via a namespace (and not attached):
  [1] utf8_1.2.2                  reticulate_1.26
  [3] R.utils_2.12.0              tidyselect_1.1.2
  [5] RSQLite_2.2.16              AnnotationDbi_1.56.2
  [7] htmlwidgets_1.5.4           grid_4.1.2
  [9] BiocParallel_1.28.3         XGR_1.1.8
 [11] munsell_0.5.0               interp_1.1-3
 [13] DT_0.24                     withr_2.5.0
 [15] colorspace_2.0-3            OrganismDbi_1.36.0
 [17] Biobase_2.54.0              filelock_1.0.2
 [19] knitr_1.40                  supraHex_1.32.0
 [21] rstudioapi_0.14             DescTools_0.99.46
 [23] MatrixGenerics_1.6.0        GenomeInfoDbData_1.2.7
 [25] mixsqp_0.3-43               bit64_4.0.5
 [27] echoconda_0.99.6            rprojroot_2.0.3
 [29] basilisk_1.6.0              vctrs_0.4.1
 [31] generics_0.1.3              xfun_0.32
 [33] biovizBase_1.42.0           BiocFileCache_2.2.1
 [35] R6_2.5.1                    AnnotationFilter_1.18.0
 [37] bitops_1.0-7                cachem_1.0.6
 [39] reshape_0.8.9               DelayedArray_0.20.0
 [41] assertthat_0.2.1            BiocIO_1.4.0
 [43] scales_1.2.1                nnet_7.3-17
 [45] rootSolve_1.8.2.3           gtable_0.3.1
 [47] lmom_2.9                    ggbio_1.42.0
 [49] ensembldb_2.18.4            MungeSumstats_1.5.13
 [51] echodata_0.99.12            splines_4.1.2
 [53] lazyeval_0.2.2              gargle_1.2.0
 [55] dichromat_2.0-0.1           hexbin_1.28.2
 [57] broom_0.7.12                checkmate_2.1.0
 [59] modelr_0.1.8                BiocManager_1.30.18
 [61] yaml_2.3.5                  reshape2_1.4.4
 [63] snpStats_1.44.0             GenomicFeatures_1.46.5
 [65] ggnetwork_0.5.10            backports_1.4.1
 [67] Hmisc_4.7-1                 RBGL_1.70.0
 [69] echoplot_0.99.3             ellipsis_0.3.2
 [71] RColorBrewer_1.1-3          proxy_0.4-27
 [73] coloc_5.2.0                 Rcpp_1.0.9
 [75] plyr_1.8.7                  base64enc_0.1-3
 [77] progress_1.2.2              zlibbioc_1.40.0
 [79] RCurl_1.98-1.8              basilisk.utils_1.6.0
 [81] prettyunits_1.1.1           rpart_4.1.16
 [83] deldir_1.0-6                viridis_0.6.2
 [85] haven_2.4.3                 SummarizedExperiment_1.24.0
 [87] ggrepel_0.9.1               cluster_2.1.2
 [89] fs_1.5.2                    crul_1.3
 [91] magrittr_2.0.3              echotabix_0.99.7
 [93] dnet_1.1.7                  openxlsx_4.2.5
 [95] reprex_2.0.1                mvtnorm_1.1-3
 [97] ProtGenerics_1.26.0         matrixStats_0.62.0
 [99] patchwork_1.1.2             hms_1.1.2
[101] XML_3.99-0.10               jpeg_0.1-9
[103] readxl_1.4.1                gridExtra_2.3
[105] compiler_4.1.2              biomaRt_2.50.3
[107] crayon_1.5.1                R.oo_1.25.0
[109] htmltools_0.5.3             echoannot_0.99.7
[111] tzdb_0.3.0                  Formula_1.2-4
[113] expm_0.999-6                Exact_3.1
[115] lubridate_1.8.0             DBI_1.1.3
[117] dbplyr_2.2.1                MASS_7.3-56
[119] rappdirs_0.3.3              boot_1.3-28
[121] Matrix_1.4-1                piggyback_0.1.4
[123] cli_3.3.0                   R.methodsS3_1.8.2
[125] echofinemap_0.99.0          parallel_4.1.2
[127] igraph_1.3.4                pkgconfig_2.0.3
[129] GenomicAlignments_1.30.0    dir.expiry_1.2.0
[131] RCircos_1.2.2               foreign_0.8-82
[133] osfr_0.2.8                  xml2_1.3.3
[135] rvest_1.0.2                 echoLD_0.99.1
[137] VariantAnnotation_1.40.0    digest_0.6.29
[139] graph_1.72.0                httpcode_0.3.0
[141] cellranger_1.1.0            htmlTable_2.4.1
[143] gld_2.6.5                   restfulr_0.0.15
[145] curl_4.3.2                  Rsamtools_2.10.0
[147] rjson_0.2.21                lifecycle_1.0.1
[149] nlme_3.1-157                jsonlite_1.8.0
[151] viridisLite_0.4.1           fansi_1.0.3
[153] susieR_0.12.19              pillar_1.8.1
[155] lattice_0.20-45             GGally_2.1.2
[157] googleAuthR_2.0.0           KEGGREST_1.34.0
[159] fastmap_1.1.0               httr_1.4.4
[161] survival_3.3-1              glue_1.6.2
[163] zip_2.2.0                   png_0.1-7
[165] bit_4.0.4                   Rgraphviz_2.38.0
[167] class_7.3-20                stringi_1.7.8
[169] blob_1.2.3                  latticeExtra_0.6-30
[171] memoise_2.0.1               irlba_2.3.5
[173] e1071_1.7-11                ape_5.6-2
bschilder commented 2 years ago

I think this is indeed because not all the echoverse subpackages have been updated on your machine (echofinemap specifically).

Also, looks like you're using an example from echolocatoR v1.0. Please use the new example from the new documentation as some arguments have changed: at the bottom of ?echolocatoR::finemap_loci

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

res <- echolocatoR::finemap_loci(
  fullSS_path = fullSS_path,
  topSNPs = topSNPs,
  loci = c("BST1","MEX3C"),
  finemap_methods = c("ABF","FINEMAP","SUSIE"),
  dataset_name = "Nalls23andMe_2019",
  fullSS_genome_build = "hg19",
  bp_distance = 10000,
  munged = TRUE)