library(echoLD)

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

1000 Genomes: Phase 1 or 3

LD_1kgp3 <- echoLD::get_LD(locus_dir = locus_dir,
                           query_dat = query_dat,
                           LD_reference = "1KGphase3") # 1KGphase1

Plot

echoLD::plot_LD(LD_matrix = LD_1kgp3$LD, 
                query_dat = LD_1kgp3$DT,
                span = 20)

UK Biobank

WARNING: Takes substantially longer than 1000 Genomes methods.

LD_ukb <- echoLD::get_LD(locus_dir = locus_dir,
                         query_dat = query_dat,
                         LD_reference = "UKB", 
                         download_method = "axel", 
                         nThread = 10)

Plot

echoLD::plot_LD(LD_matrix = LD_ukb$LD, 
                query_dat = LD_ukb$DT,
                span = 20)

Custom VCF

LD_reference <- system.file("extdata","BST1.1KGphase3.vcf.bgz", 
                            package = "echodata")
samples <- c("HG00097","HG00099","HG00100","HG00101","HG00102")
LD_custom <- echoLD::get_LD(locus_dir = locus_dir,
                            query_dat = query_dat, 
                            LD_reference = LD_reference)

Plot

echoLD::plot_LD(LD_matrix = LD_custom$LD, 
                query_dat = LD_custom$DT,
                span = 20)

Session Info

utils::sessionInfo()




RajLabMSSM/echoLD documentation built on May 12, 2024, 3:23 a.m.