Add GC content to the peak set
add_peak_gc.RdComputes 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 fromproj$genome$sequence(set viaset_genome_sequence()).- overwrite
(logical) Whether to recompute when
gcalready exists. DefaultFALSE.- verbose
(logical) Print progress messages. Default
getOption("MarchR.verbose", FALSE).- ...
Currently unused.
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().