XGR_plot_peaks: Plot XGR peaks

View source: R/XGR_plot_peaks.R

XGR_plot_peaksR Documentation

Plot XGR peaks

Description

Plots the distribution of annotations across a genomic region (x-axis).

Usage

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
)

Arguments

gr.lib

GRanges object of annotations.

dat

Data.frame with at least the following columns:

SNP

SNP RSID

CHR

chromosome

POS

position

fill_var

Fill variable.

facet_var

Row facet variable.

geom

Plot type ("density", or "histogram").

locus

[Optional] Locus name.

adjust

The granularity of the peaks.

show_plot

Print the plot.

legend

A logical value indicates whether to show legend or not. Default is TRUE

as_ggplot

Return plot as ggplot2 (TRUE) or Tracks (FALSE) object.

trim_xlims

Trim the x-axis limits.

Value

ggbio track plot.

Examples

#### 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")

RajLabMSSM/echoplot documentation built on Oct. 24, 2023, 2:41 a.m.