plot_genomic_annotations: Plot genomic annotations

Description Usage Arguments Value Examples

View source: R/plot_genomic_annotations.R

Description

plot the annotations of genomic regions either as stacked bar or heatmap. The function takes the output of get_genomic_annotations directly or it is also compatible with a similar data.frame.

Usage

1
plot_genomic_annotations(annotations_df, plot_type = "bar", col = NULL)

Arguments

annotations_df

a data.frame of genomic annotations. It can either be of one sample or of multiple samples as a data.frame

plot_type

either bar plot or heatmap, default bar

col

vector of colors for each feature in annotations_df. If provided these colors are used, if not a custom set of distinct colors will be used. Default NULL

Value

ggplot2 plot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## load example data

chr21_data_table <- system.file('extdata/bw', 'ALPS_example_datatable.txt', package = 'ALPS', mustWork = TRUE)

## attach path to bw_path and bed_path
d_path <- dirname(chr21_data_table)

chr21_data_table <- read.delim(chr21_data_table, header = TRUE)
chr21_data_table$bw_path <- paste0(d_path, '/', chr21_data_table$bw_path)
chr21_data_table$bed_path <- paste0(d_path, '/', chr21_data_table$bed_path)

g_annotations <- get_genomic_annotations(data_table = chr21_data_table,
merge_level = 'group_level')

plot_genomic_annotations(annotations_df = g_annotations, plot_type = 'heatmap')

ALPS documentation built on Nov. 8, 2020, 5:52 p.m.