Skip to contents

Computes per-peak GC fraction using a BSgenome reference and stores it as a gc column on proj$peak_set. Also populates proj$peak_set$idx as a 1-based row identity column.

Usage

# S3 method for class 'MarchRProject'
add_peak_gc(
  proj,
  bsgenome = NULL,
  overwrite = FALSE,
  verbose = getOption("MarchR.verbose", FALSE),
  ...
)

Arguments

proj

(MarchRProject) Project with a populated peak set.

bsgenome

(BSgenome or NULL) Reference genome from which to extract sequences. When NULL (default), resolved from proj$genome$sequence (set via set_genome_sequence()).

overwrite

(logical) Whether to recompute when gc already exists. Default FALSE.

verbose

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

...

Currently unused.

Value

The modified MarchRProject with peak_set$gc and peak_set$idx populated.

Details

Uses BSgenome::getSeq() to retrieve sequences for each peak, then Biostrings::letterFrequency(_, "GC", as.prob = TRUE) to compute GC fraction. Required by add_motif_annotations() and add_background_peaks() downstream.

Equivalent to the inline GC computation inside ArchR's addReproduciblePeakSet().