library(echolocatoR)
All examples below use data from the Parkinson's disease GWAS by Nalls et al. (2019).
top_SNPs
data.frametop_SNPs
data.framefinemap_loci()
(see next step) will then use this info to extract subsets of the topSS
argument can either be a data.frame, or a path to a topSS file saved somehwere.
Most common tabular data formats (e.g. .tsv, .csv, .xlsx) are accepted. #### Load example top SNPs (pre-formatted) #### topSS <- echodata::topSNPs_Nalls2019_raw #### construct a column mapping object #### colmap <- echodata::construct_colmap(P = "P, all studies", Effect = "Beta, all studies", Locus = "Nearest Gene", Gene = "QTL Nominated Gene (nearest QTL)") #### Import top SNPs #### topSNPs <- echodata::import_topSNPs( topSS = echodata::topSNPs_Nalls2019_raw, colmap = colmap, grouping_vars = "Locus Number") head(topSNPs)
Since a full GWAS summary stats file would be too large to include within echolocatoR,
we instead provide an example subset of the full summary stats.
To simulate how you'd actually use your own full summary stats file, we will save our example dataset to your computer (you can change the path to wherever you like).
We highly recommend munging your full summary stats using the Bioconductor package MungeSumstats
first. It's easy to use and very robust. It also means you don't have to provide most column mapping arguments in finemap_loci
when munged=TRUE
.
Here's an example of how to munge your full summary stats file:
fullSS_path <- echodata::example_fullSS(munged = FALSE) fullSS_path <- MungeSumstats::format_sumstats(path = fullSS_path, ref_genome = "GRCH37")
We have already munged the following example summary stats for you.
fullSS_path <- echodata::example_fullSS(dataset = "Nalls2019")
For a full description of all arguments, see ?finemap_loci
.
Here are some key arguments:
echofinemap::lfm()
. bp_distance
is the number of basepairs upstream/downstream you want to extract for each locus. For example, if you want a 2Mb window (+/- 1Mb from the lead/index SNP in top_SNPs
), set bp_distance=1e+06
. bp_distance
so that you don't have rerun the whole pipeline each time (locus subsets, LD matrices, and fine-mapping results are all automatically saved in locus-specific folders). Note: Please use the full absolute paths (instead of relative paths) wherever possible (e.g. results_dir
). This is especially important for the tool FINEMAP.
results <- echolocatoR::finemap_loci( fullSS_path = fullSS_path, topSNPs = topSNPs, loci = c("BST1","MEX3C"), LD_reference = "1KGphase3", dataset_name = "Nalls23andMe_2019", fullSS_genome_build = "hg19", bp_distance = 1000, finemap_methods = c("ABF","SUSIE","FINEMAP"), munged = TRUE)
utils::sessionInfo()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.