11---
2- title : " echolocatoR Fine-mapping Portal"
2+ title : " echolocatoR Fine-mapping Portal"
33author : " <h4>Author: <i>Brian M. Schilder</i></h4>"
44date : " <h4>Updated: <i>`r format( Sys.Date(), '%b-%d-%Y')`</i></h4>"
55output :
66 BiocStyle::html_document
77vignette : >
8- %\VignetteIndexEntry{echolocatoR_Finemapping_Portal}
8+ %\VignetteIndexEntry{echolocatoR_Finemapping_Portal}
99 %\usepackage[utf8]{inputenc}
10- %\VignetteEngine{knitr::rmarkdown}
10+ %\VignetteEngine{knitr::rmarkdown}
1111---
1212
1313``` {r style, echo=FALSE, results='asis', message=FALSE}
@@ -18,35 +18,36 @@ knitr::opts_chunk$set(tidy = FALSE,
1818
1919``` {r setup}
2020library(echodata)
21+ has_internet <- curl::has_internet()
2122```
2223
2324The * echolocatoR.
2425
25- The following functions provides API access to the fine-mapping results,
26+ The following functions provides API access to the fine-mapping results,
2627pre-computed LD matrices, and plots available on the [ ** echolocatoR Fine-mapping Portal** ] ( https://rajlab.shinyapps.io/Fine_Mapping_Shiny/ ) .
2728
2829# View metadata
2930
30- Peruse the metadata to see the available
31- data types (e.g. "GWAS", "QTL"),
32- datasets (e.g. "Ripke_2014", "Wray_2018"), and
31+ Peruse the metadata to see the available
32+ data types (e.g. "GWAS", "QTL"),
33+ datasets (e.g. "Ripke_2014", "Wray_2018"), and
3334phenotypes (e.g. "Schizophrenia", "Major Depressive Disorder").
3435
35- ``` {r}
36+ ``` {r, eval=has_internet }
3637meta <- echodata::portal_metadata()
3738knitr::kable(meta)
3839```
3940
4041# Query portal
4142
42- Query and download data from the
43+ Query and download data from the
4344[ ** echolocatoR Fine-mapping Portal** ] ( https://rajlab.shinyapps.io/Fine_Mapping_Shiny/ ) .
4445
45- ` portal_query ` will return a list of paths where each file
46- has been downloaded locally, in a hierarchical folder structure
46+ ` portal_query ` will return a list of paths where each file
47+ has been downloaded locally, in a hierarchical folder structure
4748(i.e. ` dataset_type --> dataset --> locus --> data_types ` )
4849
49- ``` {r}
50+ ``` {r, eval=has_internet }
5051results_dir <- tempdir()
5152local_files <- echodata::portal_query(dataset_types="GWAS",
5253 phenotypes = c("schizophrenia",
@@ -58,43 +59,42 @@ local_files <- echodata::portal_query(dataset_types="GWAS",
5859knitr::kable(utils::head(local_files))
5960```
6061
61- ### Merge fine-mapping results
62+ ### Merge fine-mapping results
6263
6364Next, we can gather all of the fine-mapping results generated by
64- ` finemap_loci() ` previously.
65+ ` finemap_loci() ` previously.
6566` merge_finemapping_results ` recursively searches for the correct files
66- within a hierarchical folder structure and imports only the multi-finemap files.
67+ within a hierarchical folder structure and imports only the multi-finemap files.
6768
68- ``` {r merge_finemapping_results()}
69- merged_DT <- echodata::merge_finemapping_results(dataset = results_dir,
69+ ``` {r merge_finemapping_results(), eval=has_internet}
70+ merged_DT <- echodata::merge_finemapping_results(dataset = results_dir,
7071 minimum_support = 0,
7172 include_leadSNPs = TRUE,
7273 consensus_thresh = 2)
7374echodata::results_report(merged_DT)
7475knitr::kable(utils::head(merged_DT))
7576```
7677
77- ## Import LD
78+ ## Import LD
7879
7980Next, we import the a subset of the LD matrices for only the lead SNP.
8081
81- ``` {r}
82+ ``` {r, eval=has_internet }
8283ld_files <- local_files[file_type=="LD",]
83- ld_matrices <- lapply(stats::setNames(ld_files$path_local,
84+ ld_matrices <- lapply(stats::setNames(ld_files$path_local,
8485 ld_files$locus),
8586 function(x){
8687 data.table::fread(x)
87- })
88+ })
8889knitr::kable(utils::head(ld_matrices[[1]]))
8990```
9091
91- # Session Info
92+ # Session Info
9293
93- <details >
94+ <details >
9495
9596``` {r Session Info}
9697utils::sessionInfo()
9798```
9899
99- </details >
100-
100+ </details >
0 commit comments