Define function to flexibly bin bedpe data by hic resolution

binBedpe(bedpe, res, a1Pos, a2Pos)

Arguments

bedpe

GInteractions or data.table object with paired interactions

res

Integer - resolution in which to bin bedpe anchors

a1Pos, a2Pos

Position within anchors to resize the bin. Can be a character or integer vector of length 1 or length(bedpe) designating the position for each element in bedpe. Character options are "start", "end" and "center". Integers are referenced from the start position for '+' and '*' strands and from the end position for the '-' strand.

Value

GInteractions objected binned to res by a1Pos and a2Pos.