Write per-group base-resolution insertion coverage
write_pseudobulk_coverage.RdEmits one bedGraph per group giving the insertion count at each base. Used for visualization, QC, and comparing observed signal against model predictions.
Arguments
- pb
(MarchRPseudobulk) Output of
pseudobulk_fragments().- dir
(character) Output directory. Files land in
<dir>/coverage/.- insertion_mode
(character) Fragment ends to count. One of
"both","start_only","end_only". Default"both".- normalization
(character) One of
"none","cpm","n_cells". Default"none".- tile_width
(integer) Bin width for summing insertions. Requires
chrom_sizeswhen above 1. Default1L.- shift_start
(integer) Basepairs to shift fragment starts. Default
0L.- shift_end
(integer) Basepairs to shift fragment ends. Default
0L.- chrom_sizes
(data.frame or NULL) Chromosome sizes for clipping tiles. Default
NULL.- verbose
(logical) Print progress messages. Default
getOption("MarchR.verbose", FALSE).
Details
normalization = "none" is the default because count-based models expect
raw integer insertion counts; scaling produces non-integer values they cannot
consume.
All groups are written in a single pass over the fragments. The grouping factor
is handed to the writer rather than iterating pb$fragments, which would rescan
the fragments once per group.