Filter out transcripts with sharp drops / rises in coverage,
to be used in filter_coverage
to remove transcripts with potential
misalignments / internal priming etc. Filtering is done by convolving the
coverage with a kernal of 1s and -1s (e.g. c(1, 1, -1, -1)
, where
the width of the 1s and -1s are determined by the width
parameter),
and check if the maximum absolute value of the convolution is below a
threshold. If the convolution is below the threshold, TRUE
is returned,
otherwise FALSE
.
Arguments
- x
numeric vector of coverage values
- threshold
numeric, the threshold for the maximum absolute value of the convolution
- width
numeric, the width of the 1s and -1s in the kernal. E.g.
width = 2
will result in a kernal ofc(1, 1, -1, -1)
- trim
numeric, the proportion of the coverage values to ignore at both ends before convolution.