Determines which datasets to query using qtl_search
.
Uses coordinates from stored summary stats files (e.g. GWAS)
to determine which regions to query from eQTL Catalogue.
Each locus file can be stored separately,
or merged together to form one large file with all query results.
eQTL_Catalogue.query( sumstats_paths = NULL, output_dir = "./catalogueR_queries", qtl_search = NULL, use_tabix = T, nThread = 4, quant_method = "ge", infer_region = T, split_files = T, merge_with_gwas = T, force_new_subset = F, genome_build = "hg19", progress_bar = T, verbose = T )
sumstats_paths | A list of paths to any number of summary stats files
whose coordinates you want to use to make queries to eQTL Catalogue.
If you wish to add custom names to the loci, simply add these as the names of the path list
(e.g. The minimum columns in these files required to make queries include:
|
---|---|
output_dir | The folder you want the merged gwas/qtl results to be saved to
(set |
qtl_search | This function will automatically search for any datasets that match your criterion. For example, if you search "Alasoo_2018", it will query the datasets:
You can be more specific about which datasets you want to include,
for example by searching: "Alasoo_2018.macrophage_IFNg".
You can even search by tissue or condition type (e.g. |
use_tabix | Tabix is about ~17x faster (default: =T) than the REST API (=F). |
nThread | The number of CPU cores you want to use to speed up your queries through parallelization. |
quant_method | eQTL Catalogue actually contains more than just eQTL data. For each dataset, the following kinds of QTLs can be queried:
|
split_files | Save the results as one file per QTL dataset (with all loci within each file).
If this is set to |
merge_with_gwas | Whether you want to merge your QTL query results with your GWAS data (convenient, but takes up more storage). |
force_new_subset | By default, catalogueR will use any pre-existing files that match your query.
Set |
genome_build | The genome build of your query coordinates (e.g. |
progress_bar |
|
verbose | Show more ( |
Other eQTL Catalogue:
BST1__Alasoo_2018.macrophage_IFNg
,
LRRK2__Alasoo_2018.macrophage_IFNg
,
MEX3C__Alasoo_2018.macrophage_IFNg
,
eQTL_Catalogue.fetch()
,
eQTL_Catalogue.header
,
eQTL_Catalogue.iterate_fetch()
,
eQTL_Catalogue.search_metadata()
,
fetch_restAPI()
,
fetch_tabix()
,
merge_gwas_qtl()
,
meta
sumstats_paths <- example_sumstats_paths() # Merged results # GWAS.QTL <- eQTL_Catalogue.query(sumstats_paths=sumstats_paths, qtl_search="Alasoo_2018", nThread=1, force_new_subset=T, merge_with_gwas=F, progress_bar=T, split_files=F) # Merged results (parallel) GWAS.QTL <- eQTL_Catalogue.query(sumstats_paths=sumstats_paths, qtl_search="Alasoo_2018", nThread=4, force_new_subset=T, merge_with_gwas=F, progress_bar=T, split_files=F)#> [1] "+ Optimizing multi-threading..." #> [1] "++ Multi-threading across QTL datasets." #> [1] "eQTL_Catalogue:: Querying 4 QTL datasets x 3 GWAS loci (12 total)"#> Warning: scheduled cores 1, 2, 4 encountered errors in user code, all values of the jobs will be affected#> [1] "++ Post-processing merged results."#> Error in data.table::rbindlist(GWAS.QTL_all, fill = T): Item 1 of input is not a data.frame, data.table or list# Split results # gwas.qtl_paths <- eQTL_Catalogue.query(sumstats_paths=sumstats_paths, qtl_search="Alasoo_2018", nThread=1, force_new_subset=T, merge_with_gwas=F, progress_bar=T) # Split results (parallel) gwas.qtl_paths <- eQTL_Catalogue.query(sumstats_paths=sumstats_paths, qtl_search="Alasoo_2018", nThread=4, force_new_subset=T, merge_with_gwas=F, progress_bar=T)#> [1] "+ Optimizing multi-threading..." #> [1] "++ Multi-threading across QTL datasets." #> [1] "eQTL_Catalogue:: Querying 4 QTL datasets x 3 GWAS loci (12 total)"#> Warning: scheduled cores 4, 3 encountered errors in user code, all values of the jobs will be affected#> [1] "++ Returning list of split files paths." #> [1] "Data dimensions: x " #> Time difference of 10.9 secs#> [1] "+ Merging 8 files." #> [1] "+ Using 4 cores." #> [1] "+ Merged data.table: 2 rows x 10 columns."# Nalls et al example if (FALSE) { sumstats_paths_Nalls <- list.files("Fine_Mapping/Data/GWAS/Nalls23andMe_2019","Multi-finemap_results.txt", recursive = T, full.names = T) names(sumstats_paths_Nalls) <- basename(dirname(dirname(sumstats_paths_Nalls))) gwas.qtl_paths <- eQTL_Catalogue.query(sumstats_paths=sumstats_paths_Nalls, output_dir="catalogueR_queries/Nalls23andMe_2019", merge_with_gwas=T, nThread=1, force_new_subset=T) }