R/util.R

Defines functions check_binned

Documented in check_binned

#' Helper function to check that a GInteractions object has been binned
#'
#' @param x GInteractions object.
#' @param res Integer - resolution in base-pairs.
#'
#' @rdname check_binned
#'

check_binned <- function(x, res) {

  ## Check that each anchor is binned correctly
  a1 <- length(which(width(first(x)) != res+1)) == 0
  a2 <- length(which(width(second(x)) != res+1)) == 0

  return(a1 & a2)

}
EricSDavis/hictoolsr documentation built on Sept. 4, 2022, 12:36 a.m.