Skip to content

Commit c3e997e

Browse files
bschilderclaude
andcommitted
Add pkgdown dark theme and guard vignettes with has_internet
- Create _pkgdown.yml with echoverse dark theme (bootstrap 5, bslib) - Organize 59 exports into 5 reference sections - Add curl::has_internet() guards to vignette chunks that download data - Add curl to Suggests in DESCRIPTION Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f9d4604 commit c3e997e

4 files changed

Lines changed: 210 additions & 36 deletions

File tree

DESCRIPTION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ Imports:
4545
piggyback,
4646
MungeSumstats (>= 1.3.14)
4747
Suggests:
48+
curl,
4849
markdown,
4950
rmarkdown,
5051
remotes,

_pkgdown.yml

Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
url: https://rajlabmssm.github.io/echodata/
2+
3+
template:
4+
bootstrap: 5
5+
bslib:
6+
bg: "#1a2744"
7+
fg: "#e8f4f4"
8+
primary: "#4ecdc4"
9+
secondary: "#3a8d8c"
10+
success: "#2ee8d6"
11+
info: "#5bc0be"
12+
code-bg: "#d6e4ee"
13+
code-color: "#1a2744"
14+
border-color: "#2a4060"
15+
link-color: "#4ecdc4"
16+
link-hover-color: "#2ee8d6"
17+
font-size-base: "1rem"
18+
includes:
19+
in_header: |
20+
<style>
21+
.navbar {
22+
background-color: #162038 !important;
23+
border-bottom: 2px solid #4ecdc4;
24+
}
25+
.navbar-brand, .nav-link { color: #e8f4f4 !important; }
26+
.nav-link:hover { color: #2ee8d6 !important; }
27+
.nav-link.active { color: #2ee8d6 !important; border-bottom: 2px solid #2ee8d6; }
28+
pre {
29+
background-color: #d6e4ee !important;
30+
color: #1a2744 !important;
31+
border: none !important;
32+
border-radius: 12px;
33+
margin: 0;
34+
padding: 0.8em 1em;
35+
}
36+
code { color: #1a6b68 !important; border: none !important; }
37+
pre code { color: #1a2744 !important; border: none !important; background: transparent !important; }
38+
pre code span { border: none !important; background: transparent !important; }
39+
.table { color: #e8f4f4 !important; }
40+
.table-striped > tbody > tr:nth-of-type(odd) > * {
41+
background-color: rgba(78, 205, 196, 0.05) !important;
42+
color: #e8f4f4 !important;
43+
}
44+
.table-striped > tbody > tr:nth-of-type(even) > * {
45+
background-color: transparent !important;
46+
color: #e8f4f4 !important;
47+
}
48+
.table > thead { border-bottom: 2px solid #4ecdc4; }
49+
h1, h2, h3, h4, h5, h6 { color: #4ecdc4 !important; }
50+
a { color: #5bc0be; }
51+
a:hover { color: #2ee8d6; }
52+
.card { background-color: #1e3050; border-color: #2a4060; }
53+
.footer { background-color: #162038 !important; border-top: 1px solid #2a4060; }
54+
.page-header { border-bottom: 2px solid #3a8d8c; }
55+
.sourceCode {
56+
background-color: #d6e4ee !important;
57+
border: 1px solid #3a8d8c;
58+
border-radius: 12px !important;
59+
overflow: hidden;
60+
}
61+
.sourceCode code span,
62+
.sourceCode code a {
63+
border: none !important;
64+
outline: none !important;
65+
box-shadow: none !important;
66+
background: transparent !important;
67+
}
68+
</style>
69+
70+
navbar:
71+
structure:
72+
left: [intro, reference, articles]
73+
right: [search, github]
74+
components:
75+
github:
76+
icon: fa-github
77+
href: https://github.com/RajLabMSSM/echodata/
78+
79+
articles:
80+
- title: Vignettes
81+
navbar: ~
82+
contents:
83+
- echodata
84+
- echolocatoR_Finemapping_Portal
85+
86+
reference:
87+
- title: Data access
88+
desc: Download and access example GWAS summary statistics and portal data.
89+
contents:
90+
- get_data
91+
- get_Nalls2019
92+
- get_Nalls2019_loci
93+
- get_Nalls2019_merged
94+
- get_Nalls2019_coloc
95+
- get_Kunkle2019
96+
- get_Kunkle2019_coloc
97+
- example_fullSS
98+
- portal_metadata
99+
- portal_query
100+
101+
- title: Data processing
102+
desc: Standardize, format, and import summary statistics.
103+
contents:
104+
- standardize
105+
- standardize_gene
106+
- construct_colmap
107+
- column_dictionary
108+
- import_topSNPs
109+
- mungesumstats_to_echolocatoR
110+
- extract_loci
111+
- fix_coltypes
112+
- update_cols
113+
- get_header
114+
- get_nrows
115+
- get_sample_size
116+
- coords_to_rsids
117+
118+
- title: Fine-mapping results
119+
desc: Process, merge, and summarize fine-mapping results.
120+
contents:
121+
- find_consensus_snps
122+
- find_consensus_snps_no_polyfun
123+
- find_top_consensus
124+
- merge_finemapping_results
125+
- melt_finemapping_results
126+
- results_report
127+
- fillNA_CS_PP
128+
- get_CS_bins
129+
- get_CS_counts
130+
- get_SNPgroup_counts
131+
- filter_snps
132+
- limit_snps
133+
- snp_group_filters
134+
- snp_group_colorDict
135+
- assign_lead_snp
136+
- reassign_lead_snps
137+
138+
- title: Utilities
139+
desc: General-purpose helper functions.
140+
contents:
141+
- is_granges
142+
- is_empty
143+
- is_ggbio
144+
- is_ggplot
145+
- is_local
146+
- is_url
147+
- dt_to_granges
148+
- granges_to_bed
149+
- merge_robust
150+
- unlist_dt
151+
- createDT
152+
- preview
153+
- detect_genes
154+
- gene_locus_list
155+
- order_loci
156+
- get_os
157+
- set_permissions
158+
- read_parquet
159+
- write_parquet
160+
161+
- title: Bundled datasets
162+
desc: Pre-computed example datasets included with the package.
163+
contents:
164+
- BST1
165+
- LRRK2
166+
- MEX3C
167+
- BST1_LD_matrix
168+
- topSNPs_Nalls2019
169+
- topSNPs_Nalls2019_raw
170+
- topSNPs_Kunkle2019
171+
- locus_dir
172+
- genome_wide_dir
173+
- sumstatsColHeaders

vignettes/echodata.Rmd

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
---
2-
title: "echodata: Getting Started"
3-
author: "<h4>Author: <i>Brian M. Schilder</i></h4>"
2+
title: "echodata: Getting Started"
3+
author: "<h4>Author: <i>Brian M. Schilder</i></h4>"
44
date: "<h4>Most recent update: <i>`r format( Sys.Date(), '%b-%d-%Y')`</i></h4>"
55
output:
66
BiocStyle::html_document
77
vignette: >
8-
%\VignetteIndexEntry{echodata}
8+
%\VignetteIndexEntry{echodata}
99
%\usepackage[utf8]{inputenc}
1010
%\VignetteEngine{knitr::rmarkdown}
1111
---
1212

1313
```{r setup}
1414
library(echodata)
15+
has_internet <- curl::has_internet()
1516
```
1617

1718

@@ -22,29 +23,28 @@ Example full GWAS summary statistics.
2223
## Nalls 2019
2324

2425
Parkinson's Disease GWAS from
25-
[Nalls et al., 2019](https://doi.org/10.1016/S1474-4422(19)30320-5).
26+
[Nalls et al., 2019](https://doi.org/10.1016/S1474-4422(19)30320-5).
2627

27-
```{r}
28+
```{r, eval=has_internet}
2829
fullSS_Nalls2019 <- echodata::example_fullSS(dataset = "Nalls2019")
2930
```
3031

3132
## Kunkle 2019
3233

3334
Alzheimer's Disease GWAS from
34-
[Kunkle et al., 2019](https://www.nature.com/articles/s41588-019-0358-2).
35+
[Kunkle et al., 2019](https://www.nature.com/articles/s41588-019-0358-2).
3536

36-
```{r}
37+
```{r, eval=has_internet}
3738
fullSS_Kunkle2019 <- echodata::example_fullSS(dataset = "Kunkle2019")
3839
```
3940

4041

41-
# Session Info
42+
# Session Info
4243

43-
<details>
44+
<details>
4445

4546
```{r Session Info}
4647
utils::sessionInfo()
4748
```
4849

49-
</details>
50-
50+
</details>
Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
2-
title: "echolocatoR Fine-mapping Portal"
2+
title: "echolocatoR Fine-mapping Portal"
33
author: "<h4>Author: <i>Brian M. Schilder</i></h4>"
44
date: "<h4>Updated: <i>`r format( Sys.Date(), '%b-%d-%Y')`</i></h4>"
55
output:
66
BiocStyle::html_document
77
vignette: >
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}
2020
library(echodata)
21+
has_internet <- curl::has_internet()
2122
```
2223

2324
The *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,
2627
pre-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
3334
phenotypes (e.g. "Schizophrenia", "Major Depressive Disorder").
3435

35-
```{r}
36+
```{r, eval=has_internet}
3637
meta <- echodata::portal_metadata()
3738
knitr::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}
5051
results_dir <- tempdir()
5152
local_files <- echodata::portal_query(dataset_types="GWAS",
5253
phenotypes = c("schizophrenia",
@@ -58,43 +59,42 @@ local_files <- echodata::portal_query(dataset_types="GWAS",
5859
knitr::kable(utils::head(local_files))
5960
```
6061

61-
### Merge fine-mapping results
62+
### Merge fine-mapping results
6263

6364
Next, 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)
7374
echodata::results_report(merged_DT)
7475
knitr::kable(utils::head(merged_DT))
7576
```
7677

77-
## Import LD
78+
## Import LD
7879

7980
Next, we import the a subset of the LD matrices for only the lead SNP.
8081

81-
```{r}
82+
```{r, eval=has_internet}
8283
ld_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+
})
8889
knitr::kable(utils::head(ld_matrices[[1]]))
8990
```
9091

91-
# Session Info
92+
# Session Info
9293

93-
<details>
94+
<details>
9495

9596
```{r Session Info}
9697
utils::sessionInfo()
9798
```
9899

99-
</details>
100-
100+
</details>

0 commit comments

Comments
 (0)