-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathXGR_enrichment_plot.Rd
110 lines (109 loc) · 2.8 KB
/
XGR_enrichment_plot.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/XGR_enrichment_plot.R
\name{XGR_enrichment_plot}
\alias{XGR_enrichment_plot}
\title{Plot enrichment results}
\usage{
XGR_enrichment_plot(
enrich_res,
title = NULL,
subtitle = NULL,
facet_formula = NULL,
line_formula = "y ~ x",
line_method = "lm",
line_span = 1,
FDR_thresh = 1,
plot_type = "bar",
shape_var = "Cell_type",
facet_scales = "free",
show_plot = TRUE,
save_plot = FALSE,
height = 5,
width = 5,
dpi = 300
)
}
\arguments{
\item{dpi}{Plot resolution. Also accepts a string input: "retina" (320),
"print" (300), or "screen" (72). Applies only to raster output types.}
}
\description{
Plot enrichment results from XGR annotations.
}
\examples{
\dontrun{
root <- file.path(
"/sc/arion/projects/pd-omics/brian",
"Fine_Mapping/Data/GWAS/Nalls23andMe_2019/_genome_wide"
)
### merged enrichment results
enrich_res <- data.table::fread(
file.path(
root,
"XGR/celltypespecific_epigenomics.SNP_groups.csv.gz"
)
)
enrich_res <- data.table::fread(
file.path(
root,
"XGR/celltypespecific_epigenomics.snp_groups.csv.gz"
)
)
enrich_boot <- data.table::fread(
file.path(
root,
"XGR/celltypespecific_epigenomics.snp_groups.permute.csv.gz"
)
)
enrich_assay <- data.table::fread(
file.path(
root,
"XGR/celltypespecific_epigenomics.snp_groups.assay.csv.gz"
)
)
# Merged volcano plot
enrich_res <- subset(enrich_res, SNP_Group != "Consensus (-PolyFun)") |>
dplyr::rename(SNP_group = SNP_Group)
gp <- XGR_enrichment_plot(
enrich_res = subset(enrich_res, !Assay \%in\% c("HiChIP_FitHiChIP", "PLAC")),
title = "Enrichment: Cell-type-specific epigenomics",
plot_type = "point",
save_plot = file.path(
root, "XGR/celltypespecific_epigenomics.enrich_volcano.png"
),
height = 6, width = 8, shape_var = "Assay"
)
## Merged bar plot
gp <- XGR_enrichment_plot(
enrich_res = enrich_res,
plot_type = "bar",
facet_formula = ".~Assay",
FDR_thresh = .05
)
# Merged volcano plot (permuted)
gp <- XGR_enrichment_plot(
enrich_res = enrich.scATAC.permute,
title = "Permuted enrichment: Cell-type-specific peaks and elements",
plot_type = "point"
)
}
}
\seealso{
Other XGR:
\code{\link{XGR_enrichment_bootstrap}()},
\code{\link{XGR_enrichment}()},
\code{\link{XGR_filter_assays}()},
\code{\link{XGR_filter_sources}()},
\code{\link{XGR_import_annotations}()},
\code{\link{XGR_iterate_enrichment}()},
\code{\link{XGR_iterate_overlap}()},
\code{\link{XGR_merge_and_process}()},
\code{\link{XGR_parse_metadata}()},
\code{\link{XGR_plot_enrichment}()},
\code{\link{XGR_prepare_foreground_background}()},
\code{\link{XGR_query}()},
\code{\link{XGR_sep_handler}()},
\code{\link{xgr_example}}
}
\concept{XGR}
\keyword{internal}