Description Usage Arguments Value Examples
Given a GRanges
of annotated regions, plot the number of regions with the corresponding genomic annotations used in annotation_order
. If a region is annotated to multiple annotations of the same annot.type
, the region will only be counted once in the corresponding bar plot. For example, if a region were annotated to multiple exons, it would only count once toward the exon bar in the plot, but if it were annotated to an exon and an intron, it would count towards both.
1 2 3 4 5 6 7 8 9 | plot_annotation(
annotated_regions,
annotated_random,
annotation_order = NULL,
plot_title,
x_label,
y_label,
quiet = FALSE
)
|
annotated_regions |
The |
annotated_random |
The |
annotation_order |
A character vector which doubles as the subset of annotations desired for the plot as well as the ordering. If |
plot_title |
A string used for the title of the plot. If missing, no title is displayed. |
x_label |
A string used for the x-axis label. If missing, no x-axis label is displayed. |
y_label |
A string used for the y-axis label. If missing, no y-axis label is displayed. |
quiet |
Print progress messages (FALSE) or not (TRUE). |
A ggplot
object which can be viewed by calling it, saved with ggplot2::ggsave
, or edited.
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 | ########################################################################
# An example of ChIP-seq peaks with signalValue used for score
# Get premade CpG annotations
data('annotations', package = 'annotatr')
chip_bed = system.file('extdata', 'Gm12878_Stat3_chr2.bed.gz', package = 'annotatr')
chip_regions = read_regions(con = chip_bed, genome = 'hg19')
chip_rnd = randomize_regions(regions = chip_regions)
chip_annots = annotate_regions(
regions = chip_regions,
annotations = annotations,
ignore.strand = TRUE)
chip_rnd_annots = annotate_regions(
regions = chip_rnd,
annotations = annotations,
ignore.strand = TRUE)
annots_order = c(
'hg19_cpg_islands',
'hg19_cpg_shores')
p_annots = plot_annotation(annotated_regions = chip_annots,
annotation_order = annots_order)
p_annots_rnd = plot_annotation(annotated_regions = chip_annots,
annotated_random = chip_rnd_annots, annotation_order = annots_order)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.