### Title: The expand method for uncompressing compressed data columns
## expand the aa column only, and keep rows adjacent to empty values
## expand the aa column only but do not keep rows
## expand the aa and then the bb column, but
## keeping rows next to empty compressed values
## expand the bb and then the aa column, but don't keep rows adjacent to

bb <- CharacterList(paste0("sna", 1:2),"foo", paste0("bar",1:3),c(),"hica")

### Title: Group elements of a vector-like object into a list-like object

## direct, quoted args (character literal parsed)
## specify both exprs and additional args
## toggle the active state by name or index

filts <- list(peaks = expression(peaks), promoters = expression(promoters),
find_eboxes = function(rd) rep(FALSE, nrow(rd)))
filters <- FilterRules(filts, active = FALSE)
filters <- FilterRules(under_peaks = peaks, in_promoters = "promoters")
filts <- list(under_peaks = expression(peaks),
filters <- FilterRules(filts, diffexp = de)
filts <- c("promoters", "peaks", "introns")
df <- DataFrame(peaks = c(TRUE, TRUE, FALSE, FALSE),
promoters = c(TRUE, FALSE, FALSE, TRUE),
fm <- evalSeparately(filters, df, serial = TRUE)
active(filters) <- c(FALSE, FALSE, TRUE)
active(filters)["promoters"] <- TRUE # use a filter name
active(filters) <- c(NA, 2) # NA's are dropped

###   overlapsAny,RangesList,RangedData-method %over% %within% %outside%
## (FIXME: the gap between 2 adjacent ranges should be still considered
## 0. So either we have an argument naming problem, or we should modify
## the handling of the 'maxgap' argument so that the user would need to
## specify maxgap = 0L to obtain the result below.)
## extract the regions of intersection between the overlapping ranges

findOverlaps(query, tree, select = "first")
findOverlaps(query, tree, select = "last")
findOverlaps(query, tree, select = "arbitrary")
findOverlaps(c(3L, 7L, 10L), subject, select = "first")
findOverlaps(query, subject, type = "start")
findOverlaps(query, subject, type = "start", maxgap = 1L)
findOverlaps(query, subject, type = "end", select = "first")
ov <- findOverlaps(query, subject, type = "within", maxgap = 1L)
query %over% subject    # same as overlapsAny(query, subject)
query %within% subject  # same as overlapsAny(query, subject,
findOverlaps(qlist, forest, select = "first")
findOverlaps(qlist, forest, select = "last")
findOverlaps(qlist, forest, select = "arbitrary")