### These 2 internal helpers are the workhorses behind most "coverage"
### methods. All the hard work is almost entirely performed at the C level.
### Only some argument checking/normalization plus the "folding" of the
## 'shift' will be checked at the C level.
"'width' must be NULL or a single integer"
## 'weight' will be checked at the C level.
"'circle.length' must be a single integer"
## Some packages like easyRNASeq or TEQC pass 'width' as a named list-like
## object where each list element is a single number, an NA, or a NULL, when
## calling coverage() on a RangesList or RangedData object. They do so because,
## for whatever reason, we've been supporting this for a while, and also
## because, in the case of the method for RangedData objects, the arg default
## for 'width' used to be such a list (a named list of NULLs in that case).
## However, it never really made sense to support a named list-like object for
## 'width', and it makes even less sense now that the signature of the method
## for RangedData objects has been modified (as of BioC 2.13) to use the same
## arg defaults as the coverage() generic and all other methods.
## TODO: Deprecate support for this. Preferred 'width' form: NULL or an integer
"when 'width' is a list-like object, it must be named "
"when 'width' is a list-like object, each list element "
"should contain at most 1 element or be NULL"
### Returns a SimpleRleList object of the length of 'x'.
"'x' must be a CompressedIRangesList object"
"'shift' must be a numeric vector or list-like object"
## We purposedly omit to mention that 'width' can also be a named
## list-like object because this will be deprecated soon (this is
## why it's not documented in man/coverage-methods.Rd either).
"'width' must be NULL or an integer vector"
"'weight' must be a numeric vector or list-like object"
"'circle.length' must be an integer vector"
## "Fold" the coverage vectors in 'ans_listData' associated with a
## Note that the C code should have raised an error or warning already if
## the length of 'circle.length' or 'width' didn't allow proprer recycling
## to the length of 'x'. So using silent 'rep( , length.out=length(x))' is
## Because we "fold" the coverage vectors in an lapply() loop, it will
## be inefficient if 'x' has a lot of list elements associated with a
"is not a valid metadata column name of 'x'"