Skip to contents

For each group in marker_result, tests whether foreground peaks (passing cutoff) are over-represented in each annotation column of the peak x annotation match matrix.

Usage

# S3 method for class 'MarchRProject'
peak_annotation_enrichment(
  proj,
  marker_result,
  peak_annotation,
  matches = NULL,
  cutoff = "p_val_adj <= 0.1 & log2_fc >= 0.5",
  background = c("all", "background_peaks"),
  verbose = getOption("MarchR.verbose", FALSE),
  ...
)

Arguments

proj

(MarchRProject)

marker_result

(MarkerResult) Output of add_marker_features().

peak_annotation

(character) Name of the stored annotation.

matches

(Matrix or NULL) Optional pre-supplied match matrix. Default NULL = retrieve via get_matches().

cutoff

(character) R expression evaluated against the marker tibble to filter foreground peaks per group. Default "p_val_adj <= 0.1 & log2_fc >= 0.5" (ArchR-equivalent).

background

(character) "all" (whole peak set) or "background_peaks" (GC/accessibility-matched peers via add_background_peaks()).

verbose

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

...

Unused.

Value

Long tibble with one row per (group x annotation) pair.

Details

Equivalent to ArchR's peakAnnoEnrichment() (AnnotationPeaks.R:1183) with two ArchR bugs fixed silently:

  • BackgroundProporition typo -> background_freq

  • Bonferroni denominator uses n_motifs (not ArchR's constant 7).