Plots the distribution of annotations across a genomic region (x-axis).
XGR_plot_peaks(
gr.lib,
dat,
fill_var = "Assay",
facet_var = "Source",
geom = "density",
locus = NULL,
adjust = 0.2,
show_plot = TRUE,
legend = TRUE,
as_ggplot = TRUE,
trim_xlims = FALSE
)
GRanges
object of annotations.
Data.frame with at least the following columns:
SNP RSID
chromosome
position
Fill variable.
Row facet variable.
Plot type ("density", or "histogram").
[Optional] Locus name.
The granularity of the peaks.
Print the plot.
A logical value indicates whether to show legend or not. Default is
TRUE
Return plot as ggplot2
(TRUE
) or Tracks
(FALSE
) object.
Trim the x-axis limits.
ggbio
track plot.
#### Import example query ####
gr.lib <- echoannot::xgr_example
#### Filter query ####
gr.filt <- echoannot::XGR_filter_sources(gr.lib = gr.lib)
gr.filt <- echoannot::XGR_filter_assays(gr.lib = gr.filt)
#### Plot query #####
XGR_track <- echoplot::XGR_plot_peaks(
gr.lib = gr.filt,
dat = echodata::BST1,
fill_var = "Assay",
facet_var = "Source")
#> Warning: Ignoring unknown parameters: `facets`
#> Warning: no non-missing arguments to max; returning -Inf
#> Found more than one class "simpleUnit" in cache; using the first, from namespace 'hexbin'
#> Also defined by 'ggbio'