AnnotationHeatmap: AnnotationHeatmap

View source: R/AnnotationHeatmap.R

AnnotationHeatmapR Documentation

AnnotationHeatmap

Description

Generate heatmaps of Genomic Ranges around positions of interest in a genome.

Usage

AnnotationHeatmap(
  peaks,
  annotation,
  annoname = "annotation",
  span = 2025,
  step = 50,
  ignoreStrand = TRUE,
  minoverlap = ceiling(step/2)
)

Arguments

peaks

A Granges object containing your positions of interest in a genome (eg ChIP peak summits). Must include seqnames (chromosomes), start, end, strand, and name.

annotation

A GRanges object containing the annotation ranges you want to plot around peak summits.For example, promoter regions.

annoname

A character scalar to describe the annotation that was provided (for example: "promoters"). Defaults to "annotation".

span

Integer scalar specifying the distance from the peak center to the left and right that you want your heatmap to extend to. Default is 2025.

step

Integer scalar specifying the window size in which annotation overlaps are counted. Default is 50.

ignoreStrand

Logical scalar indicating if hould an overlap should be counted only if on the same strand (ignore.strand=FALSE), or on any strand (ignore.strand=TRUE, default).

minoverlap

Integer scalar indicating the desired minimum overlap of the annotation region with the window of the heatmap for a window to be counted as overlapping the annotation. Default is 1/2 * step (half the step size).

Details

This function generates a heatmap of annotations around positions of interest in a genome, for example, the summits of ChIP peaks. An annotation GRanges object must be provided. This can contain regions representing anything of interest, for example promoters, genes, repeats, or transcription factor motif occurences in the genome. The center of your GRanges object defines the coordinates of these positions of interest (eg peak summits, TSSs). Features that lie on the minus strand will be reversed in the final output. If at least one region in the annotation GRanges object overlaps a window in the heatmap by 1/2 of the step size provided, this window will be called overlapping (= 1), otherwise it will be called non-overlapping (= 0).

Value

A matrix that contains the overlap with the annotation in each window (column headers=middle of the window) for each peak (rownames=peaknames). 1 = at least half of the window overlaps with a region in the annotation object, 0 = less than half of the window overlaps with the annotation object.

Examples

peaks <- GenomicRanges::GRanges(
seqnames = Rle(c("chr1", "chr2", "chr1", "chr3"), c(1, 3, 2, 4)),
ranges = IRanges(50101:50110, end = 51111:51120),
strand = Rle(strand(c("-", "+", "*", "+", "-")), c(1, 2, 2, 3, 2)),
summit = 1:10, name = head(letters, 10))
annotation <- GenomicRanges::GRanges(
seqnames = Rle(c("chr1", "chr2", "chr2", "chr3"), c(1, 3, 2, 4)),
ranges = IRanges(50101:50110, end = 51111:51120),
strand = Rle(strand(c("-", "+", "*", "-", "-")), c(1, 2, 2, 3, 2)),
name = head(letters, 10))
AnnotationHeatmap(peaks=peaks,annotation=annotation)


fmi-basel/gbuehler-MiniChip documentation built on June 13, 2025, 6:15 a.m.