
Substitute short zero-gaps surrounded by nonzero pseudomoves
Source:R/ninetails_misc_helper_functions.R
substitute_gaps.RdSmooths the pseudomove vector by filling in isolated zero-gaps (length < 2) flanked by identical nonzero values. This avoids redundancy introduced by the z-score thresholding algorithm when the signal is jagged, so a single modification region is reported instead of multiple fragmented segments.
Arguments
- pseudomoves
Numeric vector. Pseudomove vector produced by the z-score filtering algorithm (
filter_signal_by_threshold), corresponding to the tail region of the read of interest as delimited by nanopolish polya function.
See also
filter_signal_by_threshold where this function
is called as a post-processing step