This function normalizes a marginal track by dividing it by a smoothed track. The normalization is performed by taking the geometric mean of window_size windows in the original track and dividing each value by 2 raised to the power of the floored smoothed track value minus 1. The floored smoothed track value is calculated as the floor_percentile of the smoothed track.
Usage
normalize_marginal(
orig_track,
normed_track,
smoothed_track = NULL,
window_size = 20000,
iterator = 1000,
floor_percentile = 0.1,
overwrite = FALSE
)
Arguments
- orig_track
The original track to be normalized.
- normed_track
The name of the normalized track to be created.
- smoothed_track
The name of the smoothed track to be created. The original track is normalized by this track. If NULL, a temporary track is created.
- window_size
The size of the windows used for smoothing the track.
- iterator
The iterator used for smoothing the track.
- floor_percentile
The percentile used to calculate the floored smoothed track value.
- overwrite
Logical value indicating whether to overwrite an existing normalized track.
Examples
if (FALSE) {
# mcc_to_marginal runs internally normalize_marginal when normalize = TRUE
mcc_to_marginal_track(mc_counts, "pbmc_mc.marginal", normalize = TRUE)
# alternatively, you can run normalize_marginal directly
# normalize_marginal("pbmc_mc.marginal", "pbmc_mc.marginal_normed", "pbmc_mc.marginal_smoothed")
}