Skip to content

Commit b5fb5ac

Browse files
bschilderclaude
andcommitted
Fix R CMD check warnings: add inst/doc, replace XGR Rd cross-refs with \code{}
- Built and committed vignettes to inst/doc (fixes "no files in inst/doc" WARNING) - Replaced \link[XGR]{...} with \code{XGR::...} since XGR is archived (fixes NOTE) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c3e37e4 commit b5fb5ac

11 files changed

Lines changed: 2222 additions & 5 deletions

R/XGR_enrichment.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#' XGR enrichment
22
#'
3-
#' Run SNP-level enrichment test with \link[XGR]{xGRviaGenomicAnno}.
3+
#' Run SNP-level enrichment test with \code{XGR::xGRviaGenomicAnno}.
44
#'
55
#' @param gr Annotations to test for enrichment with.
66
#' @param merged_dat SNP-level fine-mapping results to test for enrichment with.

R/XGR_query.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#' For full list of libraries see
88
#' \href{https://cran.r-project.org/package=XGR}{
99
#' here (XGR on CRAN).}
10-
#' Passed to the \code{RData.customised} argument in \link[XGR]{xRDataLoader}.
10+
#' Passed to the \code{RData.customised} argument in \code{XGR::xRDataLoader}.
1111
#' @param n_top Filter to only the top N annotations
1212
#' that have the greatest amount of overlap with the genomic coordinates of
1313
#' \code{dat}.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## ----setup, echo=FALSE, include=FALSE-----------------------------------------
2+
pkg <- read.dcf("../DESCRIPTION", fields = "Package")[1]
3+
library(pkg, character.only = TRUE)
4+
5+
## ----eval=FALSE---------------------------------------------------------------
6+
# dat <- echodata::BST1
7+
# histo_out <- echoannot::NOTT2019_epigenomic_histograms(dat = dat)
8+
9+
## ----eval=FALSE---------------------------------------------------------------
10+
# knitr::kable(head(histo_out$data$raw))
11+
# knitr::kable(head(histo_out$data$peaks))
12+
13+
## ----Session Info-------------------------------------------------------------
14+
utils::sessionInfo()
15+
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
---
2+
title: "Cell-type-specific epigenomics"
3+
author: "<h4>Author: <i>Brian M. Schilder</i></h4>"
4+
date: "<h4>Updated: <i>`r format( Sys.Date(), '%b-%d-%Y')`</i></h4>"
5+
output:
6+
BiocStyle::html_document
7+
vignette: >
8+
%\VignetteIndexEntry{echoplot}
9+
%\usepackage[utf8]{inputenc}
10+
%\VignetteEngine{knitr::rmarkdown}
11+
---
12+
13+
```{r setup, echo=FALSE, include=FALSE}
14+
pkg <- read.dcf("../DESCRIPTION", fields = "Package")[1]
15+
library(pkg, character.only = TRUE)
16+
```
17+
18+
```R
19+
library(`r pkg`)
20+
```
21+
22+
## Nott2019
23+
24+
`echoannot` includes data generated by
25+
["Nott2019"](https://doi.org/10.1126/science.aay0793):
26+
27+
> Nott A, Holtman IR, Coufal NG, ... Glass CK. Brain cell type-specific enhancer-promoter interactome maps and disease-risk association. Science. 2019 Nov 29;366(6469):1134-1139. doi: 10.1126/science.aay0793. Epub 2019 Nov 14. PMID: 31727856; PMCID: PMC7028213.
28+
29+
### Import data
30+
31+
```R
32+
superenhancers <- echoannot::get_NOTT2019_superenhancer_interactome()
33+
enhancers_promoters <- echoannot::NOTT2019_get_promoter_interactome_data()
34+
peaks <- echoannot::NOTT2019_get_epigenomic_peaks()
35+
```
36+
37+
38+
### Plot
39+
40+
```{r, eval=FALSE}
41+
dat <- echodata::BST1
42+
histo_out <- echoannot::NOTT2019_epigenomic_histograms(dat = dat)
43+
```
44+
45+
In addition to the plot object,
46+
tables of both raw read ranges and called peaks are included in the output list.
47+
48+
```{r, eval=FALSE}
49+
knitr::kable(head(histo_out$data$raw))
50+
knitr::kable(head(histo_out$data$peaks))
51+
```
52+
53+
54+
## Corces2020
55+
56+
`echoannot` also includes data generated by
57+
["Corces2019"](https://doi.org/10.1038/s41588-020-00721-x):
58+
59+
> Corces, M.R., Shcherbina, A., Kundu, S. et al. Single-cell epigenomic analyses implicate candidate causal variants at inherited risk loci for Alzheimer’s and Parkinson’s diseases. Nat Genet 52, 1158–1168 (2020). https://doi.org/10.1038/s41588-020-00721-x
60+
61+
### Import data
62+
63+
```R
64+
bulkATACseq_peaks <- echoannot::get_CORCES2020_bulkATACseq_peaks()
65+
cicero_coaccessibility <- echoannot::get_CORCES2020_cicero_coaccessibility()
66+
hichip_fithichip_loop_calls <- echoannot::get_CORCES2020_hichip_fithichip_loop_calls()
67+
scATACseq_celltype_peaks <- echoannot::get_CORCES2020_scATACseq_celltype_peaks()
68+
scATACseq_peaks <- echoannot::get_CORCES2020_scATACseq_peaks()
69+
```
70+
71+
### Plot
72+
73+
```R
74+
peak_dat <- echoannot::granges_overlap(
75+
dat1 = dat,
76+
chrom_col.1 = "CHR",
77+
start_col.1 = "POS",
78+
dat2 = scATACseq_celltype_peaks,
79+
chrom_col.2 = "hg38_Chromosome",
80+
start_col.2 = "hg38_Start",
81+
end_col.2 = "hg38_Stop")
82+
ggbio::autoplot(peak_dat,
83+
ggplot2::aes(y=ExcitatoryNeurons, color=Effect))
84+
```
85+
86+
87+
# Session Info
88+
89+
<details>
90+
91+
```{r Session Info}
92+
utils::sessionInfo()
93+
```
94+
95+
</details>
96+

inst/doc/cell_type_specific_epigenomics.html

Lines changed: 976 additions & 0 deletions
Large diffs are not rendered by default.

inst/doc/echoannot.R

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
## ----setup, include=TRUE------------------------------------------------------
2+
library(echoannot)
3+
4+
## ----eval=FALSE---------------------------------------------------------------
5+
# merged_DT <- echodata::get_Nalls2019_merged()
6+
7+
## ----eval=FALSE---------------------------------------------------------------
8+
# #### Only query high-confidence fine-mapping SNPs from one locus ####
9+
# dat <- merged_DT[Locus=="LRRK2" & Consensus_SNP==TRUE,]
10+
# #### Query annotations ####
11+
# dat_annot <- echoannot::annotate_snps(dat = dat,
12+
# haploreg_annotation = TRUE,
13+
# regulomeDB_annotation = TRUE,
14+
# biomart_annotation = TRUE)
15+
# knitr::kable(dat_annot)
16+
17+
## ----eval=FALSE---------------------------------------------------------------
18+
# gg_cs_bin <- echoannot::CS_bin_plot(merged_DT = merged_DT,
19+
# show_plot = FALSE)
20+
21+
## ----eval=FALSE---------------------------------------------------------------
22+
# gg_cs_counts <- echoannot::CS_counts_plot(merged_DT = merged_DT,
23+
# show_plot = FALSE)
24+
25+
## ----eval=FALSE---------------------------------------------------------------
26+
# gg_epi <- echoannot::peak_overlap_plot(
27+
# merged_DT = merged_DT,
28+
# include.NOTT2019_enhancers_promoters = TRUE,
29+
# include.NOTT2019_PLACseq = TRUE,
30+
# #### Omit many annotations to save time ####
31+
# include.NOTT2019_peaks = FALSE,
32+
# include.CORCES2020_scATACpeaks = FALSE,
33+
# include.CORCES2020_Cicero_coaccess = FALSE,
34+
# include.CORCES2020_bulkATACpeaks = FALSE,
35+
# include.CORCES2020_HiChIP_FitHiChIP_coaccess = FALSE,
36+
# include.CORCES2020_gene_annotations = FALSE)
37+
38+
## ----eval=FALSE---------------------------------------------------------------
39+
# super_plot <- echoannot::super_summary_plot(merged_DT = merged_DT,
40+
# plot_missense = FALSE)
41+
#
42+
43+
## ----Cleanup, include=FALSE, eval=FALSE---------------------------------------
44+
# remove(super_plot, gg_epi, gg_cs_counts, merged_DT)
45+
46+
## ----Session Info-------------------------------------------------------------
47+
utils::sessionInfo()
48+

inst/doc/echoannot.Rmd

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
---
2+
title: "Getting Started"
3+
author: "<h4>Author: <i>Brian M. Schilder</i></h4>"
4+
date: "<h4>Updated: <i>`r format( Sys.Date(), '%b-%d-%Y')`</i></h4>"
5+
output:
6+
BiocStyle::html_document
7+
vignette: >
8+
%\VignetteIndexEntry{Getting started}
9+
%\usepackage[utf8]{inputenc}
10+
%\VignetteEngine{knitr::rmarkdown}
11+
---
12+
13+
```{r setup, include=TRUE}
14+
library(echoannot)
15+
```
16+
17+
18+
# Import data
19+
20+
To get the full dataset of all fine-mapped Parkinson's Disease loci,
21+
you can use the following function:
22+
23+
```{r, eval=FALSE}
24+
merged_DT <- echodata::get_Nalls2019_merged()
25+
```
26+
27+
# Annotate
28+
29+
Annotate SNP-wise fine-mapping results.
30+
31+
Here, we're only annotating a small number of SNPs high-confidence causal SNPs
32+
for demo purposes.
33+
The more SNPs you supply to `annotate_snps`, the longer it will take to
34+
query the selected databases for each SNP.
35+
36+
```{r, eval=FALSE}
37+
#### Only query high-confidence fine-mapping SNPs from one locus ####
38+
dat <- merged_DT[Locus=="LRRK2" & Consensus_SNP==TRUE,]
39+
#### Query annotations ####
40+
dat_annot <- echoannot::annotate_snps(dat = dat,
41+
haploreg_annotation = TRUE,
42+
regulomeDB_annotation = TRUE,
43+
biomart_annotation = TRUE)
44+
knitr::kable(dat_annot)
45+
```
46+
47+
48+
# Summary plots
49+
50+
## Credible Set bin plot
51+
52+
```{r, eval=FALSE}
53+
gg_cs_bin <- echoannot::CS_bin_plot(merged_DT = merged_DT,
54+
show_plot = FALSE)
55+
```
56+
57+
## Credible Set counts plot
58+
59+
```{r, eval=FALSE}
60+
gg_cs_counts <- echoannot::CS_counts_plot(merged_DT = merged_DT,
61+
show_plot = FALSE)
62+
```
63+
64+
## Epigenomic data
65+
66+
```{r, eval=FALSE}
67+
gg_epi <- echoannot::peak_overlap_plot(
68+
merged_DT = merged_DT,
69+
include.NOTT2019_enhancers_promoters = TRUE,
70+
include.NOTT2019_PLACseq = TRUE,
71+
#### Omit many annotations to save time ####
72+
include.NOTT2019_peaks = FALSE,
73+
include.CORCES2020_scATACpeaks = FALSE,
74+
include.CORCES2020_Cicero_coaccess = FALSE,
75+
include.CORCES2020_bulkATACpeaks = FALSE,
76+
include.CORCES2020_HiChIP_FitHiChIP_coaccess = FALSE,
77+
include.CORCES2020_gene_annotations = FALSE)
78+
```
79+
80+
## Super summary plot
81+
82+
Creates one big merged plot using the subfunctions above.
83+
84+
```{r, eval=FALSE}
85+
super_plot <- echoannot::super_summary_plot(merged_DT = merged_DT,
86+
plot_missense = FALSE)
87+
88+
```
89+
90+
```{r Cleanup, include=FALSE, eval=FALSE}
91+
remove(super_plot, gg_epi, gg_cs_counts, merged_DT)
92+
```
93+
94+
95+
# Session Info
96+
97+
<details>
98+
99+
```{r Session Info}
100+
utils::sessionInfo()
101+
```
102+
103+
</details>
104+

inst/doc/echoannot.html

Lines changed: 978 additions & 0 deletions
Large diffs are not rendered by default.

man/XGR_enrichment.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/XGR_iterate_overlap.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)