library(echoLD)

data("BST1"); data("locus_dir");

BST1 <- BST1[seq(1,100),]
locus_dir <- file.path(tempdir(), locus_dir)

1000 Genomes: Phase 1 or 3

LD_1kgp3 <- load_or_create(locus_dir = locus_dir,
                           dat = BST1, 
                           LD_reference = "1KGphase3") # 1KGphase1
## echoLD:: Using 1000Genomes as LD reference panel.
## LD Reference Panel = 1KGphase3
## + echoLD:: Querying 1KG remote server.
## LD:: Querying VCF file.
## Removing non-overlapping SNPs.
## Time difference of 35.8 secs
## Saving VCF subset ==> /var/folders/zq/h7mtybc533b1qzkys_ttgpth0000gn/T//RtmpL5vJbU/results/GWAS/Nalls23andMe_2019/BST1/LD/BST1.1kgphase3.vcf.bgz
## Returning VCF with 100 SNPs across 2,504 samples.
## echoLD::snpStats:: `MAF` column already present.
## LD:snpStats:: Computing pairwise LD between 2,504 SNPs across 100 individuals (stats = R).
## Time difference of 0.1 secs
## + echoLD:: Saving LD matrix ==> /var/folders/zq/h7mtybc533b1qzkys_ttgpth0000gn/T//RtmpL5vJbU/results/GWAS/Nalls23andMe_2019/BST1/LD/BST1.1KGphase3_LD.RDS
## 100 x 100 LD_matrix (sparse)

UK Biobank

WARNING: Takes substantially longer than 1000 Genomes methods.

LD_ukb <- load_or_create(locus_dir = locus_dir,
                         dat = BST1, 
                         LD_reference = "UKB", 
                         download_method = "axel", 
                         nThread = 10)

Custom VCF

LD_reference <- system.file("extdata","BST1.1KGphase3.vcf.bgz", package = "echoLD")
LD_custom <- load_or_create(locus_dir = locus_dir,
                            dat = BST1, 
                            LD_reference = LD_reference)

Session Info

utils::sessionInfo()
## R version 4.1.0 (2021-05-18)
## Platform: x86_64-apple-darwin17.0 (64-bit)
## Running under: macOS Big Sur 10.16
## 
## Matrix products: default
## BLAS:   /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRblas.dylib
## LAPACK: /Library/Frameworks/R.framework/Versions/4.1/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] snpStats_1.42.0  Matrix_1.3-4     survival_3.2-13  echoLD_0.99.0   
## [5] BiocStyle_2.20.2
## 
## loaded via a namespace (and not attached):
##   [1] bitops_1.0-7                matrixStats_0.60.1         
##   [3] fs_1.5.0                    bit64_4.0.5                
##   [5] gaston_1.5.7                filelock_1.0.2             
##   [7] progress_1.2.2              httr_1.4.2                 
##   [9] rprojroot_2.0.2             GenomeInfoDb_1.28.2        
##  [11] tools_4.1.0                 bslib_0.2.5.1              
##  [13] utf8_1.2.2                  R6_2.5.1                   
##  [15] DBI_1.1.1                   BiocGenerics_0.38.0        
##  [17] tidyselect_1.1.1            prettyunits_1.1.1          
##  [19] curl_4.3.2                  bit_4.0.4                  
##  [21] compiler_4.1.0              textshaping_0.3.5          
##  [23] Biobase_2.52.0              xml2_1.3.2                 
##  [25] desc_1.3.0                  DelayedArray_0.18.0        
##  [27] rtracklayer_1.52.1          bookdown_0.23              
##  [29] sass_0.4.0                  rappdirs_0.3.3             
##  [31] pkgdown_1.6.1               systemfonts_1.0.2          
##  [33] stringr_1.4.0               digest_0.6.27              
##  [35] Rsamtools_2.8.0             rmarkdown_2.10             
##  [37] R.utils_2.10.1              XVector_0.32.0             
##  [39] pkgconfig_2.0.3             htmltools_0.5.2            
##  [41] sparseMatrixStats_1.4.2     MatrixGenerics_1.4.3       
##  [43] BSgenome_1.60.0             dbplyr_2.1.1               
##  [45] fastmap_1.1.0               rlang_0.4.11               
##  [47] RSQLite_2.2.8               BiocIO_1.2.0               
##  [49] jquerylib_0.1.4             generics_0.1.0             
##  [51] adjclust_0.6.3              jsonlite_1.7.2             
##  [53] echoconda_0.99.0            BiocParallel_1.26.2        
##  [55] dplyr_1.0.7                 R.oo_1.24.0                
##  [57] VariantAnnotation_1.38.0    RCurl_1.98-1.4             
##  [59] magrittr_2.0.1              GenomeInfoDbData_1.2.6     
##  [61] Rcpp_1.0.7                  S4Vectors_0.30.0           
##  [63] fansi_0.5.0                 reticulate_1.20            
##  [65] lifecycle_1.0.0             R.methodsS3_1.8.1          
##  [67] stringi_1.7.4               yaml_2.2.1                 
##  [69] MASS_7.3-54                 SummarizedExperiment_1.22.0
##  [71] zlibbioc_1.38.0             BiocFileCache_2.0.0        
##  [73] grid_4.1.0                  blob_1.2.2                 
##  [75] parallel_4.1.0              crayon_1.4.1               
##  [77] LDlinkR_1.1.2               lattice_0.20-44            
##  [79] splines_4.1.0               Biostrings_2.60.2          
##  [81] GenomicFeatures_1.44.2      hms_1.1.0                  
##  [83] KEGGREST_1.32.0             seqminer_8.0               
##  [85] capushe_1.1.1               knitr_1.33                 
##  [87] pillar_1.6.2                GenomicRanges_1.44.0       
##  [89] rjson_0.2.20                biomaRt_2.48.3             
##  [91] stats4_4.1.0                XML_3.99-0.7               
##  [93] glue_1.4.2                  evaluate_0.14              
##  [95] RcppParallel_5.1.4          data.table_1.14.0          
##  [97] BiocManager_1.30.16         vctrs_0.3.8                
##  [99] png_0.1-7                   purrr_0.3.4                
## [101] assertthat_0.2.1            cachem_1.0.6               
## [103] xfun_0.25                   echotabix_0.99.0           
## [105] restfulr_0.0.13             ragg_1.1.3                 
## [107] tibble_3.1.4                GenomicAlignments_1.28.0   
## [109] AnnotationDbi_1.54.1        memoise_2.0.0              
## [111] IRanges_2.26.0              ellipsis_0.3.2