Skip to contents

Builds a peak x annotation binary match matrix from input genomic regions (GRanges, GRangesList, list of GRanges, or named character vector of BED file paths) and stores it on the project alongside per-annotation positions.

Usage

# S3 method for class 'MarchRProject'
add_peak_annotations(
  proj,
  regions,
  name = "Region",
  overwrite = FALSE,
  verbose = getOption("MarchR.verbose", FALSE),
  ...
)

Arguments

proj

(MarchRProject) Project with a populated peak set.

regions

(GRanges, GRangesList, list, or named character vector) Input regions. See details for accepted forms.

name

(character) Name of the annotation. Default "Region".

overwrite

(logical) Overwrite existing annotation with the same name. Default FALSE.

verbose

(logical) Print progress messages. Default getOption("MarchR.verbose", FALSE).

...

Currently unused.

Value

The modified MarchRProject with the annotation stored at proj$peak_annotations[[name]]. Match matrix rows carry coordinate-key rownames (<chr>_<start>_<end>).

Details

Computes peak overlaps via GenomicRanges::findOverlaps() and constructs a sparse Matrix::dgCMatrix of size (n_peaks x n_annotations) with 1 indicating peak overlap. Annotations with zero overlaps are dropped from the result.

Equivalent to ArchR's addPeakAnnotations() (AnnotationPeaks.R:157).

See also

add_motif_annotations() for PWM-based motif annotations.